From 66140e39de5fcc691122ae8b6787250bb797f36d Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Wed, 4 Mar 2026 13:18:32 +0000 Subject: [PATCH] Configurations: 'specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/NotificationHubs/tspconfig.yaml', API Version: 2023-10-01-preview, SDK Release Type: beta, and CommitSHA: '98a4db5d6c32ff5a3ad5780fce6c716cafdbbeec' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=5959840 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 376 ++- .../README.md | 8 +- .../SAMPLE.md | 564 ++-- .../pom.xml | 8 +- .../NotificationHubsManager.java | 30 +- .../fluent/NamespacesClient.java | 395 +-- .../fluent/NotificationHubsClient.java | 373 +-- .../NotificationHubsManagementClient.java | 28 +- .../fluent/OperationsClient.java | 12 +- .../PrivateEndpointConnectionsClient.java | 292 ++ .../models/AdmCredentialProperties.java | 29 +- .../models/ApnsCredentialProperties.java | 100 +- .../models/BaiduCredentialProperties.java | 29 +- .../models/BrowserCredentialProperties.java | 142 + .../models/CheckAvailabilityResultInner.java | 112 +- .../fluent/models/DebugSendResponseInner.java | 164 +- .../fluent/models/DebugSendResult.java | 88 +- .../models/FcmV1CredentialProperties.java | 142 + .../models/GcmCredentialProperties.java | 31 +- .../models/MpnsCredentialProperties.java | 29 +- .../fluent/models/NamespaceProperties.java | 403 +-- .../fluent/models/NamespaceResourceInner.java | 302 ++- .../models/NotificationHubProperties.java | 193 +- .../models/NotificationHubResourceInner.java | 161 +- .../fluent/models/OperationInner.java | 54 +- .../fluent/models/PnsCredentials.java | 318 +++ .../models/PnsCredentialsProperties.java | 257 -- .../models/PnsCredentialsResourceInner.java | 232 +- ...rivateEndpointConnectionResourceInner.java | 157 ++ .../models/PrivateLinkResourceInner.java | 144 + .../fluent/models/ResourceListKeysInner.java | 100 +- ...aredAccessAuthorizationRuleProperties.java | 123 +- ...dAccessAuthorizationRuleResourceInner.java | 201 +- .../models/WnsCredentialProperties.java | 74 +- .../models/XiaomiCredentialProperties.java | 113 + .../fluent/models/package-info.java | 4 +- .../notificationhubs/fluent/package-info.java | 4 +- .../CheckAvailabilityResultImpl.java | 15 +- .../implementation/DebugSendResponseImpl.java | 23 +- .../implementation/NamespaceResourceImpl.java | 182 +- .../implementation/NamespacesClientImpl.java | 2283 +++++++--------- .../implementation/NamespacesImpl.java | 199 +- .../NotificationHubResourceImpl.java | 116 +- .../NotificationHubsClientImpl.java | 2387 ++++++----------- .../implementation/NotificationHubsImpl.java | 177 +- ...tificationHubsManagementClientBuilder.java | 30 +- .../NotificationHubsManagementClientImpl.java | 87 +- .../implementation/OperationImpl.java | 11 +- .../implementation/OperationsClientImpl.java | 148 +- .../implementation/OperationsImpl.java | 2 +- .../PnsCredentialsResourceImpl.java | 35 +- ...PrivateEndpointConnectionResourceImpl.java | 50 + .../PrivateEndpointConnectionsClientImpl.java | 1155 ++++++++ .../PrivateEndpointConnectionsImpl.java | 143 + .../PrivateLinkResourceImpl.java | 50 + .../implementation/ResourceListKeysImpl.java | 2 +- .../implementation/ResourceManagerUtils.java | 2 +- ...edAccessAuthorizationRuleResourceImpl.java | 86 +- .../models/NamespaceListResult.java | 57 +- .../models/NotificationHubListResult.java | 57 +- .../models/OperationListResult.java | 31 +- ...eEndpointConnectionResourceListResult.java | 97 + .../models/PrivateLinkResourceListResult.java | 96 + ...aredAccessAuthorizationRuleListResult.java | 57 +- .../implementation/package-info.java | 4 +- .../notificationhubs/models/AccessRights.java | 57 +- .../models/AdmCredential.java | 32 +- .../models/ApnsCredential.java | 72 +- .../notificationhubs/models/Availability.java | 89 + .../models/BaiduCredential.java | 32 +- .../models/BrowserCredential.java | 145 + .../models/CheckAvailabilityParameters.java | 98 +- .../models/CheckAvailabilityResult.java | 28 +- .../models/DebugSendResponse.java | 26 +- .../models/FcmV1Credential.java | 145 + .../models/GcmCredential.java | 28 +- .../notificationhubs/models/IpRule.java | 118 + .../models/LogSpecification.java | 125 + .../models/MetricSpecification.java | 208 ++ .../models/MpnsCredential.java | 32 +- .../NamespaceCreateOrUpdateParameters.java | 512 ---- .../models/NamespacePatchParameters.java | 82 +- .../models/NamespaceResource.java | 354 +-- .../models/NamespaceStatus.java | 61 + .../models/NamespaceType.java | 55 +- .../notificationhubs/models/Namespaces.java | 270 +- .../notificationhubs/models/NetworkAcls.java | 117 + ...tificationHubCreateOrUpdateParameters.java | 414 --- .../NotificationHubPatchParameters.java | 227 +- .../models/NotificationHubResource.java | 277 +- .../models/NotificationHubs.java | 318 +-- .../notificationhubs/models/Operation.java | 20 +- .../models/OperationDisplay.java | 39 +- .../models/OperationProperties.java | 74 + .../models/OperationProvisioningState.java | 76 + .../notificationhubs/models/Operations.java | 12 +- .../models/PnsCredentialsResource.java | 58 +- .../models/PolicyKeyResource.java | 86 + .../models/PolicyKeyType.java | 51 + .../models/PolicykeyResource.java | 96 - .../PrivateEndpointConnectionProperties.java | 170 ++ ...teEndpointConnectionProvisioningState.java | 82 + .../PrivateEndpointConnectionResource.java | 56 + .../models/PrivateEndpointConnections.java | 202 ++ .../models/PrivateLinkConnectionStatus.java | 61 + .../models/PrivateLinkResource.java | 55 + .../models/PrivateLinkResourceProperties.java | 112 + .../PublicInternetAuthorizationRule.java | 91 + .../models/PublicNetworkAccess.java | 51 + .../models/RegistrationResult.java | 121 + .../RemotePrivateEndpointConnection.java | 76 + ...motePrivateLinkServiceConnectionState.java | 120 + .../models/ReplicationRegion.java | 81 + .../models/ResourceListKeys.java | 13 +- .../models/ServiceSpecification.java | 94 + ...orizationRuleCreateOrUpdateParameters.java | 111 - ...SharedAccessAuthorizationRuleResource.java | 223 +- .../notificationhubs/models/Sku.java | 46 +- .../notificationhubs/models/SkuName.java | 4 +- .../models/WnsCredential.java | 66 +- .../models/XiaomiCredential.java | 122 + .../models/ZoneRedundancyPreference.java | 51 + .../notificationhubs/models/package-info.java | 4 +- .../notificationhubs/package-info.java | 4 +- .../src/main/java/module-info.java | 3 +- ...urcemanager-notificationhubs_metadata.json | 1 + .../proxy-config.json | 2 +- ...esourcemanager-notificationhubs.properties | 1 + .../NamespacesCheckAvailabilitySamples.java | 10 +- ...reateOrUpdateAuthorizationRuleSamples.java | 16 +- .../NamespacesCreateOrUpdateSamples.java | 27 +- ...espacesDeleteAuthorizationRuleSamples.java | 10 +- .../generated/NamespacesDeleteSamples.java | 13 +- ...NamespacesGetAuthorizationRuleSamples.java | 10 +- .../NamespacesGetByResourceGroupSamples.java | 10 +- .../NamespacesGetPnsCredentialsSamples.java | 23 + ...mespacesListAuthorizationRulesSamples.java | 10 +- .../NamespacesListByResourceGroupSamples.java | 13 +- .../generated/NamespacesListKeysSamples.java | 11 +- .../generated/NamespacesListSamples.java | 12 +- .../NamespacesRegenerateKeysSamples.java | 17 +- ...ples.java => NamespacesUpdateSamples.java} | 24 +- ...eckNotificationHubAvailabilitySamples.java | 10 +- ...reateOrUpdateAuthorizationRuleSamples.java | 19 +- ...NotificationHubsCreateOrUpdateSamples.java | 10 +- .../NotificationHubsDebugSendSamples.java | 21 +- ...ionHubsDeleteAuthorizationRuleSamples.java | 10 +- .../NotificationHubsDeleteSamples.java | 10 +- ...cationHubsGetAuthorizationRuleSamples.java | 10 +- ...ificationHubsGetPnsCredentialsSamples.java | 10 +- .../generated/NotificationHubsGetSamples.java | 10 +- ...tionHubsListAuthorizationRulesSamples.java | 10 +- .../NotificationHubsListKeysSamples.java | 12 +- .../NotificationHubsListSamples.java | 12 +- .../NotificationHubsPatchSamples.java | 31 - ...NotificationHubsRegenerateKeysSamples.java | 17 +- .../NotificationHubsUpdateSamples.java | 34 + .../generated/OperationsListSamples.java | 8 +- ...ivateEndpointConnectionsDeleteSamples.java | 25 + ...eEndpointConnectionsGetGroupIdSamples.java | 24 + .../PrivateEndpointConnectionsGetSamples.java | 25 + ...ndpointConnectionsListGroupIdsSamples.java | 23 + ...PrivateEndpointConnectionsListSamples.java | 23 + ...ivateEndpointConnectionsUpdateSamples.java | 35 + .../generated/AvailabilityTests.java | 16 + .../CheckAvailabilityParametersTests.java | 52 +- .../CheckAvailabilityResultInnerTests.java | 54 +- .../DebugSendResponseInnerTests.java | 56 +- .../generated/DebugSendResultTests.java | 20 +- .../generated/IpRuleTests.java | 31 + .../generated/LogSpecificationTests.java | 19 + .../generated/MetricSpecificationTests.java | 17 + ...amespaceCreateOrUpdateParametersTests.java | 101 - .../generated/NamespaceListResultTests.java | 106 - .../NamespacePatchParametersTests.java | 58 - .../generated/NamespacePropertiesTests.java | 64 - .../NamespaceResourceInnerTests.java | 101 - ...heckAvailabilityWithResponseMockTests.java | 41 +- ...esCreateOrUpdateWithResponseMockTests.java | 96 - ...uthorizationRuleWithResponseMockTests.java | 9 +- ...ByResourceGroupWithResponseMockTests.java} | 13 +- ...tByResourceGroupWithResponseMockTests.java | 60 - ...amespacesListByResourceGroupMockTests.java | 60 - .../generated/NamespacesListMockTests.java | 59 - .../generated/NetworkAclsTests.java | 40 + ...nHubAvailabilityWithResponseMockTests.java | 40 +- ...ionHubsDebugSendWithResponseMockTests.java | 25 +- ...uthorizationRuleWithResponseMockTests.java | 8 +- ...cationHubsDeleteWithResponseMockTests.java | 8 +- .../generated/OperationDisplayTests.java | 12 +- .../generated/OperationInnerTests.java | 11 +- .../generated/OperationListResultTests.java | 14 +- .../generated/OperationPropertiesTests.java | 17 + .../generated/OperationsListMockTests.java | 8 +- ...vateEndpointConnectionPropertiesTests.java | 40 + ...eEndpointConnectionResourceInnerTests.java | 42 + ...ointConnectionResourceListResultTests.java | 19 + ...ctionsGetGroupIdWithResponseMockTests.java | 37 + ...ntConnectionsGetWithResponseMockTests.java | 44 + ...pointConnectionsListGroupIdsMockTests.java | 37 + ...ivateEndpointConnectionsListMockTests.java | 44 + ...ateEndpointConnectionsUpdateMockTests.java | 56 + .../PrivateLinkResourceInnerTests.java | 17 + .../PrivateLinkResourceListResultTests.java | 19 + .../PrivateLinkResourcePropertiesTests.java | 17 + .../PublicInternetAuthorizationRuleTests.java | 29 + .../generated/RegistrationResultTests.java | 17 + .../RemotePrivateEndpointConnectionTests.java | 22 + ...rivateLinkServiceConnectionStateTests.java | 28 + .../generated/ServiceSpecificationTests.java | 17 + .../notificationhubs/generated/SkuTests.java | 34 +- .../tsp-location.yaml | 4 + 212 files changed, 13225 insertions(+), 8940 deletions(-) create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/PrivateEndpointConnectionsClient.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BrowserCredentialProperties.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/FcmV1CredentialProperties.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentials.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsProperties.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateEndpointConnectionResourceInner.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/XiaomiCredentialProperties.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionResourceImpl.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsImpl.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateLinkResourceImpl.java rename sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/{ => implementation}/models/NamespaceListResult.java (60%) rename sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/{ => implementation}/models/NotificationHubListResult.java (60%) rename sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/{ => implementation}/models/OperationListResult.java (71%) create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateEndpointConnectionResourceListResult.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateLinkResourceListResult.java rename sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/{ => implementation}/models/SharedAccessAuthorizationRuleListResult.java (61%) create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Availability.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredential.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1Credential.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/IpRule.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/LogSpecification.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MetricSpecification.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceCreateOrUpdateParameters.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceStatus.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NetworkAcls.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubCreateOrUpdateParameters.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProperties.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProvisioningState.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyResource.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyType.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicykeyResource.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProperties.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProvisioningState.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionResource.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnections.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkConnectionStatus.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResource.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceProperties.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicInternetAuthorizationRule.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicNetworkAccess.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RegistrationResult.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateEndpointConnection.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateLinkServiceConnectionState.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ReplicationRegion.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ServiceSpecification.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredential.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ZoneRedundancyPreference.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/azure-resourcemanager-notificationhubs_metadata.json create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/azure-resourcemanager-notificationhubs.properties create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetPnsCredentialsSamples.java rename sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/{NamespacesPatchSamples.java => NamespacesUpdateSamples.java} (54%) delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsPatchSamples.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsUpdateSamples.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsDeleteSamples.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdSamples.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetSamples.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsSamples.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListSamples.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateSamples.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/AvailabilityTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/IpRuleTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/LogSpecificationTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/MetricSpecificationTests.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceCreateOrUpdateParametersTests.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceListResultTests.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacePatchParametersTests.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacePropertiesTests.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceResourceInnerTests.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateWithResponseMockTests.java rename sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/{NamespacesDeleteMockTests.java => NamespacesDeleteByResourceGroupWithResponseMockTests.java} (69%) delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListByResourceGroupMockTests.java delete mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListMockTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NetworkAclsTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationPropertiesTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionPropertiesTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionResourceInnerTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionResourceListResultTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdWithResponseMockTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsMockTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListMockTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateMockTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourceInnerTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourceListResultTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourcePropertiesTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PublicInternetAuthorizationRuleTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RegistrationResultTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RemotePrivateEndpointConnectionTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RemotePrivateLinkServiceConnectionStateTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/ServiceSpecificationTests.java create mode 100644 sdk/notificationhubs/azure-resourcemanager-notificationhubs/tsp-location.yaml diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/CHANGELOG.md b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/CHANGELOG.md index 5d48ed5516b8..51df82273b9d 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/CHANGELOG.md +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/CHANGELOG.md @@ -1,14 +1,382 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2026-03-04) -### Features Added +- 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 api-version 2023-10-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.SharedAccessAuthorizationRuleListResult` was removed -### Other Changes +#### `models.NamespaceCreateOrUpdateParameters` was removed + +#### `models.NotificationHubListResult` was removed + +#### `models.PolicykeyResource` was removed + +#### `models.NamespaceListResult` was removed + +#### `models.OperationListResult` was removed + +#### `models.SharedAccessAuthorizationRuleCreateOrUpdateParameters` was removed + +#### `models.NotificationHubCreateOrUpdateParameters` was removed + +#### `models.NamespaceResource$DefinitionStages` was modified + +* Required stage 3 was added +* `withLocation(java.lang.String)` was removed in stage 1 +* `withLocation(com.azure.core.management.Region)` was removed in stage 1 + +#### `models.SharedAccessAuthorizationRuleResource$Definition` was modified + +* `withProperties(fluent.models.SharedAccessAuthorizationRuleProperties)` was removed + +#### `models.BaiduCredential` was modified + +* `validate()` was removed + +#### `models.GcmCredential` was modified + +* `validate()` was removed + +#### `models.NotificationHubResource` was modified + +* `debugSendWithResponse(java.lang.Object,com.azure.core.util.Context)` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `validate()` was removed + +#### `models.MpnsCredential` was modified + +* `validate()` was removed + +#### `models.Sku` was modified + +* `validate()` was removed + +#### `models.DebugSendResponse` was modified + +* `java.lang.Float failure()` -> `java.lang.Long failure()` +* `java.lang.Object results()` -> `java.util.List results()` +* `java.lang.Float success()` -> `java.lang.Long success()` +* `sku()` was removed + +#### `models.NamespacePatchParameters` was modified + +* `validate()` was removed + +#### `models.PnsCredentialsResource` was modified + +* `sku()` was removed + +#### `models.NotificationHubResource$Update` was modified + +* `withNamePropertiesName(java.lang.String)` was removed +* `withAuthorizationRules(java.util.List)` was removed + +#### `models.ApnsCredential` was modified + +* `validate()` was removed + +#### `models.SharedAccessAuthorizationRuleResource$Update` was modified + +* `withProperties(fluent.models.SharedAccessAuthorizationRuleProperties)` was removed + +#### `models.Namespaces` was modified + +* `listByResourceGroup(java.lang.String,com.azure.core.util.Context)` was removed +* `void deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` -> `com.azure.core.http.rest.Response deleteByIdWithResponse(java.lang.String,com.azure.core.util.Context)` +* `delete(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed +* `regenerateKeysWithResponse(java.lang.String,java.lang.String,java.lang.String,models.PolicykeyResource,com.azure.core.util.Context)` was removed +* `regenerateKeys(java.lang.String,java.lang.String,java.lang.String,models.PolicykeyResource)` was removed +* `list(com.azure.core.util.Context)` was removed + +#### `models.AccessRights` was modified + +* `valueOf(java.lang.String)` was removed +* `models.AccessRights[] values()` -> `java.util.Collection values()` +* `toString()` was removed + +#### `models.NotificationHubPatchParameters` was modified + +* `withLocation(java.lang.String)` was removed +* `namePropertiesName()` was removed +* `withTags(java.util.Map)` was removed +* `id()` was removed +* `validate()` was removed +* `withAuthorizationRules(java.util.List)` was removed +* `withNamePropertiesName(java.lang.String)` was removed +* `type()` was removed + +#### `models.WnsCredential` was modified + +* `validate()` was removed + +#### `models.NotificationHubResource$Definition` was modified + +* `withAuthorizationRules(java.util.List)` was removed + +#### `models.NotificationHubs` was modified + +* `debugSendWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.Object,com.azure.core.util.Context)` was removed +* `regenerateKeysWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.PolicykeyResource,com.azure.core.util.Context)` was removed +* `createOrUpdateAuthorizationRuleWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.SharedAccessAuthorizationRuleCreateOrUpdateParameters,com.azure.core.util.Context)` was removed +* `createOrUpdateAuthorizationRule(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.SharedAccessAuthorizationRuleCreateOrUpdateParameters)` was removed +* `regenerateKeys(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.PolicykeyResource)` was removed +* `list(java.lang.String,java.lang.String,com.azure.core.util.Context)` was removed + +#### `models.CheckAvailabilityParameters` was modified + +* `validate()` was removed + +#### `models.AdmCredential` was modified + +* `validate()` was removed + +#### `models.NamespaceType` was modified + +* `models.NamespaceType[] values()` -> `java.util.Collection values()` +* `toString()` was removed +* `valueOf(java.lang.String)` was removed + +#### `models.SharedAccessAuthorizationRuleResource` was modified + +* `sku()` was removed +* `regenerateKeysWithResponse(models.PolicykeyResource,com.azure.core.util.Context)` was removed +* `java.lang.String modifiedTime()` -> `java.time.OffsetDateTime modifiedTime()` +* `java.lang.String createdTime()` -> `java.time.OffsetDateTime createdTime()` +* `regenerateKeys(models.PolicykeyResource)` was removed + +#### `models.NamespaceResource$Definition` was modified + +* `withNamePropertiesName(java.lang.String)` was removed +* `withSubscriptionId(java.lang.String)` was removed +* `withRegion(java.lang.String)` was removed +* `withCreatedAt(java.time.OffsetDateTime)` was removed +* `withCritical(java.lang.Boolean)` was removed +* `withLocation(com.azure.core.management.Region)` was removed +* `withUpdatedAt(java.time.OffsetDateTime)` was removed +* `withLocation(java.lang.String)` was removed +* `withProvisioningState(java.lang.String)` was removed +* `withStatus(java.lang.String)` was removed +* `withEnabled(java.lang.Boolean)` was removed +* `withServiceBusEndpoint(java.lang.String)` was removed + +#### `models.NamespaceResource` was modified + +* `java.lang.String provisioningState()` -> `models.OperationProvisioningState provisioningState()` +* `java.lang.String status()` -> `models.NamespaceStatus status()` + +### Features Added + +* `models.OperationProperties` was added + +* `models.PrivateLinkConnectionStatus` was added + +* `models.PolicyKeyResource` was added + +* `models.ReplicationRegion` was added + +* `models.Availability` was added + +* `models.RemotePrivateEndpointConnection` was added + +* `models.NamespaceStatus` was added + +* `models.OperationProvisioningState` was added + +* `models.PrivateEndpointConnections` was added + +* `models.NetworkAcls` was added + +* `models.RegistrationResult` was added + +* `models.BrowserCredential` was added + +* `models.PrivateEndpointConnectionProperties` was added + +* `models.FcmV1Credential` was added + +* `models.PrivateEndpointConnectionResource` was added + +* `models.LogSpecification` was added + +* `models.ZoneRedundancyPreference` was added + +* `models.IpRule` was added + +* `models.PrivateLinkResourceProperties` was added + +* `models.ServiceSpecification` was added + +* `models.RemotePrivateLinkServiceConnectionState` was added + +* `models.XiaomiCredential` was added + +* `models.PublicNetworkAccess` was added + +* `models.PrivateLinkResource` was added + +* `models.MetricSpecification` was added + +* `models.PublicInternetAuthorizationRule` was added + +* `models.PolicyKeyType` was added + +* `models.PrivateEndpointConnectionProvisioningState` was added + +#### `models.SharedAccessAuthorizationRuleResource$Definition` was modified + +* `withRegion(java.lang.String)` was added +* `withTags(java.util.Map)` was added +* `withRights(java.util.List)` was added +* `withRegion(com.azure.core.management.Region)` was added +* `withPrimaryKey(java.lang.String)` was added +* `withSecondaryKey(java.lang.String)` was added + +#### `models.NotificationHubResource` was modified + +* `dailyMaxActiveDevices()` was added +* `browserCredential()` was added +* `debugSendWithResponse(com.azure.core.util.Context)` was added +* `xiaomiCredential()` was added +* `fcmV1Credential()` was added +* `systemData()` was added + +#### `models.OperationDisplay` was modified + +* `description()` was added + +#### `models.NamespaceResource$Update` was modified + +* `withProperties(fluent.models.NamespaceProperties)` was added + +#### `models.DebugSendResponse` was modified + +* `systemData()` was added + +#### `models.NamespacePatchParameters` was modified + +* `properties()` was added +* `withProperties(fluent.models.NamespaceProperties)` was added + +#### `models.PnsCredentialsResource` was modified + +* `systemData()` was added +* `browserCredential()` was added +* `xiaomiCredential()` was added +* `fcmV1Credential()` was added + +#### `models.NotificationHubResource$Update` was modified + +* `withXiaomiCredential(models.XiaomiCredential)` was added +* `withBrowserCredential(models.BrowserCredential)` was added +* `withFcmV1Credential(models.FcmV1Credential)` was added + +#### `models.SharedAccessAuthorizationRuleResource$Update` was modified + +* `withRights(java.util.List)` was added +* `withPrimaryKey(java.lang.String)` was added +* `withSecondaryKey(java.lang.String)` was added +* `withTags(java.util.Map)` was added + +#### `models.Namespaces` was modified + +* `listByResourceGroup(java.lang.String,java.lang.String,java.lang.Integer,com.azure.core.util.Context)` was added +* `deleteByResourceGroupWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `regenerateKeysWithResponse(java.lang.String,java.lang.String,java.lang.String,models.PolicyKeyResource,com.azure.core.util.Context)` was added +* `list(java.lang.String,java.lang.Integer,com.azure.core.util.Context)` was added +* `getPnsCredentialsWithResponse(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getPnsCredentials(java.lang.String,java.lang.String)` was added +* `regenerateKeys(java.lang.String,java.lang.String,java.lang.String,models.PolicyKeyResource)` was added + +#### `models.AccessRights` was modified + +* `AccessRights()` was added + +#### `models.NotificationHubPatchParameters` was modified + +* `withFcmV1Credential(models.FcmV1Credential)` was added +* `fcmV1Credential()` was added +* `xiaomiCredential()` was added +* `withXiaomiCredential(models.XiaomiCredential)` was added +* `browserCredential()` was added +* `withBrowserCredential(models.BrowserCredential)` was added +* `tags()` was added +* `withName(java.lang.String)` was added +* `dailyMaxActiveDevices()` was added + +#### `models.WnsCredential` was modified + +* `wnsCertificate()` was added +* `withWnsCertificate(java.lang.String)` was added +* `certificateKey()` was added +* `withCertificateKey(java.lang.String)` was added + +#### `models.NotificationHubResource$Definition` was modified + +* `withXiaomiCredential(models.XiaomiCredential)` was added +* `withFcmV1Credential(models.FcmV1Credential)` was added +* `withBrowserCredential(models.BrowserCredential)` was added + +#### `models.Operation` was modified + +* `isDataAction()` was added +* `properties()` was added + +#### `NotificationHubsManager` was modified + +* `privateEndpointConnections()` was added + +#### `models.NotificationHubs` was modified + +* `regenerateKeys(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.PolicyKeyResource)` was added +* `createOrUpdateAuthorizationRuleWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.SharedAccessAuthorizationRuleResourceInner,com.azure.core.util.Context)` was added +* `debugSendWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `createOrUpdateAuthorizationRule(java.lang.String,java.lang.String,java.lang.String,java.lang.String,fluent.models.SharedAccessAuthorizationRuleResourceInner)` was added +* `regenerateKeysWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,models.PolicyKeyResource,com.azure.core.util.Context)` was added +* `list(java.lang.String,java.lang.String,java.lang.String,java.lang.Integer,com.azure.core.util.Context)` was added + +#### `models.CheckAvailabilityResult` was modified + +* `systemData()` was added + +#### `models.NamespaceType` was modified + +* `NamespaceType()` was added + +#### `models.SharedAccessAuthorizationRuleResource` was modified + +* `regenerateKeysWithResponse(models.PolicyKeyResource,com.azure.core.util.Context)` was added +* `systemData()` was added +* `regenerateKeys(models.PolicyKeyResource)` was added + +#### `models.NamespaceResource$Definition` was modified + +* `withRegion(java.lang.String)` was added +* `withProvisioningState(models.OperationProvisioningState)` was added +* `withNetworkAcls(models.NetworkAcls)` was added +* `withStatus(models.NamespaceStatus)` was added +* `withZoneRedundancy(models.ZoneRedundancyPreference)` was added +* `withPublicNetworkAccess(models.PublicNetworkAccess)` was added +* `withPnsCredentials(fluent.models.PnsCredentials)` was added +* `withRegion(com.azure.core.management.Region)` was added +* `withReplicationRegion(models.ReplicationRegion)` was added + +#### `models.NamespaceResource` was modified + +* `zoneRedundancy()` was added +* `networkAcls()` was added +* `publicNetworkAccess()` was added +* `replicationRegion()` was added +* `getPnsCredentials()` was added +* `getPnsCredentialsWithResponse(com.azure.core.util.Context)` was added +* `systemData()` was added +* `pnsCredentials()` was added +* `privateEndpointConnections()` was added ## 1.0.0 (2024-12-26) diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/README.md b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/README.md index 20d5496823da..90c988aa7ec0 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 api-version 2023-10-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ NotificationHubsManager manager = NotificationHubsManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/SAMPLE.md b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/SAMPLE.md index a09225bdc951..291bea39b28b 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,12 +32,21 @@ - [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 @@ -47,17 +57,15 @@ import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParame */ 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: 2023-10-01-preview/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) { + namespacesCheckAvailability(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces() .checkAvailabilityWithResponse(new CheckAvailabilityParameters().withName("sdk-Namespace-2924"), com.azure.core.util.Context.NONE); @@ -68,8 +76,14 @@ 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.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; @@ -78,22 +92,27 @@ import java.util.Map; */ 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: 2023-10-01-preview/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) { + public static void + namespacesCreateOrUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces() .define("nh-sdk-ns") - .withLocation("South Central US") + .withRegion("South Central US") .withExistingResourceGroup("5ktrial") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withSku(new Sku().withName(SkuName.STANDARD).withTier("Standard")) + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .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(); } @@ -114,7 +133,6 @@ public final class NamespacesCreateOrUpdateSamples { ### Namespaces_CreateOrUpdateAuthorizationRule ```java -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; import com.azure.resourcemanager.notificationhubs.models.AccessRights; import java.util.Arrays; @@ -123,22 +141,19 @@ import java.util.Arrays; */ 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: 2023-10-01-preview/Namespaces/AuthorizationRuleCreateOrUpdate.json */ /** - * Sample code: NameSpaceAuthorizationRuleCreate. + * Sample code: Namespaces_CreateOrUpdateAuthorizationRule. * * @param manager Entry point to NotificationHubsManager. */ - public static void - nameSpaceAuthorizationRuleCreate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + 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))) + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)) .create(); } } @@ -152,17 +167,16 @@ public final class NamespacesCreateOrUpdateAuthorizationRuleSamples { */ 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: 2023-10-01-preview/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", com.azure.core.util.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); } } ``` @@ -175,17 +189,15 @@ public final class NamespacesDeleteSamples { */ 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: 2023-10-01-preview/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) { + namespacesDeleteAuthorizationRule(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces() .deleteAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", com.azure.core.util.Context.NONE); @@ -201,17 +213,15 @@ public final class NamespacesDeleteAuthorizationRuleSamples { */ 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: 2023-10-01-preview/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) { + namespacesGetAuthorizationRule(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces() .getAuthorizationRuleWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", com.azure.core.util.Context.NONE); @@ -227,21 +237,41 @@ public final class NamespacesGetAuthorizationRuleSamples { */ 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: 2023-10-01-preview/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) { + public static void namespacesGet(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces().getByResourceGroupWithResponse("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); } } ``` +### Namespaces_GetPnsCredentials + +```java +/** + * Samples for Namespaces GetPnsCredentials. + */ +public final class NamespacesGetPnsCredentialsSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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 ```java @@ -250,17 +280,15 @@ public final class NamespacesGetByResourceGroupSamples { */ 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: 2023-10-01-preview/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(com.azure.core.util.Context.NONE); + public static void namespacesListAll(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().list(null, null, com.azure.core.util.Context.NONE); } } ``` @@ -273,17 +301,15 @@ public final class NamespacesListSamples { */ 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: 2023-10-01-preview/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) { + namespacesListAuthorizationRules(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces().listAuthorizationRules("5ktrial", "nh-sdk-ns", com.azure.core.util.Context.NONE); } } @@ -297,18 +323,15 @@ public final class NamespacesListAuthorizationRulesSamples { */ 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: 2023-10-01-preview/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", com.azure.core.util.Context.NONE); + public static void namespacesList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.namespaces().listByResourceGroup("5ktrial", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -321,17 +344,14 @@ public final class NamespacesListByResourceGroupSamples { */ 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: 2023-10-01-preview/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) { + public static void namespacesListKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces() .listKeysWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", com.azure.core.util.Context.NONE); @@ -339,9 +359,39 @@ public final class NamespacesListKeysSamples { } ``` -### Namespaces_Patch +### 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: 2023-10-01-preview/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_Update ```java +import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceProperties; +import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentials; +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; import com.azure.resourcemanager.notificationhubs.models.Sku; import com.azure.resourcemanager.notificationhubs.models.SkuName; @@ -349,26 +399,27 @@ import java.util.HashMap; import java.util.Map; /** - * Samples for Namespaces Patch. + * Samples for Namespaces Update. */ -public final class NamespacesPatchSamples { +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: 2023-10-01-preview/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) { + 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", "value1", "tag2", "value2")) - .withSku(new Sku().withName(SkuName.STANDARD).withTier("Standard")) + .withTags(mapOf("tag1", "value3")) + .withSku(new Sku().withName(SkuName.FREE)) + .withProperties(new NamespaceProperties().withPnsCredentials(new PnsCredentials() + .withGcmCredential(new GcmCredential().withGcmEndpoint("https://fcm.googleapis.com/fcm/send") + .withGoogleApiKey("fakeTokenPlaceholder")))) .apply(); } @@ -386,34 +437,6 @@ public final class NamespacesPatchSamples { } ``` -### Namespaces_RegenerateKeys - -```java -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("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); - } -} -``` - ### NotificationHubs_CheckNotificationHubAvailability ```java @@ -424,16 +447,14 @@ import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParame */ 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: 2023-10-01-preview/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", @@ -451,17 +472,15 @@ public final class NotificationHubsCheckNotificationHubAvailabilitySamples { */ 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: 2023-10-01-preview/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) { + notificationHubsCreateOrUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.notificationHubs() .define("nh-sdk-hub") .withRegion("eastus") @@ -474,9 +493,8 @@ public final class NotificationHubsCreateOrUpdateSamples { ### NotificationHubs_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.SharedAccessAuthorizationRuleCreateOrUpdateParameters; import java.util.Arrays; /** @@ -484,23 +502,19 @@ import java.util.Arrays; */ 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: 2023-10-01-preview/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))), + "MyManageSharedAccessKey", new SharedAccessAuthorizationRuleResourceInner().withRights( + Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)), com.azure.core.util.Context.NONE); } } @@ -509,31 +523,22 @@ public final class NotificationHubsCreateOrUpdateAuthorizationRuleSamples { ### NotificationHubs_DebugSend ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - /** * 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: 2023-10-01-preview/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 { + public static void + notificationHubsDebugSend(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.notificationHubs() - .debugSendWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"data\":{\"message\":\"Hello\"}}", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); + .debugSendWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", com.azure.core.util.Context.NONE); } } ``` @@ -546,17 +551,15 @@ public final class NotificationHubsDebugSendSamples { */ 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: 2023-10-01-preview/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) { + notificationHubsDelete(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.notificationHubs() .deleteWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", com.azure.core.util.Context.NONE); } @@ -571,16 +574,14 @@ public final class NotificationHubsDeleteSamples { */ 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: 2023-10-01-preview/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", @@ -597,16 +598,14 @@ public final class NotificationHubsDeleteAuthorizationRuleSamples { */ 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: 2023-10-01-preview/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) { + 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); } @@ -621,16 +620,14 @@ public final class NotificationHubsGetSamples { */ 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: 2023-10-01-preview/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", @@ -647,17 +644,15 @@ public final class NotificationHubsGetAuthorizationRuleSamples { */ 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: 2023-10-01-preview/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) { + notificationHubsGetPnsCredentials(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.notificationHubs() .getPnsCredentialsWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", com.azure.core.util.Context.NONE); } @@ -672,18 +667,16 @@ public final class NotificationHubsGetPnsCredentialsSamples { */ 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: 2023-10-01-preview/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", com.azure.core.util.Context.NONE); + notificationHubsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.notificationHubs().list("5ktrial", "nh-sdk-ns", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -696,16 +689,14 @@ public final class NotificationHubsListSamples { */ 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: 2023-10-01-preview/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", com.azure.core.util.Context.NONE); @@ -721,17 +712,15 @@ public final class NotificationHubsListAuthorizationRulesSamples { */ 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: 2023-10-01-preview/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) { + 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); @@ -739,83 +728,232 @@ public final class NotificationHubsListKeysSamples { } ``` -### NotificationHubs_Patch +### NotificationHubs_RegenerateKeys + +```java +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyType; + +/** + * Samples for NotificationHubs RegenerateKeys. + */ +public final class NotificationHubsRegenerateKeysSamples { + /* + * x-ms-original-file: 2023-10-01-preview/NotificationHubs/AuthorizationRuleRegenerateKey.json + */ + /** + * Sample code: NotificationHubs_RegenerateKeys. + * + * @param manager Entry point to NotificationHubsManager. + */ + 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_Update ```java +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; import com.azure.resourcemanager.notificationhubs.models.NotificationHubResource; /** - * Samples for NotificationHubs Patch. + * Samples for NotificationHubs Update. */ -public final class NotificationHubsPatchSamples { +public final class NotificationHubsUpdateSamples { /* - * x-ms-original-file: - * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/ - * NotificationHubs/NotificationHubPatch.json + * x-ms-original-file: 2023-10-01-preview/NotificationHubs/Update.json */ /** - * Sample code: NotificationHubPatch. + * Sample code: NotificationHubs_Update. * * @param manager Entry point to NotificationHubsManager. */ public static void - notificationHubPatch(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + 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().apply(); + resource.update() + .withRegistrationTtl("10675199.02:48:05.4775807") + .withGcmCredential(new GcmCredential().withGcmEndpoint("https://fcm.googleapis.com/fcm/send") + .withGoogleApiKey("fakeTokenPlaceholder")) + .apply(); } } ``` -### NotificationHubs_RegenerateKeys +### Operations_List ```java -import com.azure.resourcemanager.notificationhubs.models.PolicykeyResource; +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: 2023-10-01-preview/NHOperationsList.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to NotificationHubsManager. + */ + public static void operationsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Delete +```java /** - * Samples for NotificationHubs RegenerateKeys. + * Samples for PrivateEndpointConnections Delete. */ -public final class NotificationHubsRegenerateKeysSamples { +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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: 2023-10-01-preview/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/stable/2017-04-01/examples/ - * NotificationHubs/NotificationHubAuthorizationRuleRegenrateKey.json + * x-ms-original-file: 2023-10-01-preview/Namespaces/PrivateLinkResourceGet.json */ /** - * Sample code: NotificationHubAuthorizationRuleRegenrateKey. + * Sample code: PrivateEndpointConnections_GetGroupId. * * @param manager Entry point to NotificationHubsManager. */ - public static void notificationHubAuthorizationRuleRegenrateKey( + public static void privateEndpointConnectionsGetGroupId( com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.notificationHubs() - .regenerateKeysWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", - new PolicykeyResource().withPolicyKey("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + manager.privateEndpointConnections() + .getGroupIdWithResponse("5ktrial", "nh-sdk-ns", "namespace", com.azure.core.util.Context.NONE); } } ``` -### Operations_List +### PrivateEndpointConnections_List ```java /** - * Samples for Operations List. + * Samples for PrivateEndpointConnections List. */ -public final class OperationsListSamples { +public final class PrivateEndpointConnectionsListSamples { /* - * x-ms-original-file: - * specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/stable/2017-04-01/examples/ - * NHOperationsList.json + * x-ms-original-file: 2023-10-01-preview/Namespaces/PrivateEndpointConnectionList.json */ /** - * Sample code: OperationsList. + * Sample code: PrivateEndpointConnections_List. * * @param manager Entry point to NotificationHubsManager. */ - public static void operationsList(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + 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: 2023-10-01-preview/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: 2023-10-01-preview/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 e2e034575219..258371804d44 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -18,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 api-version 2023-10-01-preview. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + 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 25fc305c8164..4db4b4fb982c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs; @@ -22,25 +22,29 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsManagementClient; 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.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; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; /** * Entry point to NotificationHubsManager. - * Azure NotificationHub client. + * Microsoft Notification Hubs Resource Provider REST API. */ public final class NotificationHubsManager { private Operations operations; @@ -49,6 +53,8 @@ public final class NotificationHubsManager { private NotificationHubs notificationHubs; + private PrivateEndpointConnections privateEndpointConnections; + private final NotificationHubsManagementClient clientObject; private NotificationHubsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -101,6 +107,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-notificationhubs.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -208,12 +217,14 @@ public NotificationHubsManager authenticate(TokenCredential credential, AzurePro Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.notificationhubs") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -296,6 +307,19 @@ public NotificationHubs notificationHubs() { return notificationHubs; } + /** + * 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; + } + /** * Gets wrapped service client NotificationHubsManagementClient providing direct access to the underlying * auto-generated API implementation, based on Azure REST API. 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 2ea7f3869b18..7800b914aa7f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent; @@ -13,422 +13,455 @@ 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. */ 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. + * Gets an authorization rule for a namespace by name. * - * @param parameters The namespace 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 description of a CheckAvailability resource along with {@link Response}. + * @return an authorization rule for a namespace by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, - Context context); + Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String authorizationRuleName, 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. + * Gets an authorization rule for a namespace by name. * - * @param parameters The namespace 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 description of a CheckAvailability resource. + * @return an authorization rule for a namespace by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters); + SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName); /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. + * Creates an authorization rule for a namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * @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 description of a Namespace resource along with {@link Response}. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, - NamespaceCreateOrUpdateParameters parameters, Context context); + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context); /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. + * Creates an authorization rule for a namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * @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 POST requests that return single SharedAccessAuthorizationRule. */ @ServiceMethod(returns = ReturnType.SINGLE) - NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, - NamespaceCreateOrUpdateParameters parameters); + SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleResourceInner parameters); /** - * Patches the existing namespace. + * Deletes a namespace authorization rule. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * @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 description of a Namespace resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response patchWithResponse(String resourceGroupName, String namespaceName, - NamespacePatchParameters parameters, Context context); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Patches the existing namespace. + * Deletes a namespace authorization rule. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * @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 description of a Namespace resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - NamespaceResourceInner patch(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * 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 com.azure.core.management.exception.ManagementException 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. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * 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 {@link SyncPoller} for polling of long-running operation. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, Context context); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Gets the Primary and Secondary ConnectionStrings to 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 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 along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName); + Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Gets the Primary and Secondary ConnectionStrings to the 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. + * @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 namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String namespaceName, Context context); + ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Returns the description for the specified namespace. + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. * - * @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 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 description of a Namespace resource along with {@link Response}. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, - Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters, Context context); /** - * Returns the description for the specified namespace. + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. * - * @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 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). */ @ServiceMethod(returns = ReturnType.SINGLE) - NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName); + ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + PolicyKeyResource parameters); /** - * Creates an authorization rule for a namespace. + * Returns the given 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 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 AuthorizationRules along with {@link Response}. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, + Context context); /** - * Creates an authorization rule for a namespace. + * Returns the given 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 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 AuthorizationRules. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, - String namespaceName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters); + NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName); /** - * Deletes a namespace authorization rule. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule 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 com.azure.core.management.exception.ManagementException 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 notification Hubs Namespace Resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NamespaceResourceInner> beginCreateOrUpdate(String resourceGroupName, + String namespaceName, NamespaceResourceInner parameters); + + /** + * 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 {@link Response}. + * @return the {@link SyncPoller} for polling of notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, NamespaceResourceInner> beginCreateOrUpdate(String resourceGroupName, + String namespaceName, NamespaceResourceInner parameters, Context context); /** - * Deletes a namespace authorization rule. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule 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 com.azure.core.management.exception.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 deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters); /** - * Gets an authorization rule for a namespace by name. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule 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 an authorization rule for a namespace by name along with {@link Response}. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String authorizationRuleName, Context context); + NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters, Context context); /** - * Gets an authorization rule for a namespace by name. + * Patches the existing namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule 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 an authorization rule for a namespace by name. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName); + Response updateWithResponse(String resourceGroupName, String namespaceName, + NamespacePatchParameters parameters, Context context); /** - * Lists the available namespaces within a resourceGroup. + * Patches the existing namespace. * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * @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 the response of the List Namespace operation as paginated response with {@link PagedIterable}. + * @return notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + NamespaceResourceInner update(String resourceGroupName, String namespaceName, NamespacePatchParameters parameters); /** - * Lists the available namespaces within a resourceGroup. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * @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 Namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String namespaceName, Context context); + + /** + * 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String namespaceName); /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * 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 of the List Namespace operation as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * 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}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context); /** - * Gets the authorization rules for a namespace. + * Lists all the available namespaces within the subscription. * - * @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 authorization rules for a namespace as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules(String resourceGroupName, - String namespaceName); + PagedIterable list(); /** - * Gets the authorization rules for a namespace. + * Lists all the available namespaces within the subscription. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * @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 authorization rules for a namespace as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAuthorizationRules(String resourceGroupName, - String namespaceName, Context context); + PagedIterable list(String skipToken, Integer top, Context context); /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * Lists the PNS credentials associated with a 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + Response getPnsCredentialsWithResponse(String resourceGroupName, String namespaceName, + Context context); /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * Lists the PNS credentials associated with a 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 description of a NotificationHub PNS Credentials. */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); + PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName); /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * 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 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 parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 along with {@link Response}. + * @return description of a CheckAvailability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, PolicykeyResource parameters, Context context); + Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, + Context context); /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * 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 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 parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 CheckAvailability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, - PolicykeyResource parameters); + CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters); } 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 6a63e97b7a9b..9d0ae23941ce 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent; @@ -16,116 +16,115 @@ 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. */ public interface NotificationHubsClient { /** - * Checks the availability of the given notificationHub in a namespace. + * Gets the notification hub. * - * @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 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 CheckAvailability resource along with {@link Response}. + * @return the notification hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, - String namespaceName, CheckAvailabilityParameters parameters, Context context); + Response getWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); /** - * Checks the availability of the given notificationHub in a namespace. + * Gets the notification hub. * - * @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 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 CheckAvailability resource. + * @return the notification hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, - CheckAvailabilityParameters 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 along with {@link Response}. + * @return notification Hub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, NotificationHubCreateOrUpdateParameters parameters, Context context); + String notificationHubName, NotificationHubResourceInner parameters, Context 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. + * @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 createOrUpdate(String resourceGroupName, String namespaceName, - String notificationHubName, NotificationHubCreateOrUpdateParameters parameters); + 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 along with {@link Response}. + * @return notification Hub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response patchWithResponse(String resourceGroupName, String namespaceName, + Response updateWithResponse(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters 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. + * @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 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. @@ -139,9 +138,9 @@ Response deleteWithResponse(String resourceGroupName, String namespaceName /** * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -152,40 +151,39 @@ Response deleteWithResponse(String resourceGroupName, String namespaceName /** * 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 along with {@link Response}. + * @return paged collection of NotificationHubResource items 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); /** * 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 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 paged collection of NotificationHubResource items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - NotificationHubResourceInner get(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. + * 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. + * @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. @@ -194,14 +192,14 @@ Response getWithResponse(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) Response debugSendWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, Object parameters, Context context); + String notificationHubName, Context context); /** - * test send a push notification. + * 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 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. @@ -211,81 +209,74 @@ Response debugSendWithResponse(String resourceGroupName, DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName); /** - * Creates/Updates an authorization rule for a NotificationHub. + * 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 authorizationRuleName Authorization Rule Name. - * @param parameters The shared access 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, Context context); + Response getPnsCredentialsWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); /** - * Creates/Updates an authorization rule for a NotificationHub. + * 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 authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @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 PNS Credentials. */ @ServiceMethod(returns = ReturnType.SINGLE) - SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, - String namespaceName, String notificationHubName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters); + PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, + String notificationHubName); /** - * Deletes a notificationHub authorization rule. + * Checks the availability of the given notificationHub in a namespace. * - * @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 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 {@link Response}. + * @return description of a CheckAvailability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, String authorizationRuleName, Context context); + Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters, Context context); /** - * Deletes a notificationHub authorization rule. + * Checks the availability of the given notificationHub in a namespace. * - * @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 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) - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, - String authorizationRuleName); + CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, + CheckAvailabilityParameters parameters); /** * 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. @@ -299,10 +290,10 @@ Response getAuthorizationRuleWithRes /** * 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. @@ -313,38 +304,80 @@ SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceG String notificationHubName, String authorizationRuleName); /** - * Lists the notification hubs associated with a namespace. + * Creates/Updates an authorization rule for a NotificationHub. * - * @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 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 response of the List NotificationHub operation as paginated response with {@link PagedIterable}. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String namespaceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context); /** - * Lists the notification hubs associated with a namespace. + * 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) + 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 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 as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String namespaceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + 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. 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void deleteAuthorizationRule(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. @@ -357,9 +390,9 @@ PagedIterable listAuthorizationRules /** * 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. @@ -373,10 +406,10 @@ PagedIterable listAuthorizationRules /** * 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. @@ -390,10 +423,10 @@ Response listKeysWithResponse(String resourceGroupName, S /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -406,66 +439,36 @@ ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, S /** * 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 along with {@link Response}. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, String authorizationRuleName, PolicykeyResource parameters, Context context); + 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 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) 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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) - 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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, - String notificationHubName); + String authorizationRuleName, PolicyKeyResource parameters); } 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/NotificationHubsManagementClient.java index 7dd2795a0df1..eaf682e3b9fd 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/NotificationHubsManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent; @@ -12,27 +12,26 @@ */ public interface NotificationHubsManagementClient { /** - * Gets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID - * forms part of the URI for every service call. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -67,4 +66,11 @@ public interface NotificationHubsManagementClient { * @return the NotificationHubsClient object. */ NotificationHubsClient getNotificationHubs(); + + /** + * 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 50e960c50d3c..770758dc2f86 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent; @@ -15,25 +15,23 @@ */ public interface OperationsClient { /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.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 as paginated response with - * {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 as paginated response with - * {@link PagedIterable}. + * @return paged collection of Operation items 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..f9c35c9a8bfe --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/PrivateEndpointConnectionsClient.java @@ -0,0 +1,292 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 { + /** + * 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); + + /** + * 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 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 a PrivateEndpointConnectionResource list 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 a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String namespaceName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGroupIds(String resourceGroupName, String namespaceName); + + /** + * 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 a PrivateLinkResource list 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/AdmCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/AdmCredentialProperties.java index fe9938c9bf3f..f9a2c04ee27c 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/fluent/models/AdmCredentialProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; @@ -17,17 +17,17 @@ @Fluent public final class AdmCredentialProperties implements JsonSerializable { /* - * The client identifier. + * Gets or sets the client identifier. */ private String clientId; /* - * The credential secret access key. + * Gets or sets the credential secret access key. */ private String clientSecret; /* - * The URL of the authorization token. + * Gets or sets the URL of the authorization token. */ private String authTokenUrl; @@ -38,7 +38,7 @@ public AdmCredentialProperties() { } /** - * Get the clientId property: The client identifier. + * Get the clientId property: Gets or sets the client identifier. * * @return the clientId value. */ @@ -47,7 +47,7 @@ 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. @@ -58,7 +58,7 @@ 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. */ @@ -67,7 +67,7 @@ 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. @@ -78,7 +78,7 @@ 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. */ @@ -87,7 +87,7 @@ 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. @@ -97,14 +97,6 @@ public AdmCredentialProperties withAuthTokenUrl(String authTokenUrl) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -123,6 +115,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AdmCredentialProperties if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the AdmCredentialProperties. */ public static AdmCredentialProperties fromJson(JsonReader jsonReader) throws IOException { 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 index 036286f9389f..f9ce797e3346 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; @@ -12,55 +12,50 @@ import java.io.IOException; /** - * 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. + * Description of a NotificationHub ApnsCredential. */ @Fluent public final class ApnsCredentialProperties implements JsonSerializable { /* - * The APNS certificate. Specify if using Certificate Authentication Mode. + * Gets or sets the APNS certificate. */ private String apnsCertificate; /* - * The APNS certificate password if it exists. + * Gets or sets the certificate key. */ 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'. + * Gets or sets the endpoint of this credential. */ private String endpoint; /* - * The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. + * Gets or sets the APNS certificate Thumbprint */ private String thumbprint; /* - * A 10-character key identifier (kid) key, obtained from your developer account. Specify if using Token - * Authentication Mode. + * Gets or sets a 10-character key identifier (kid) key, obtained from + * your developer account */ private String keyId; /* - * The name of the application or BundleId. Specify if using Token Authentication Mode. + * Gets or sets the name of the application */ 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. + * Gets or sets the issuer (iss) registered claim key, whose value is + * your 10-character Team ID, obtained from your developer account */ private String appId; /* - * Provider Authentication Token, obtained through your developer account. Specify if using Token Authentication - * Mode. + * Gets or sets provider Authentication Token, obtained through your + * developer account */ private String token; @@ -71,7 +66,7 @@ public ApnsCredentialProperties() { } /** - * Get the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode. + * Get the apnsCertificate property: Gets or sets the APNS certificate. * * @return the apnsCertificate value. */ @@ -80,7 +75,7 @@ public String apnsCertificate() { } /** - * Set the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode. + * Set the apnsCertificate property: Gets or sets the APNS certificate. * * @param apnsCertificate the apnsCertificate value to set. * @return the ApnsCredentialProperties object itself. @@ -91,7 +86,7 @@ public ApnsCredentialProperties withApnsCertificate(String apnsCertificate) { } /** - * Get the certificateKey property: The APNS certificate password if it exists. + * Get the certificateKey property: Gets or sets the certificate key. * * @return the certificateKey value. */ @@ -100,7 +95,7 @@ public String certificateKey() { } /** - * Set the certificateKey property: The APNS certificate password if it exists. + * Set the certificateKey property: Gets or sets the certificate key. * * @param certificateKey the certificateKey value to set. * @return the ApnsCredentialProperties object itself. @@ -111,11 +106,7 @@ public ApnsCredentialProperties withCertificateKey(String certificateKey) { } /** - * 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'. + * Get the endpoint property: Gets or sets the endpoint of this credential. * * @return the endpoint value. */ @@ -124,11 +115,7 @@ public String 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'. + * Set the endpoint property: Gets or sets the endpoint of this credential. * * @param endpoint the endpoint value to set. * @return the ApnsCredentialProperties object itself. @@ -139,7 +126,7 @@ public ApnsCredentialProperties withEndpoint(String endpoint) { } /** - * Get the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. + * Get the thumbprint property: Gets or sets the APNS certificate Thumbprint. * * @return the thumbprint value. */ @@ -148,7 +135,7 @@ public String thumbprint() { } /** - * Set the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. + * Set the thumbprint property: Gets or sets the APNS certificate Thumbprint. * * @param thumbprint the thumbprint value to set. * @return the ApnsCredentialProperties object itself. @@ -159,8 +146,8 @@ public ApnsCredentialProperties withThumbprint(String thumbprint) { } /** - * Get the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if - * using Token Authentication Mode. + * Get the keyId property: Gets or sets a 10-character key identifier (kid) key, obtained from + * your developer account. * * @return the keyId value. */ @@ -169,8 +156,8 @@ public String keyId() { } /** - * Set the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if - * using Token Authentication Mode. + * 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. @@ -181,7 +168,7 @@ public ApnsCredentialProperties withKeyId(String keyId) { } /** - * Get the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode. + * Get the appName property: Gets or sets the name of the application. * * @return the appName value. */ @@ -190,7 +177,7 @@ public String appName() { } /** - * Set the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode. + * Set the appName property: Gets or sets the name of the application. * * @param appName the appName value to set. * @return the ApnsCredentialProperties object itself. @@ -201,8 +188,8 @@ public ApnsCredentialProperties withAppName(String appName) { } /** - * 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. + * 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. */ @@ -211,8 +198,8 @@ public String 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. + * 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. @@ -223,8 +210,8 @@ public ApnsCredentialProperties withAppId(String appId) { } /** - * Get the token property: Provider Authentication Token, obtained through your developer account. Specify if using - * Token Authentication Mode. + * Get the token property: Gets or sets provider Authentication Token, obtained through your + * developer account. * * @return the token value. */ @@ -233,8 +220,8 @@ public String token() { } /** - * Set the token property: Provider Authentication Token, obtained through your developer account. Specify if using - * Token Authentication Mode. + * 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. @@ -244,23 +231,15 @@ public ApnsCredentialProperties withToken(String token) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpoint", this.endpoint); jsonWriter.writeStringField("apnsCertificate", this.apnsCertificate); jsonWriter.writeStringField("certificateKey", this.certificateKey); - jsonWriter.writeStringField("endpoint", this.endpoint); jsonWriter.writeStringField("thumbprint", this.thumbprint); jsonWriter.writeStringField("keyId", this.keyId); jsonWriter.writeStringField("appName", this.appName); @@ -275,6 +254,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ApnsCredentialProperties if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ApnsCredentialProperties. */ public static ApnsCredentialProperties fromJson(JsonReader jsonReader) throws IOException { @@ -284,12 +264,12 @@ public static ApnsCredentialProperties fromJson(JsonReader jsonReader) throws IO String fieldName = reader.getFieldName(); reader.nextToken(); - if ("apnsCertificate".equals(fieldName)) { + if ("endpoint".equals(fieldName)) { + deserializedApnsCredentialProperties.endpoint = reader.getString(); + } else if ("apnsCertificate".equals(fieldName)) { deserializedApnsCredentialProperties.apnsCertificate = reader.getString(); } else if ("certificateKey".equals(fieldName)) { deserializedApnsCredentialProperties.certificateKey = reader.getString(); - } else if ("endpoint".equals(fieldName)) { - deserializedApnsCredentialProperties.endpoint = reader.getString(); } else if ("thumbprint".equals(fieldName)) { deserializedApnsCredentialProperties.thumbprint = reader.getString(); } else if ("keyId".equals(fieldName)) { 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/fluent/models/BaiduCredentialProperties.java index 8662b85a9c15..483617b6fe8c 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/fluent/models/BaiduCredentialProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; @@ -17,17 +17,17 @@ @Fluent public final class BaiduCredentialProperties implements JsonSerializable { /* - * Baidu Api Key. + * Gets or sets baidu Api Key. */ private String baiduApiKey; /* - * Baidu Endpoint. + * Gets or sets baidu Endpoint. */ private String baiduEndPoint; /* - * Baidu Secret Key + * Gets or sets baidu Secret Key */ private String baiduSecretKey; @@ -38,7 +38,7 @@ public BaiduCredentialProperties() { } /** - * Get the baiduApiKey property: Baidu Api Key. + * Get the baiduApiKey property: Gets or sets baidu Api Key. * * @return the baiduApiKey value. */ @@ -47,7 +47,7 @@ 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. @@ -58,7 +58,7 @@ public BaiduCredentialProperties withBaiduApiKey(String baiduApiKey) { } /** - * Get the baiduEndPoint property: Baidu Endpoint. + * Get the baiduEndPoint property: Gets or sets baidu Endpoint. * * @return the baiduEndPoint value. */ @@ -67,7 +67,7 @@ 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. @@ -78,7 +78,7 @@ 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. */ @@ -87,7 +87,7 @@ 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. @@ -97,14 +97,6 @@ public BaiduCredentialProperties withBaiduSecretKey(String baiduSecretKey) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -123,6 +115,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of BaiduCredentialProperties if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the BaiduCredentialProperties. */ public static BaiduCredentialProperties fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BrowserCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BrowserCredentialProperties.java new file mode 100644 index 000000000000..6b753065d301 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BrowserCredentialProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Description of a NotificationHub BrowserCredential. + */ +@Fluent +public final class BrowserCredentialProperties implements JsonSerializable { + /* + * Gets or sets web push subject. + */ + private String subject; + + /* + * Gets or sets VAPID private key. + */ + private String vapidPrivateKey; + + /* + * Gets or sets VAPID public key. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subject", this.subject); + jsonWriter.writeStringField("vapidPrivateKey", this.vapidPrivateKey); + jsonWriter.writeStringField("vapidPublicKey", this.vapidPublicKey); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BrowserCredentialProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BrowserCredentialProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BrowserCredentialProperties. + */ + public static BrowserCredentialProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BrowserCredentialProperties deserializedBrowserCredentialProperties = new BrowserCredentialProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subject".equals(fieldName)) { + deserializedBrowserCredentialProperties.subject = reader.getString(); + } else if ("vapidPrivateKey".equals(fieldName)) { + deserializedBrowserCredentialProperties.vapidPrivateKey = reader.getString(); + } else if ("vapidPublicKey".equals(fieldName)) { + deserializedBrowserCredentialProperties.vapidPublicKey = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedBrowserCredentialProperties; + }); + } +} 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 455fb6df6454..650f2dc1a68d 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -16,18 +17,34 @@ /** * Description of a CheckAvailability resource. */ -@Fluent -public final class CheckAvailabilityResultInner extends Resource { +@Immutable +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. */ private Boolean isAvailiable; /* - * The sku of the created namespace + * Deprecated - only for compatibility. + */ + private String location; + + /* + * Deprecated - only for compatibility. + */ + private Map tags; + + /* + * The Sku description for a namespace */ private Sku sku; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -46,12 +63,12 @@ public final class CheckAvailabilityResultInner extends Resource { /** * Creates an instance of CheckAvailabilityResultInner class. */ - public CheckAvailabilityResultInner() { + private 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. */ @@ -60,19 +77,25 @@ public Boolean isAvailiable() { } /** - * Set the isAvailiable property: True if the name is available and can be used to create new - * Namespace/NotificationHub. Otherwise false. + * Get the location property: Deprecated - only for compatibility. * - * @param isAvailiable the isAvailiable value to set. - * @return the CheckAvailabilityResultInner object itself. + * @return the location value. */ - public CheckAvailabilityResultInner withIsAvailiable(Boolean isAvailiable) { - this.isAvailiable = isAvailiable; - return this; + public String location() { + return this.location; } /** - * Get the sku property: The sku of the created namespace. + * Get the tags property: Deprecated - only for compatibility. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the sku property: The Sku description for a namespace. * * @return the sku value. */ @@ -81,14 +104,12 @@ public Sku sku() { } /** - * Set the sku property: The sku of the created namespace. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param sku the sku value to set. - * @return the CheckAvailabilityResultInner object itself. + * @return the systemData value. */ - public CheckAvailabilityResultInner withSku(Sku sku) { - this.sku = sku; - return this; + public SystemData systemData() { + return this.systemData; } /** @@ -121,44 +142,15 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public CheckAvailabilityResultInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CheckAvailabilityResultInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() != null) { - sku().validate(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeBooleanField("isAvailiable", this.isAvailiable); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -185,15 +177,17 @@ public static CheckAvailabilityResultInner fromJson(JsonReader jsonReader) throw deserializedCheckAvailabilityResultInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedCheckAvailabilityResultInner.type = reader.getString(); + } else if ("isAvailiable".equals(fieldName)) { + deserializedCheckAvailabilityResultInner.isAvailiable = reader.getNullable(JsonReader::getBoolean); } else if ("location".equals(fieldName)) { - deserializedCheckAvailabilityResultInner.withLocation(reader.getString()); + deserializedCheckAvailabilityResultInner.location = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCheckAvailabilityResultInner.withTags(tags); - } else if ("isAvailiable".equals(fieldName)) { - deserializedCheckAvailabilityResultInner.isAvailiable = reader.getNullable(JsonReader::getBoolean); + deserializedCheckAvailabilityResultInner.tags = tags; } else if ("sku".equals(fieldName)) { deserializedCheckAvailabilityResultInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCheckAvailabilityResultInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 60b5d5479f47..840d4a24f200 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 @@ -1,32 +1,44 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.notificationhubs.models.Sku; +import com.azure.resourcemanager.notificationhubs.models.RegistrationResult; import java.io.IOException; +import java.util.List; import java.util.Map; /** * Description of a NotificationHub Resource. */ -@Fluent -public final class DebugSendResponseInner extends Resource { +@Immutable +public final class DebugSendResponseInner extends ProxyResource { /* - * Properties of the NotificationHub. + * Result of DebugSend operations. */ private DebugSendResult innerProperties; /* - * The sku of the created namespace + * Deprecated - only for compatibility. */ - private Sku sku; + private String location; + + /* + * Deprecated - only for compatibility. + */ + private Map tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -46,11 +58,11 @@ public final class DebugSendResponseInner extends Resource { /** * Creates an instance of DebugSendResponseInner class. */ - public DebugSendResponseInner() { + private DebugSendResponseInner() { } /** - * Get the innerProperties property: Properties of the NotificationHub. + * Get the innerProperties property: Result of DebugSend operations. * * @return the innerProperties value. */ @@ -59,23 +71,30 @@ private DebugSendResult innerProperties() { } /** - * Get the sku property: The sku of the created namespace. + * Get the location property: Deprecated - only for compatibility. * - * @return the sku value. + * @return the location value. */ - public Sku sku() { - return this.sku; + public String location() { + return this.location; } /** - * Set the sku property: The sku of the created namespace. + * Get the tags property: Deprecated - only for compatibility. * - * @param sku the sku value to set. - * @return the DebugSendResponseInner object itself. + * @return the tags value. */ - public DebugSendResponseInner withSku(Sku sku) { - this.sku = sku; - return this; + public Map tags() { + return this.tags; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; } /** @@ -109,116 +128,41 @@ public String id() { } /** - * {@inheritDoc} - */ - @Override - public DebugSendResponseInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DebugSendResponseInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the success property: successful send. + * Get the success property: Gets or sets successful send. * * @return the success value. */ - public Float success() { + public Long success() { return this.innerProperties() == null ? null : this.innerProperties().success(); } /** - * Set the success property: successful send. - * - * @param success the success 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); - return this; - } - - /** - * Get the failure property: send failure. + * Get the failure property: Gets or sets send failure. * * @return the failure value. */ - public Float failure() { + public Long failure() { return this.innerProperties() == null ? null : this.innerProperties().failure(); } /** - * Set the failure property: send failure. - * - * @param failure the failure 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); - return this; - } - - /** - * Get the results property: actual failure description. + * Get the results property: Gets or sets actual failure description. * * @return the results value. */ - public Object results() { + public List results() { return this.innerProperties() == null ? null : this.innerProperties().results(); } - /** - * Set the results property: actual failure description. - * - * @param results the results 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); - 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(); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -244,15 +188,15 @@ public static DebugSendResponseInner fromJson(JsonReader jsonReader) throws IOEx deserializedDebugSendResponseInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDebugSendResponseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDebugSendResponseInner.innerProperties = DebugSendResult.fromJson(reader); } else if ("location".equals(fieldName)) { - deserializedDebugSendResponseInner.withLocation(reader.getString()); + deserializedDebugSendResponseInner.location = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDebugSendResponseInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedDebugSendResponseInner.innerProperties = DebugSendResult.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedDebugSendResponseInner.sku = Sku.fromJson(reader); + deserializedDebugSendResponseInner.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedDebugSendResponseInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 index ff7f09f1605f..91af86d25e86 100644 --- 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 @@ -1,119 +1,77 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.models.RegistrationResult; import java.io.IOException; +import java.util.List; /** - * The DebugSendResult model. + * Result of DebugSend operations. */ -@Fluent +@Immutable public final class DebugSendResult implements JsonSerializable { /* - * successful send + * Gets or sets successful send */ - private Float success; + private Long success; /* - * send failure + * Gets or sets send failure */ - private Float failure; + private Long failure; /* - * actual failure description + * Gets or sets actual failure description */ - private Object results; + private List results; /** * Creates an instance of DebugSendResult class. */ - public DebugSendResult() { + private DebugSendResult() { } /** - * Get the success property: successful send. + * Get the success property: Gets or sets successful send. * * @return the success value. */ - public Float success() { + public Long 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. + * Get the failure property: Gets or sets send failure. * * @return the failure value. */ - public Float failure() { + public Long 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. + * Get the results property: Gets or sets actual failure description. * * @return the results value. */ - public Object results() { + public List 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() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("success", this.success); - jsonWriter.writeNumberField("failure", this.failure); - jsonWriter.writeUntypedField("results", this.results); return jsonWriter.writeEndObject(); } @@ -133,11 +91,13 @@ public static DebugSendResult fromJson(JsonReader jsonReader) throws IOException reader.nextToken(); if ("success".equals(fieldName)) { - deserializedDebugSendResult.success = reader.getNullable(JsonReader::getFloat); + deserializedDebugSendResult.success = reader.getNullable(JsonReader::getLong); } else if ("failure".equals(fieldName)) { - deserializedDebugSendResult.failure = reader.getNullable(JsonReader::getFloat); + deserializedDebugSendResult.failure = reader.getNullable(JsonReader::getLong); } else if ("results".equals(fieldName)) { - deserializedDebugSendResult.results = reader.readUntyped(); + List results + = reader.readArray(reader1 -> RegistrationResult.fromJson(reader1)); + deserializedDebugSendResult.results = results; } else { reader.skipChildren(); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/FcmV1CredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/FcmV1CredentialProperties.java new file mode 100644 index 000000000000..a038be94c40e --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/FcmV1CredentialProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Description of a NotificationHub FcmV1Credential. + */ +@Fluent +public final class FcmV1CredentialProperties implements JsonSerializable { + /* + * Gets or sets client email. + */ + private String clientEmail; + + /* + * Gets or sets private key. + */ + private String privateKey; + + /* + * Gets or sets project id. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clientEmail", this.clientEmail); + jsonWriter.writeStringField("privateKey", this.privateKey); + jsonWriter.writeStringField("projectId", this.projectId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FcmV1CredentialProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FcmV1CredentialProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FcmV1CredentialProperties. + */ + public static FcmV1CredentialProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FcmV1CredentialProperties deserializedFcmV1CredentialProperties = new FcmV1CredentialProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clientEmail".equals(fieldName)) { + deserializedFcmV1CredentialProperties.clientEmail = reader.getString(); + } else if ("privateKey".equals(fieldName)) { + deserializedFcmV1CredentialProperties.privateKey = reader.getString(); + } else if ("projectId".equals(fieldName)) { + deserializedFcmV1CredentialProperties.projectId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFcmV1CredentialProperties; + }); + } +} 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/fluent/models/GcmCredentialProperties.java index fc3cd7e180e4..90419efdb027 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/fluent/models/GcmCredentialProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; @@ -17,12 +17,12 @@ @Fluent public final class GcmCredentialProperties implements JsonSerializable { /* - * The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send' + * Gets or sets the GCM endpoint. */ private String gcmEndpoint; /* - * The Google API key. + * Gets or sets the Google API key. */ private String googleApiKey; @@ -33,7 +33,7 @@ public GcmCredentialProperties() { } /** - * Get the gcmEndpoint property: The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'. + * Get the gcmEndpoint property: Gets or sets the GCM endpoint. * * @return the gcmEndpoint value. */ @@ -42,7 +42,7 @@ 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. @@ -53,7 +53,7 @@ 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. */ @@ -62,7 +62,7 @@ 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. @@ -72,22 +72,14 @@ public GcmCredentialProperties withGoogleApiKey(String googleApiKey) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("gcmEndpoint", this.gcmEndpoint); jsonWriter.writeStringField("googleApiKey", this.googleApiKey); + jsonWriter.writeStringField("gcmEndpoint", this.gcmEndpoint); return jsonWriter.writeEndObject(); } @@ -97,6 +89,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of GcmCredentialProperties if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the GcmCredentialProperties. */ public static GcmCredentialProperties fromJson(JsonReader jsonReader) throws IOException { @@ -106,10 +99,10 @@ public static GcmCredentialProperties fromJson(JsonReader jsonReader) throws IOE String fieldName = reader.getFieldName(); reader.nextToken(); - if ("gcmEndpoint".equals(fieldName)) { - deserializedGcmCredentialProperties.gcmEndpoint = reader.getString(); - } else if ("googleApiKey".equals(fieldName)) { + if ("googleApiKey".equals(fieldName)) { deserializedGcmCredentialProperties.googleApiKey = reader.getString(); + } else if ("gcmEndpoint".equals(fieldName)) { + deserializedGcmCredentialProperties.gcmEndpoint = reader.getString(); } else { reader.skipChildren(); } 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/fluent/models/MpnsCredentialProperties.java index 5ecb3b227af7..bcddc60e7e22 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/fluent/models/MpnsCredentialProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; @@ -17,17 +17,17 @@ @Fluent public final class MpnsCredentialProperties implements JsonSerializable { /* - * The MPNS certificate. + * Gets or sets the MPNS certificate. */ private String mpnsCertificate; /* - * The certificate key for this credential. + * Gets or sets the certificate key for this credential. */ private String certificateKey; /* - * The MPNS certificate Thumbprint + * Gets or sets the MPNS certificate Thumbprint */ private String thumbprint; @@ -38,7 +38,7 @@ public MpnsCredentialProperties() { } /** - * Get the mpnsCertificate property: The MPNS certificate. + * Get the mpnsCertificate property: Gets or sets the MPNS certificate. * * @return the mpnsCertificate value. */ @@ -47,7 +47,7 @@ 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. @@ -58,7 +58,7 @@ 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. */ @@ -67,7 +67,7 @@ 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. @@ -78,7 +78,7 @@ 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. */ @@ -87,7 +87,7 @@ 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. @@ -97,14 +97,6 @@ public MpnsCredentialProperties withThumbprint(String thumbprint) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ @@ -123,6 +115,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of MpnsCredentialProperties if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the MpnsCredentialProperties. */ public static MpnsCredentialProperties fromJson(JsonReader jsonReader) throws IOException { 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 index fb9dc20713d0..d11ae729b6a0 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; @@ -10,87 +10,124 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.models.NamespaceStatus; import com.azure.resourcemanager.notificationhubs.models.NamespaceType; +import com.azure.resourcemanager.notificationhubs.models.NetworkAcls; +import com.azure.resourcemanager.notificationhubs.models.OperationProvisioningState; +import com.azure.resourcemanager.notificationhubs.models.PublicNetworkAccess; +import com.azure.resourcemanager.notificationhubs.models.ReplicationRegion; +import com.azure.resourcemanager.notificationhubs.models.ZoneRedundancyPreference; import java.io.IOException; import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; +import java.util.List; /** - * Namespace properties. + * Represents namespace properties. */ @Fluent public final class NamespaceProperties implements JsonSerializable { /* - * The name of the namespace. + * Name of the Notification Hubs namespace. This is immutable property, set automatically + * by the service when the namespace is created. */ private String name; /* - * Provisioning state of the Namespace. + * Defines values for OperationProvisioningState. */ - private String provisioningState; + private OperationProvisioningState 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 + * Namespace status. */ - private String region; + private NamespaceStatus status; /* - * Identifier for Azure Insights metrics + * Gets or sets whether or not the namespace is currently enabled. */ - private String metricId; + private Boolean enabled; /* - * Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting + * Gets or sets whether or not the namespace is set as Critical. */ - private String status; + private Boolean critical; /* - * The time the namespace was created. + * Namespace subscription id. + */ + private String subscriptionId; + + /* + * Region. The value is always set to the same value as Namespace.Location, so we are deprecating + * this property. + */ + private String region; + + /* + * Azure Insights Metrics id. + */ + private String metricId; + + /* + * Time when the namespace was created. */ private OffsetDateTime createdAt; /* - * The time the namespace was updated. + * Time when the namespace was updated. */ private OffsetDateTime updatedAt; /* - * Endpoint you can use to perform NotificationHub operations. + * Defines values for NamespaceType. */ - private String serviceBusEndpoint; + private NamespaceType namespaceType; /* - * The Id of the Azure subscription associated with the namespace. + * Allowed replication region */ - private String subscriptionId; + private ReplicationRegion replicationRegion; /* - * ScaleUnit where the namespace gets created + * Namespace SKU name. */ - private String scaleUnit; + private ZoneRedundancyPreference zoneRedundancy; /* - * Whether or not the namespace is currently enabled. + * A collection of network authorization rules. */ - private Boolean enabled; + private NetworkAcls networkAcls; /* - * Whether or not the namespace is set as Critical. + * Collection of Notification Hub or Notification Hub Namespace PNS credentials. */ - private Boolean critical; + private PnsCredentials pnsCredentials; + + /* + * Gets or sets endpoint you can use to perform NotificationHub + * operations. + */ + private String serviceBusEndpoint; + + /* + * Private Endpoint Connections for namespace + */ + private List privateEndpointConnections; + + /* + * Gets or sets scaleUnit where the namespace gets created + */ + private String scaleUnit; /* - * Data center for the namespace + * Deprecated. */ private String dataCenter; /* - * The namespace type. + * Type of public network access. */ - private NamespaceType namespaceType; + private PublicNetworkAccess publicNetworkAccess; /** * Creates an instance of NamespaceProperties class. @@ -99,7 +136,8 @@ public NamespaceProperties() { } /** - * Get the name property: The name of the namespace. + * 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. */ @@ -108,93 +146,94 @@ public String name() { } /** - * Set the name property: The name of the namespace. + * 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 name the name value to set. + * @param provisioningState the provisioningState value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties withName(String name) { - this.name = name; + public NamespaceProperties withProvisioningState(OperationProvisioningState provisioningState) { + this.provisioningState = provisioningState; return this; } /** - * Get the provisioningState property: Provisioning state of the Namespace. + * Get the status property: Namespace status. * - * @return the provisioningState value. + * @return the status value. */ - public String provisioningState() { - return this.provisioningState; + public NamespaceStatus status() { + return this.status; } /** - * Set the provisioningState property: Provisioning state of the Namespace. + * Set the status property: Namespace status. * - * @param provisioningState the provisioningState value to set. + * @param status the status value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties withProvisioningState(String provisioningState) { - this.provisioningState = provisioningState; + public NamespaceProperties withStatus(NamespaceStatus status) { + this.status = status; 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. + * Get the enabled property: Gets or sets whether or not the namespace is currently enabled. * - * @return the region value. + * @return the enabled value. */ - public String region() { - return this.region; + public Boolean enabled() { + return this.enabled; } /** - * 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. + * Get the critical property: Gets or sets whether or not the namespace is set as Critical. * - * @param region the region value to set. - * @return the NamespaceProperties object itself. + * @return the critical value. */ - public NamespaceProperties withRegion(String region) { - this.region = region; - return this; + public Boolean critical() { + return this.critical; } /** - * Get the metricId property: Identifier for Azure Insights metrics. + * Get the subscriptionId property: Namespace subscription id. * - * @return the metricId value. + * @return the subscriptionId value. */ - public String metricId() { - return this.metricId; + public String subscriptionId() { + return this.subscriptionId; } /** - * Get the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. + * 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 status value. + * @return the region value. */ - public String status() { - return this.status; + public String region() { + return this.region; } /** - * Set the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. + * Get the metricId property: Azure Insights Metrics id. * - * @param status the status value to set. - * @return the NamespaceProperties object itself. + * @return the metricId value. */ - public NamespaceProperties withStatus(String status) { - this.status = status; - return this; + public String metricId() { + return this.metricId; } /** - * Get the createdAt property: The time the namespace was created. + * Get the createdAt property: Time when the namespace was created. * * @return the createdAt value. */ @@ -203,138 +242,155 @@ public OffsetDateTime createdAt() { } /** - * Set the createdAt property: The time the namespace was created. + * Get the updatedAt property: Time when the namespace was updated. * - * @param createdAt the createdAt value to set. - * @return the NamespaceProperties object itself. + * @return the updatedAt value. */ - public NamespaceProperties withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; + public OffsetDateTime updatedAt() { + return this.updatedAt; } /** - * Get the updatedAt property: The time the namespace was updated. + * Get the namespaceType property: Defines values for NamespaceType. * - * @return the updatedAt value. + * @return the namespaceType value. */ - public OffsetDateTime updatedAt() { - return this.updatedAt; + public NamespaceType namespaceType() { + return this.namespaceType; } /** - * Set the updatedAt property: The time the namespace was updated. + * Set the namespaceType property: Defines values for NamespaceType. * - * @param updatedAt the updatedAt value to set. + * @param namespaceType the namespaceType value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties withUpdatedAt(OffsetDateTime updatedAt) { - this.updatedAt = updatedAt; + public NamespaceProperties withNamespaceType(NamespaceType namespaceType) { + this.namespaceType = namespaceType; return this; } /** - * Get the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. + * Get the replicationRegion property: Allowed replication region. * - * @return the serviceBusEndpoint value. + * @return the replicationRegion value. */ - public String serviceBusEndpoint() { - return this.serviceBusEndpoint; + public ReplicationRegion replicationRegion() { + return this.replicationRegion; } /** - * Set the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. + * Set the replicationRegion property: Allowed replication region. * - * @param serviceBusEndpoint the serviceBusEndpoint value to set. + * @param replicationRegion the replicationRegion value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties withServiceBusEndpoint(String serviceBusEndpoint) { - this.serviceBusEndpoint = serviceBusEndpoint; + public NamespaceProperties withReplicationRegion(ReplicationRegion replicationRegion) { + this.replicationRegion = replicationRegion; return this; } /** - * Get the subscriptionId property: The Id of the Azure subscription associated with the namespace. + * Get the zoneRedundancy property: Namespace SKU name. * - * @return the subscriptionId value. + * @return the zoneRedundancy value. */ - public String subscriptionId() { - return this.subscriptionId; + public ZoneRedundancyPreference zoneRedundancy() { + return this.zoneRedundancy; } /** - * Set the subscriptionId property: The Id of the Azure subscription associated with the namespace. + * Set the zoneRedundancy property: Namespace SKU name. * - * @param subscriptionId the subscriptionId value to set. + * @param zoneRedundancy the zoneRedundancy value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public NamespaceProperties withZoneRedundancy(ZoneRedundancyPreference zoneRedundancy) { + this.zoneRedundancy = zoneRedundancy; return this; } /** - * Get the scaleUnit property: ScaleUnit where the namespace gets created. + * Get the networkAcls property: A collection of network authorization rules. * - * @return the scaleUnit value. + * @return the networkAcls value. */ - public String scaleUnit() { - return this.scaleUnit; + public NetworkAcls networkAcls() { + return this.networkAcls; } /** - * Set the scaleUnit property: ScaleUnit where the namespace gets created. + * Set the networkAcls property: A collection of network authorization rules. * - * @param scaleUnit the scaleUnit value to set. + * @param networkAcls the networkAcls value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties withScaleUnit(String scaleUnit) { - this.scaleUnit = scaleUnit; + public NamespaceProperties withNetworkAcls(NetworkAcls networkAcls) { + this.networkAcls = networkAcls; return this; } /** - * Get the enabled property: Whether or not the namespace is currently enabled. + * Get the pnsCredentials property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. * - * @return the enabled value. + * @return the pnsCredentials value. */ - public Boolean enabled() { - return this.enabled; + public PnsCredentials pnsCredentials() { + return this.pnsCredentials; } /** - * Set the enabled property: Whether or not the namespace is currently enabled. + * Set the pnsCredentials property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. * - * @param enabled the enabled value to set. + * @param pnsCredentials the pnsCredentials value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties withEnabled(Boolean enabled) { - this.enabled = enabled; + public NamespaceProperties withPnsCredentials(PnsCredentials pnsCredentials) { + this.pnsCredentials = pnsCredentials; return this; } /** - * Get the critical property: Whether or not the namespace is set as Critical. + * Get the serviceBusEndpoint property: Gets or sets endpoint you can use to perform NotificationHub + * operations. * - * @return the critical value. + * @return the serviceBusEndpoint value. */ - public Boolean critical() { - return this.critical; + 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; } /** - * Set the critical property: Whether or not the namespace is set as Critical. + * Get the scaleUnit property: Gets or sets scaleUnit where the namespace gets created. * - * @param critical the critical value to set. + * @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 withCritical(Boolean critical) { - this.critical = critical; + public NamespaceProperties withScaleUnit(String scaleUnit) { + this.scaleUnit = scaleUnit; return this; } /** - * Get the dataCenter property: Data center for the namespace. + * Get the dataCenter property: Deprecated. * * @return the dataCenter value. */ @@ -343,7 +399,7 @@ public String dataCenter() { } /** - * Set the dataCenter property: Data center for the namespace. + * Set the dataCenter property: Deprecated. * * @param dataCenter the dataCenter value to set. * @return the NamespaceProperties object itself. @@ -354,54 +410,45 @@ public NamespaceProperties withDataCenter(String dataCenter) { } /** - * Get the namespaceType property: The namespace type. + * Get the publicNetworkAccess property: Type of public network access. * - * @return the namespaceType value. + * @return the publicNetworkAccess value. */ - public NamespaceType namespaceType() { - return this.namespaceType; + public PublicNetworkAccess publicNetworkAccess() { + return this.publicNetworkAccess; } /** - * Set the namespaceType property: The namespace type. + * Set the publicNetworkAccess property: Type of public network access. * - * @param namespaceType the namespaceType value to set. + * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the NamespaceProperties object itself. */ - public NamespaceProperties withNamespaceType(NamespaceType namespaceType) { - this.namespaceType = namespaceType; + 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() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("provisioningState", this.provisioningState); - jsonWriter.writeStringField("region", this.region); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeStringField("createdAt", - this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); - jsonWriter.writeStringField("updatedAt", - this.updatedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.updatedAt)); - jsonWriter.writeStringField("serviceBusEndpoint", this.serviceBusEndpoint); - jsonWriter.writeStringField("subscriptionId", this.subscriptionId); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("namespaceType", this.namespaceType == null ? null : this.namespaceType.toString()); + jsonWriter.writeStringField("replicationRegion", + this.replicationRegion == null ? null : this.replicationRegion.toString()); + jsonWriter.writeStringField("zoneRedundancy", + this.zoneRedundancy == null ? null : this.zoneRedundancy.toString()); + jsonWriter.writeJsonField("networkAcls", this.networkAcls); + jsonWriter.writeJsonField("pnsCredentials", this.pnsCredentials); jsonWriter.writeStringField("scaleUnit", this.scaleUnit); - jsonWriter.writeBooleanField("enabled", this.enabled); - jsonWriter.writeBooleanField("critical", this.critical); jsonWriter.writeStringField("dataCenter", this.dataCenter); - jsonWriter.writeStringField("namespaceType", this.namespaceType == null ? null : this.namespaceType.toString()); + jsonWriter.writeStringField("publicNetworkAccess", + this.publicNetworkAccess == null ? null : this.publicNetworkAccess.toString()); return jsonWriter.writeEndObject(); } @@ -423,33 +470,51 @@ public static NamespaceProperties fromJson(JsonReader jsonReader) throws IOExcep if ("name".equals(fieldName)) { deserializedNamespaceProperties.name = reader.getString(); } else if ("provisioningState".equals(fieldName)) { - deserializedNamespaceProperties.provisioningState = reader.getString(); + deserializedNamespaceProperties.provisioningState + = OperationProvisioningState.fromString(reader.getString()); + } else if ("status".equals(fieldName)) { + deserializedNamespaceProperties.status = NamespaceStatus.fromString(reader.getString()); + } else if ("enabled".equals(fieldName)) { + deserializedNamespaceProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("critical".equals(fieldName)) { + deserializedNamespaceProperties.critical = reader.getNullable(JsonReader::getBoolean); + } else if ("subscriptionId".equals(fieldName)) { + deserializedNamespaceProperties.subscriptionId = reader.getString(); } else if ("region".equals(fieldName)) { deserializedNamespaceProperties.region = reader.getString(); } else if ("metricId".equals(fieldName)) { deserializedNamespaceProperties.metricId = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedNamespaceProperties.status = reader.getString(); } else if ("createdAt".equals(fieldName)) { deserializedNamespaceProperties.createdAt = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("updatedAt".equals(fieldName)) { deserializedNamespaceProperties.updatedAt = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("namespaceType".equals(fieldName)) { + deserializedNamespaceProperties.namespaceType = NamespaceType.fromString(reader.getString()); + } else if ("replicationRegion".equals(fieldName)) { + deserializedNamespaceProperties.replicationRegion + = ReplicationRegion.fromString(reader.getString()); + } else if ("zoneRedundancy".equals(fieldName)) { + deserializedNamespaceProperties.zoneRedundancy + = ZoneRedundancyPreference.fromString(reader.getString()); + } else if ("networkAcls".equals(fieldName)) { + deserializedNamespaceProperties.networkAcls = NetworkAcls.fromJson(reader); + } else if ("pnsCredentials".equals(fieldName)) { + deserializedNamespaceProperties.pnsCredentials = PnsCredentials.fromJson(reader); } else if ("serviceBusEndpoint".equals(fieldName)) { deserializedNamespaceProperties.serviceBusEndpoint = reader.getString(); - } else if ("subscriptionId".equals(fieldName)) { - deserializedNamespaceProperties.subscriptionId = reader.getString(); + } else if ("privateEndpointConnections".equals(fieldName)) { + List privateEndpointConnections + = reader.readArray(reader1 -> PrivateEndpointConnectionResourceInner.fromJson(reader1)); + deserializedNamespaceProperties.privateEndpointConnections = privateEndpointConnections; } else if ("scaleUnit".equals(fieldName)) { deserializedNamespaceProperties.scaleUnit = reader.getString(); - } else if ("enabled".equals(fieldName)) { - deserializedNamespaceProperties.enabled = reader.getNullable(JsonReader::getBoolean); - } else if ("critical".equals(fieldName)) { - deserializedNamespaceProperties.critical = reader.getNullable(JsonReader::getBoolean); } else if ("dataCenter".equals(fieldName)) { deserializedNamespaceProperties.dataCenter = reader.getString(); - } else if ("namespaceType".equals(fieldName)) { - deserializedNamespaceProperties.namespaceType = NamespaceType.fromString(reader.getString()); + } else if ("publicNetworkAccess".equals(fieldName)) { + deserializedNamespaceProperties.publicNetworkAccess + = PublicNetworkAccess.fromString(reader.getString()); } else { reader.skipChildren(); } 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 fc21add04bea..7362ef2ec5d3 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 @@ -1,35 +1,48 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.models.NamespaceStatus; import com.azure.resourcemanager.notificationhubs.models.NamespaceType; +import com.azure.resourcemanager.notificationhubs.models.NetworkAcls; +import com.azure.resourcemanager.notificationhubs.models.OperationProvisioningState; +import com.azure.resourcemanager.notificationhubs.models.PublicNetworkAccess; +import com.azure.resourcemanager.notificationhubs.models.ReplicationRegion; import com.azure.resourcemanager.notificationhubs.models.Sku; +import com.azure.resourcemanager.notificationhubs.models.ZoneRedundancyPreference; import java.io.IOException; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** - * Description of a Namespace resource. + * Notification Hubs Namespace Resource. */ @Fluent public final class NamespaceResourceInner extends Resource { /* - * Properties of the Namespace. + * Represents namespace properties. */ private NamespaceProperties innerProperties; /* - * The sku of the created namespace + * The Sku description for a namespace */ private Sku sku; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -52,7 +65,7 @@ public NamespaceResourceInner() { } /** - * Get the innerProperties property: Properties of the Namespace. + * Get the innerProperties property: Represents namespace properties. * * @return the innerProperties value. */ @@ -61,7 +74,7 @@ private NamespaceProperties innerProperties() { } /** - * Get the sku property: The sku of the created namespace. + * Get the sku property: The Sku description for a namespace. * * @return the sku value. */ @@ -70,7 +83,7 @@ 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. @@ -80,6 +93,15 @@ public NamespaceResourceInner withSku(Sku sku) { 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; + } + /** * Get the type property: The type of the resource. * @@ -129,7 +151,8 @@ public NamespaceResourceInner withTags(Map tags) { } /** - * Get the name property: The name of the namespace. + * 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. */ @@ -138,105 +161,100 @@ public String namePropertiesName() { } /** - * Set the name property: The name of the namespace. + * Get the provisioningState property: Defines values for OperationProvisioningState. * - * @param name the name value to set. + * @return the provisioningState value. + */ + public OperationProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: Defines values for OperationProvisioningState. + * + * @param provisioningState the provisioningState value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withNamePropertiesName(String name) { + public NamespaceResourceInner withProvisioningState(OperationProvisioningState provisioningState) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withName(name); + this.innerProperties().withProvisioningState(provisioningState); return this; } /** - * Get the provisioningState property: Provisioning state of the Namespace. + * Get the status property: Namespace status. * - * @return the provisioningState value. + * @return the status value. */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public NamespaceStatus status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** - * Set the provisioningState property: Provisioning state of the Namespace. + * Set the status property: Namespace status. * - * @param provisioningState the provisioningState value to set. + * @param status the status value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withProvisioningState(String provisioningState) { + public NamespaceResourceInner withStatus(NamespaceStatus status) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withProvisioningState(provisioningState); + this.innerProperties().withStatus(status); 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. + * Get the enabled property: Gets or sets whether or not the namespace is currently enabled. * - * @return the region value. + * @return the enabled value. */ - public String region() { - return this.innerProperties() == null ? null : this.innerProperties().region(); + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); } /** - * 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. + * Get the critical property: Gets or sets whether or not the namespace is set as Critical. * - * @param region the region value to set. - * @return the NamespaceResourceInner object itself. + * @return the critical value. */ - public NamespaceResourceInner withRegion(String region) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withRegion(region); - return this; + public Boolean critical() { + return this.innerProperties() == null ? null : this.innerProperties().critical(); } /** - * Get the metricId property: Identifier for Azure Insights metrics. + * Get the subscriptionId property: Namespace subscription id. * - * @return the metricId value. + * @return the subscriptionId value. */ - public String metricId() { - return this.innerProperties() == null ? null : this.innerProperties().metricId(); + public String subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); } /** - * Get the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. + * 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 status value. + * @return the region value. */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); + public String region() { + return this.innerProperties() == null ? null : this.innerProperties().region(); } /** - * Set the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. + * Get the metricId property: Azure Insights Metrics id. * - * @param status the status value to set. - * @return the NamespaceResourceInner object itself. + * @return the metricId value. */ - public NamespaceResourceInner withStatus(String status) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withStatus(status); - return this; + public String metricId() { + return this.innerProperties() == null ? null : this.innerProperties().metricId(); } /** - * Get the createdAt property: The time the namespace was created. + * Get the createdAt property: Time when the namespace was created. * * @return the createdAt value. */ @@ -245,159 +263,173 @@ public OffsetDateTime createdAt() { } /** - * Set the createdAt property: The time the namespace was created. + * Get the updatedAt property: Time when the namespace was updated. * - * @param createdAt the createdAt value to set. - * @return the NamespaceResourceInner object itself. + * @return the updatedAt value. */ - public NamespaceResourceInner withCreatedAt(OffsetDateTime createdAt) { - if (this.innerProperties() == null) { - this.innerProperties = new NamespaceProperties(); - } - this.innerProperties().withCreatedAt(createdAt); - return this; + public OffsetDateTime updatedAt() { + return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); } /** - * Get the updatedAt property: The time the namespace was updated. + * Get the namespaceType property: Defines values for NamespaceType. * - * @return the updatedAt value. + * @return the namespaceType value. */ - public OffsetDateTime updatedAt() { - return this.innerProperties() == null ? null : this.innerProperties().updatedAt(); + public NamespaceType namespaceType() { + return this.innerProperties() == null ? null : this.innerProperties().namespaceType(); } /** - * Set the updatedAt property: The time the namespace was updated. + * Set the namespaceType property: Defines values for NamespaceType. * - * @param updatedAt the updatedAt value to set. + * @param namespaceType the namespaceType value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withUpdatedAt(OffsetDateTime updatedAt) { + public NamespaceResourceInner withNamespaceType(NamespaceType namespaceType) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withUpdatedAt(updatedAt); + this.innerProperties().withNamespaceType(namespaceType); return this; } /** - * Get the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. + * Get the replicationRegion property: Allowed replication region. * - * @return the serviceBusEndpoint value. + * @return the replicationRegion value. */ - public String serviceBusEndpoint() { - return this.innerProperties() == null ? null : this.innerProperties().serviceBusEndpoint(); + public ReplicationRegion replicationRegion() { + return this.innerProperties() == null ? null : this.innerProperties().replicationRegion(); } /** - * Set the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. + * Set the replicationRegion property: Allowed replication region. * - * @param serviceBusEndpoint the serviceBusEndpoint value to set. + * @param replicationRegion the replicationRegion value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withServiceBusEndpoint(String serviceBusEndpoint) { + public NamespaceResourceInner withReplicationRegion(ReplicationRegion replicationRegion) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withServiceBusEndpoint(serviceBusEndpoint); + this.innerProperties().withReplicationRegion(replicationRegion); return this; } /** - * Get the subscriptionId property: The Id of the Azure subscription associated with the namespace. + * Get the zoneRedundancy property: Namespace SKU name. * - * @return the subscriptionId value. + * @return the zoneRedundancy value. */ - public String subscriptionId() { - return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); + public ZoneRedundancyPreference zoneRedundancy() { + return this.innerProperties() == null ? null : this.innerProperties().zoneRedundancy(); } /** - * Set the subscriptionId property: The Id of the Azure subscription associated with the namespace. + * Set the zoneRedundancy property: Namespace SKU name. * - * @param subscriptionId the subscriptionId value to set. + * @param zoneRedundancy the zoneRedundancy value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withSubscriptionId(String subscriptionId) { + public NamespaceResourceInner withZoneRedundancy(ZoneRedundancyPreference zoneRedundancy) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withSubscriptionId(subscriptionId); + this.innerProperties().withZoneRedundancy(zoneRedundancy); return this; } /** - * Get the scaleUnit property: ScaleUnit where the namespace gets created. + * Get the networkAcls property: A collection of network authorization rules. * - * @return the scaleUnit value. + * @return the networkAcls value. */ - public String scaleUnit() { - return this.innerProperties() == null ? null : this.innerProperties().scaleUnit(); + public NetworkAcls networkAcls() { + return this.innerProperties() == null ? null : this.innerProperties().networkAcls(); } /** - * Set the scaleUnit property: ScaleUnit where the namespace gets created. + * Set the networkAcls property: A collection of network authorization rules. * - * @param scaleUnit the scaleUnit value to set. + * @param networkAcls the networkAcls value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withScaleUnit(String scaleUnit) { + public NamespaceResourceInner withNetworkAcls(NetworkAcls networkAcls) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withScaleUnit(scaleUnit); + this.innerProperties().withNetworkAcls(networkAcls); return this; } /** - * Get the enabled property: Whether or not the namespace is currently enabled. + * Get the pnsCredentials property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. * - * @return the enabled value. + * @return the pnsCredentials value. */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); + public PnsCredentials pnsCredentials() { + return this.innerProperties() == null ? null : this.innerProperties().pnsCredentials(); } /** - * Set the enabled property: Whether or not the namespace is currently enabled. + * Set the pnsCredentials property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. * - * @param enabled the enabled value to set. + * @param pnsCredentials the pnsCredentials value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withEnabled(Boolean enabled) { + public NamespaceResourceInner withPnsCredentials(PnsCredentials pnsCredentials) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withEnabled(enabled); + this.innerProperties().withPnsCredentials(pnsCredentials); return this; } /** - * Get the critical property: Whether or not the namespace is set as Critical. + * Get the serviceBusEndpoint property: Gets or sets endpoint you can use to perform NotificationHub + * operations. * - * @return the critical value. + * @return the serviceBusEndpoint value. */ - public Boolean critical() { - return this.innerProperties() == null ? null : this.innerProperties().critical(); + public String serviceBusEndpoint() { + return this.innerProperties() == null ? null : this.innerProperties().serviceBusEndpoint(); + } + + /** + * Get the privateEndpointConnections property: Private Endpoint Connections for namespace. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } /** - * Set the critical property: Whether or not the namespace is set as Critical. + * Get the scaleUnit property: Gets or sets scaleUnit where the namespace gets created. * - * @param critical the critical value to set. + * @return the scaleUnit value. + */ + public String scaleUnit() { + return this.innerProperties() == null ? null : this.innerProperties().scaleUnit(); + } + + /** + * Set the scaleUnit property: Gets or sets scaleUnit where the namespace gets created. + * + * @param scaleUnit the scaleUnit value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withCritical(Boolean critical) { + public NamespaceResourceInner withScaleUnit(String scaleUnit) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withCritical(critical); + this.innerProperties().withScaleUnit(scaleUnit); return this; } /** - * Get the dataCenter property: Data center for the namespace. + * Get the dataCenter property: Deprecated. * * @return the dataCenter value. */ @@ -406,7 +438,7 @@ public String dataCenter() { } /** - * Set the dataCenter property: Data center for the namespace. + * Set the dataCenter property: Deprecated. * * @param dataCenter the dataCenter value to set. * @return the NamespaceResourceInner object itself. @@ -420,42 +452,28 @@ public NamespaceResourceInner withDataCenter(String dataCenter) { } /** - * Get the namespaceType property: The namespace type. + * Get the publicNetworkAccess property: Type of public network access. * - * @return the namespaceType value. + * @return the publicNetworkAccess value. */ - public NamespaceType namespaceType() { - return this.innerProperties() == null ? null : this.innerProperties().namespaceType(); + public PublicNetworkAccess publicNetworkAccess() { + return this.innerProperties() == null ? null : this.innerProperties().publicNetworkAccess(); } /** - * Set the namespaceType property: The namespace type. + * Set the publicNetworkAccess property: Type of public network access. * - * @param namespaceType the namespaceType value to set. + * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the NamespaceResourceInner object itself. */ - public NamespaceResourceInner withNamespaceType(NamespaceType namespaceType) { + public NamespaceResourceInner withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { if (this.innerProperties() == null) { this.innerProperties = new NamespaceProperties(); } - this.innerProperties().withNamespaceType(namespaceType); + this.innerProperties().withPublicNetworkAccess(publicNetworkAccess); return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } - /** * {@inheritDoc} */ @@ -464,8 +482,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -496,10 +514,12 @@ public static NamespaceResourceInner fromJson(JsonReader jsonReader) throws IOEx } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedNamespaceResourceInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedNamespaceResourceInner.innerProperties = NamespaceProperties.fromJson(reader); } else if ("sku".equals(fieldName)) { deserializedNamespaceResourceInner.sku = Sku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedNamespaceResourceInner.innerProperties = NamespaceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNamespaceResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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/fluent/models/NotificationHubProperties.java index bfc1f8d7fc4b..df44c2615020 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/fluent/models/NotificationHubProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; @@ -12,9 +12,12 @@ 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.BrowserCredential; +import com.azure.resourcemanager.notificationhubs.models.FcmV1Credential; import com.azure.resourcemanager.notificationhubs.models.GcmCredential; import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; import com.azure.resourcemanager.notificationhubs.models.WnsCredential; +import com.azure.resourcemanager.notificationhubs.models.XiaomiCredential; import java.io.IOException; import java.util.List; @@ -24,50 +27,70 @@ @Fluent public final class NotificationHubProperties implements JsonSerializable { /* - * The NotificationHub name. + * Gets or sets the NotificationHub name. */ private String name; /* - * The RegistrationTtl of the created NotificationHub + * Gets or sets the RegistrationTtl of the created NotificationHub */ private String registrationTtl; /* - * The AuthorizationRules of the created NotificationHub + * Gets or sets the AuthorizationRules of the created NotificationHub */ private List authorizationRules; /* - * The ApnsCredential of the created NotificationHub + * Description of a NotificationHub ApnsCredential. */ private ApnsCredential apnsCredential; /* - * The WnsCredential of the created NotificationHub + * Description of a NotificationHub WnsCredential. */ private WnsCredential wnsCredential; /* - * The GcmCredential of the created NotificationHub + * Description of a NotificationHub GcmCredential. */ private GcmCredential gcmCredential; /* - * The MpnsCredential of the created NotificationHub + * Description of a NotificationHub MpnsCredential. */ private MpnsCredential mpnsCredential; /* - * The AdmCredential of the created NotificationHub + * Description of a NotificationHub AdmCredential. */ private AdmCredential admCredential; /* - * The BaiduCredential of the created NotificationHub + * Description of a NotificationHub BaiduCredential. */ private BaiduCredential baiduCredential; + /* + * Description of a NotificationHub BrowserCredential. + */ + private BrowserCredential browserCredential; + + /* + * Description of a NotificationHub XiaomiCredential. + */ + private XiaomiCredential xiaomiCredential; + + /* + * Description of a NotificationHub FcmV1Credential. + */ + private FcmV1Credential fcmV1Credential; + + /* + * The dailyMaxActiveDevices property. + */ + private Long dailyMaxActiveDevices; + /** * Creates an instance of NotificationHubProperties class. */ @@ -75,7 +98,7 @@ public NotificationHubProperties() { } /** - * Get the name property: The NotificationHub name. + * Get the name property: Gets or sets the NotificationHub name. * * @return the name value. */ @@ -84,7 +107,7 @@ 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. @@ -95,7 +118,7 @@ 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. */ @@ -104,7 +127,7 @@ 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. @@ -115,7 +138,7 @@ 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. */ @@ -124,19 +147,7 @@ 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. */ @@ -145,7 +156,7 @@ 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. @@ -156,7 +167,7 @@ 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. */ @@ -165,7 +176,7 @@ 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. @@ -176,7 +187,7 @@ 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. */ @@ -185,7 +196,7 @@ 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. @@ -196,7 +207,7 @@ 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. */ @@ -205,7 +216,7 @@ 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. @@ -216,7 +227,7 @@ 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. */ @@ -225,7 +236,7 @@ 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. @@ -236,7 +247,7 @@ 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. */ @@ -245,7 +256,7 @@ 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,32 +267,72 @@ public NotificationHubProperties withBaiduCredential(BaiduCredential baiduCreden } /** - * Validates the instance. + * 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. * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (authorizationRules() != null) { - authorizationRules().forEach(e -> e.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(); - } + * @return the dailyMaxActiveDevices value. + */ + public Long dailyMaxActiveDevices() { + return this.dailyMaxActiveDevices; } /** @@ -292,14 +343,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("registrationTtl", this.registrationTtl); - jsonWriter.writeArrayField("authorizationRules", this.authorizationRules, - (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("apnsCredential", this.apnsCredential); jsonWriter.writeJsonField("wnsCredential", this.wnsCredential); jsonWriter.writeJsonField("gcmCredential", this.gcmCredential); jsonWriter.writeJsonField("mpnsCredential", this.mpnsCredential); jsonWriter.writeJsonField("admCredential", this.admCredential); jsonWriter.writeJsonField("baiduCredential", this.baiduCredential); + jsonWriter.writeJsonField("browserCredential", this.browserCredential); + jsonWriter.writeJsonField("xiaomiCredential", this.xiaomiCredential); + jsonWriter.writeJsonField("fcmV1Credential", this.fcmV1Credential); return jsonWriter.writeEndObject(); } @@ -338,6 +390,15 @@ public static NotificationHubProperties fromJson(JsonReader jsonReader) throws I deserializedNotificationHubProperties.admCredential = AdmCredential.fromJson(reader); } else if ("baiduCredential".equals(fieldName)) { deserializedNotificationHubProperties.baiduCredential = BaiduCredential.fromJson(reader); + } else if ("browserCredential".equals(fieldName)) { + deserializedNotificationHubProperties.browserCredential = BrowserCredential.fromJson(reader); + } else if ("xiaomiCredential".equals(fieldName)) { + deserializedNotificationHubProperties.xiaomiCredential = XiaomiCredential.fromJson(reader); + } else if ("fcmV1Credential".equals(fieldName)) { + deserializedNotificationHubProperties.fcmV1Credential = FcmV1Credential.fromJson(reader); + } else if ("dailyMaxActiveDevices".equals(fieldName)) { + deserializedNotificationHubProperties.dailyMaxActiveDevices + = reader.getNullable(JsonReader::getLong); } else { reader.skipChildren(); } 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 ec55d04b0ccf..cdc003abab9e 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 @@ -1,40 +1,49 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; 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.BrowserCredential; +import com.azure.resourcemanager.notificationhubs.models.FcmV1Credential; 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.azure.resourcemanager.notificationhubs.models.XiaomiCredential; import java.io.IOException; import java.util.List; import java.util.Map; /** - * Description of a NotificationHub Resource. + * Notification Hub Resource. */ @Fluent public final class NotificationHubResourceInner extends Resource { /* - * Properties of the NotificationHub. + * NotificationHub properties. */ private NotificationHubProperties innerProperties; /* - * The sku of the created namespace + * The Sku description for a namespace */ private Sku sku; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -57,7 +66,7 @@ public NotificationHubResourceInner() { } /** - * Get the innerProperties property: Properties of the NotificationHub. + * Get the innerProperties property: NotificationHub properties. * * @return the innerProperties value. */ @@ -66,7 +75,7 @@ private NotificationHubProperties innerProperties() { } /** - * Get the sku property: The sku of the created namespace. + * Get the sku property: The Sku description for a namespace. * * @return the sku value. */ @@ -75,7 +84,7 @@ 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 NotificationHubResourceInner object itself. @@ -85,6 +94,15 @@ public NotificationHubResourceInner withSku(Sku sku) { 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; + } + /** * Get the type property: The type of the resource. * @@ -134,7 +152,7 @@ public NotificationHubResourceInner withTags(Map tags) { } /** - * Get the name property: The NotificationHub name. + * Get the name property: Gets or sets the NotificationHub name. * * @return the name value. */ @@ -143,7 +161,7 @@ public String namePropertiesName() { } /** - * 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 NotificationHubResourceInner object itself. @@ -157,7 +175,7 @@ public NotificationHubResourceInner withNamePropertiesName(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. */ @@ -166,7 +184,7 @@ 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 NotificationHubResourceInner object itself. @@ -180,7 +198,7 @@ public NotificationHubResourceInner 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. */ @@ -189,22 +207,7 @@ public List 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. + * Get the apnsCredential property: Description of a NotificationHub ApnsCredential. * * @return the apnsCredential value. */ @@ -213,7 +216,7 @@ 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 NotificationHubResourceInner object itself. @@ -227,7 +230,7 @@ public NotificationHubResourceInner withApnsCredential(ApnsCredential apnsCreden } /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. + * Get the wnsCredential property: Description of a NotificationHub WnsCredential. * * @return the wnsCredential value. */ @@ -236,7 +239,7 @@ 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 NotificationHubResourceInner object itself. @@ -250,7 +253,7 @@ public NotificationHubResourceInner withWnsCredential(WnsCredential wnsCredentia } /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. + * Get the gcmCredential property: Description of a NotificationHub GcmCredential. * * @return the gcmCredential value. */ @@ -259,7 +262,7 @@ 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 NotificationHubResourceInner object itself. @@ -273,7 +276,7 @@ public NotificationHubResourceInner withGcmCredential(GcmCredential gcmCredentia } /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. + * Get the mpnsCredential property: Description of a NotificationHub MpnsCredential. * * @return the mpnsCredential value. */ @@ -282,7 +285,7 @@ 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 NotificationHubResourceInner object itself. @@ -296,7 +299,7 @@ public NotificationHubResourceInner withMpnsCredential(MpnsCredential mpnsCreden } /** - * Get the admCredential property: The AdmCredential of the created NotificationHub. + * Get the admCredential property: Description of a NotificationHub AdmCredential. * * @return the admCredential value. */ @@ -305,7 +308,7 @@ 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 NotificationHubResourceInner object itself. @@ -319,7 +322,7 @@ public NotificationHubResourceInner withAdmCredential(AdmCredential admCredentia } /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. + * Get the baiduCredential property: Description of a NotificationHub BaiduCredential. * * @return the baiduCredential value. */ @@ -328,7 +331,7 @@ 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 NotificationHubResourceInner object itself. @@ -342,17 +345,81 @@ public NotificationHubResourceInner withBaiduCredential(BaiduCredential baiduCre } /** - * Validates the instance. + * Get the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @return the browserCredential value. + */ + public BrowserCredential browserCredential() { + return this.innerProperties() == null ? null : this.innerProperties().browserCredential(); + } + + /** + * Set the browserCredential property: Description of a NotificationHub BrowserCredential. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @param browserCredential the browserCredential value to set. + * @return the NotificationHubResourceInner object itself. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public NotificationHubResourceInner withBrowserCredential(BrowserCredential browserCredential) { + if (this.innerProperties() == null) { + this.innerProperties = new NotificationHubProperties(); } - if (sku() != null) { - sku().validate(); + this.innerProperties().withBrowserCredential(browserCredential); + return this; + } + + /** + * Get the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. + * + * @return the xiaomiCredential value. + */ + public XiaomiCredential xiaomiCredential() { + return this.innerProperties() == null ? null : this.innerProperties().xiaomiCredential(); + } + + /** + * Set the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. + * + * @param xiaomiCredential the xiaomiCredential value to set. + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withXiaomiCredential(XiaomiCredential xiaomiCredential) { + if (this.innerProperties() == null) { + this.innerProperties = new NotificationHubProperties(); + } + this.innerProperties().withXiaomiCredential(xiaomiCredential); + return this; + } + + /** + * Get the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @return the fcmV1Credential value. + */ + public FcmV1Credential fcmV1Credential() { + return this.innerProperties() == null ? null : this.innerProperties().fcmV1Credential(); + } + + /** + * Set the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @param fcmV1Credential the fcmV1Credential value to set. + * @return the NotificationHubResourceInner object itself. + */ + public NotificationHubResourceInner withFcmV1Credential(FcmV1Credential fcmV1Credential) { + if (this.innerProperties() == null) { + this.innerProperties = new NotificationHubProperties(); } + this.innerProperties().withFcmV1Credential(fcmV1Credential); + return this; + } + + /** + * Get the dailyMaxActiveDevices property: The dailyMaxActiveDevices property. + * + * @return the dailyMaxActiveDevices value. + */ + public Long dailyMaxActiveDevices() { + return this.innerProperties() == null ? null : this.innerProperties().dailyMaxActiveDevices(); } /** @@ -400,6 +467,8 @@ public static NotificationHubResourceInner fromJson(JsonReader jsonReader) throw = NotificationHubProperties.fromJson(reader); } else if ("sku".equals(fieldName)) { deserializedNotificationHubResourceInner.sku = Sku.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNotificationHubResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 2638cb7ee72a..b6bea596089e 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 @@ -1,40 +1,51 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.notificationhubs.models.OperationDisplay; +import com.azure.resourcemanager.notificationhubs.models.OperationProperties; import java.io.IOException; /** - * A NotificationHubs REST API operation. + * Result of the request to list SQL operations. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* - * Operation name: {provider}/{resource}/{operation} + * The name of the operation being performed on this particular object." */ private String name; /* - * The object that represents the operation. + * he localized display information for this particular operation / action. */ private OperationDisplay display; + /* + * The intended executor of the operation." + */ + private Boolean isDataAction; + + /* + * Additional descriptions for the operation. + */ + private OperationProperties properties; + /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. + * Get the name property: The name of the operation being performed on this particular object.". * * @return the name value. */ @@ -43,7 +54,7 @@ public String name() { } /** - * Get the display property: The object that represents the operation. + * Get the display property: he localized display information for this particular operation / action. * * @return the display value. */ @@ -52,25 +63,21 @@ public OperationDisplay display() { } /** - * Set the display property: The object that represents the operation. + * Get the isDataAction property: The intended executor of the operation.". * - * @param display the display value to set. - * @return the OperationInner object itself. + * @return the isDataAction value. */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; + public Boolean isDataAction() { + return this.isDataAction; } /** - * Validates the instance. + * Get the properties property: Additional descriptions for the operation. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the properties value. */ - public void validate() { - if (display() != null) { - display().validate(); - } + public OperationProperties properties() { + return this.properties; } /** @@ -80,6 +87,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("display", this.display); + jsonWriter.writeJsonField("properties", this.properties); return jsonWriter.writeEndObject(); } @@ -102,6 +110,10 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException deserializedOperationInner.name = reader.getString(); } else if ("display".equals(fieldName)) { deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("properties".equals(fieldName)) { + deserializedOperationInner.properties = OperationProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentials.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentials.java new file mode 100644 index 000000000000..b2553164567b --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentials.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +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.BrowserCredential; +import com.azure.resourcemanager.notificationhubs.models.FcmV1Credential; +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; +import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; +import com.azure.resourcemanager.notificationhubs.models.WnsCredential; +import com.azure.resourcemanager.notificationhubs.models.XiaomiCredential; +import java.io.IOException; + +/** + * Collection of Notification Hub or Notification Hub Namespace PNS credentials. + */ +@Fluent +public final class PnsCredentials implements JsonSerializable { + /* + * Description of a NotificationHub AdmCredential. + */ + private AdmCredential admCredential; + + /* + * Description of a NotificationHub ApnsCredential. + */ + private ApnsCredential apnsCredential; + + /* + * Description of a NotificationHub BaiduCredential. + */ + private BaiduCredential baiduCredential; + + /* + * Description of a NotificationHub BrowserCredential. + */ + private BrowserCredential browserCredential; + + /* + * Description of a NotificationHub GcmCredential. + */ + private GcmCredential gcmCredential; + + /* + * Description of a NotificationHub MpnsCredential. + */ + private MpnsCredential mpnsCredential; + + /* + * Description of a NotificationHub WnsCredential. + */ + private WnsCredential wnsCredential; + + /* + * Description of a NotificationHub XiaomiCredential. + */ + private XiaomiCredential xiaomiCredential; + + /* + * Description of a NotificationHub 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("admCredential", this.admCredential); + jsonWriter.writeJsonField("apnsCredential", this.apnsCredential); + jsonWriter.writeJsonField("baiduCredential", this.baiduCredential); + jsonWriter.writeJsonField("browserCredential", this.browserCredential); + jsonWriter.writeJsonField("gcmCredential", this.gcmCredential); + jsonWriter.writeJsonField("mpnsCredential", this.mpnsCredential); + jsonWriter.writeJsonField("wnsCredential", this.wnsCredential); + jsonWriter.writeJsonField("xiaomiCredential", this.xiaomiCredential); + jsonWriter.writeJsonField("fcmV1Credential", this.fcmV1Credential); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PnsCredentials from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PnsCredentials if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PnsCredentials. + */ + public static PnsCredentials fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PnsCredentials deserializedPnsCredentials = new PnsCredentials(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("admCredential".equals(fieldName)) { + deserializedPnsCredentials.admCredential = AdmCredential.fromJson(reader); + } else if ("apnsCredential".equals(fieldName)) { + deserializedPnsCredentials.apnsCredential = ApnsCredential.fromJson(reader); + } else if ("baiduCredential".equals(fieldName)) { + deserializedPnsCredentials.baiduCredential = BaiduCredential.fromJson(reader); + } else if ("browserCredential".equals(fieldName)) { + deserializedPnsCredentials.browserCredential = BrowserCredential.fromJson(reader); + } else if ("gcmCredential".equals(fieldName)) { + deserializedPnsCredentials.gcmCredential = GcmCredential.fromJson(reader); + } else if ("mpnsCredential".equals(fieldName)) { + deserializedPnsCredentials.mpnsCredential = MpnsCredential.fromJson(reader); + } else if ("wnsCredential".equals(fieldName)) { + deserializedPnsCredentials.wnsCredential = WnsCredential.fromJson(reader); + } else if ("xiaomiCredential".equals(fieldName)) { + deserializedPnsCredentials.xiaomiCredential = XiaomiCredential.fromJson(reader); + } else if ("fcmV1Credential".equals(fieldName)) { + deserializedPnsCredentials.fcmV1Credential = FcmV1Credential.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPnsCredentials; + }); + } +} 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 817af2581157..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsProperties.java +++ /dev/null @@ -1,257 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -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 java.io.IOException; - -/** - * Description of a NotificationHub PNS Credentials. - */ -@Fluent -public final class PnsCredentialsProperties implements JsonSerializable { - /* - * The ApnsCredential of the created NotificationHub - */ - private ApnsCredential apnsCredential; - - /* - * The WnsCredential of the created NotificationHub - */ - private WnsCredential wnsCredential; - - /* - * The GcmCredential of the created NotificationHub - */ - private GcmCredential gcmCredential; - - /* - * The MpnsCredential of the created NotificationHub - */ - private MpnsCredential mpnsCredential; - - /* - * The AdmCredential of the created NotificationHub - */ - private AdmCredential admCredential; - - /* - * The BaiduCredential of the created NotificationHub - */ - private BaiduCredential baiduCredential; - - /** - * Creates an instance of PnsCredentialsProperties class. - */ - public PnsCredentialsProperties() { - } - - /** - * 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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("apnsCredential", this.apnsCredential); - jsonWriter.writeJsonField("wnsCredential", this.wnsCredential); - jsonWriter.writeJsonField("gcmCredential", this.gcmCredential); - jsonWriter.writeJsonField("mpnsCredential", this.mpnsCredential); - jsonWriter.writeJsonField("admCredential", this.admCredential); - jsonWriter.writeJsonField("baiduCredential", this.baiduCredential); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PnsCredentialsProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PnsCredentialsProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the PnsCredentialsProperties. - */ - public static PnsCredentialsProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PnsCredentialsProperties deserializedPnsCredentialsProperties = new PnsCredentialsProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("apnsCredential".equals(fieldName)) { - deserializedPnsCredentialsProperties.apnsCredential = ApnsCredential.fromJson(reader); - } else if ("wnsCredential".equals(fieldName)) { - deserializedPnsCredentialsProperties.wnsCredential = WnsCredential.fromJson(reader); - } else if ("gcmCredential".equals(fieldName)) { - deserializedPnsCredentialsProperties.gcmCredential = GcmCredential.fromJson(reader); - } else if ("mpnsCredential".equals(fieldName)) { - deserializedPnsCredentialsProperties.mpnsCredential = MpnsCredential.fromJson(reader); - } else if ("admCredential".equals(fieldName)) { - deserializedPnsCredentialsProperties.admCredential = AdmCredential.fromJson(reader); - } else if ("baiduCredential".equals(fieldName)) { - deserializedPnsCredentialsProperties.baiduCredential = BaiduCredential.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedPnsCredentialsProperties; - }); - } -} 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 ff265ea78fc2..63a528dd9083 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 @@ -1,38 +1,53 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; 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.BrowserCredential; +import com.azure.resourcemanager.notificationhubs.models.FcmV1Credential; 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.azure.resourcemanager.notificationhubs.models.XiaomiCredential; import java.io.IOException; 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 { +@Immutable +public final class PnsCredentialsResourceInner extends ProxyResource { /* - * NotificationHub PNS Credentials. + * Collection of Notification Hub or Notification Hub Namespace PNS credentials. */ - private PnsCredentialsProperties innerProperties; + private PnsCredentials innerProperties; /* - * The sku of the created namespace + * Deprecated - only for compatibility. */ - private Sku sku; + private String location; + + /* + * Deprecated - only for compatibility. + */ + private Map tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -52,36 +67,43 @@ public final class PnsCredentialsResourceInner extends Resource { /** * Creates an instance of PnsCredentialsResourceInner class. */ - public PnsCredentialsResourceInner() { + private PnsCredentialsResourceInner() { } /** - * Get the innerProperties property: NotificationHub PNS Credentials. + * Get the innerProperties property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. * * @return the innerProperties value. */ - private PnsCredentialsProperties innerProperties() { + private PnsCredentials innerProperties() { return this.innerProperties; } /** - * Get the sku property: The sku of the created namespace. + * Get the location property: Deprecated - only for compatibility. * - * @return the sku value. + * @return the location value. */ - public Sku sku() { - return this.sku; + public String location() { + return this.location; } /** - * Set the sku property: The sku of the created namespace. + * Get the tags property: Deprecated - only for compatibility. * - * @param sku the sku value to set. - * @return the PnsCredentialsResourceInner object itself. + * @return the tags value. */ - public PnsCredentialsResourceInner withSku(Sku sku) { - this.sku = sku; - return this; + public Map tags() { + return this.tags; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; } /** @@ -115,25 +137,16 @@ public String id() { } /** - * {@inheritDoc} - */ - @Override - public PnsCredentialsResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} + * Get the admCredential property: Description of a NotificationHub AdmCredential. + * + * @return the admCredential value. */ - @Override - public PnsCredentialsResourceInner withTags(Map tags) { - super.withTags(tags); - return this; + public AdmCredential admCredential() { + return this.innerProperties() == null ? null : this.innerProperties().admCredential(); } /** - * Get the apnsCredential property: The ApnsCredential of the created NotificationHub. + * Get the apnsCredential property: Description of a NotificationHub ApnsCredential. * * @return the apnsCredential value. */ @@ -142,44 +155,25 @@ public ApnsCredential apnsCredential() { } /** - * Set the apnsCredential property: The ApnsCredential of the created NotificationHub. - * - * @param apnsCredential the apnsCredential value to set. - * @return the PnsCredentialsResourceInner object itself. - */ - public PnsCredentialsResourceInner withApnsCredential(ApnsCredential apnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withApnsCredential(apnsCredential); - return this; - } - - /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. + * Get the baiduCredential property: Description of a NotificationHub BaiduCredential. * - * @return the wnsCredential value. + * @return the baiduCredential value. */ - public WnsCredential wnsCredential() { - return this.innerProperties() == null ? null : this.innerProperties().wnsCredential(); + public BaiduCredential baiduCredential() { + return this.innerProperties() == null ? null : this.innerProperties().baiduCredential(); } /** - * Set the wnsCredential property: The WnsCredential of the created NotificationHub. + * Get the browserCredential property: Description of a NotificationHub BrowserCredential. * - * @param wnsCredential the wnsCredential value to set. - * @return the PnsCredentialsResourceInner object itself. + * @return the browserCredential value. */ - public PnsCredentialsResourceInner withWnsCredential(WnsCredential wnsCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withWnsCredential(wnsCredential); - return this; + public BrowserCredential browserCredential() { + return this.innerProperties() == null ? null : this.innerProperties().browserCredential(); } /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. + * Get the gcmCredential property: Description of a NotificationHub GcmCredential. * * @return the gcmCredential value. */ @@ -188,21 +182,7 @@ public GcmCredential gcmCredential() { } /** - * Set the gcmCredential property: The GcmCredential of the created NotificationHub. - * - * @param gcmCredential the gcmCredential 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); - return this; - } - - /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. + * Get the mpnsCredential property: Description of a NotificationHub MpnsCredential. * * @return the mpnsCredential value. */ @@ -211,77 +191,30 @@ public MpnsCredential mpnsCredential() { } /** - * Set the mpnsCredential property: The MpnsCredential of the created NotificationHub. - * - * @param mpnsCredential the mpnsCredential 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); - 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 PnsCredentialsResourceInner object itself. - */ - public PnsCredentialsResourceInner withAdmCredential(AdmCredential admCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withAdmCredential(admCredential); - return this; - } - - /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. + * Get the wnsCredential property: Description of a NotificationHub WnsCredential. * - * @return the baiduCredential value. + * @return the wnsCredential value. */ - public BaiduCredential baiduCredential() { - return this.innerProperties() == null ? null : this.innerProperties().baiduCredential(); + public WnsCredential wnsCredential() { + return this.innerProperties() == null ? null : this.innerProperties().wnsCredential(); } /** - * Set the baiduCredential property: The BaiduCredential of the created NotificationHub. + * Get the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. * - * @param baiduCredential the baiduCredential value to set. - * @return the PnsCredentialsResourceInner object itself. + * @return the xiaomiCredential value. */ - public PnsCredentialsResourceInner withBaiduCredential(BaiduCredential baiduCredential) { - if (this.innerProperties() == null) { - this.innerProperties = new PnsCredentialsProperties(); - } - this.innerProperties().withBaiduCredential(baiduCredential); - return this; + public XiaomiCredential xiaomiCredential() { + return this.innerProperties() == null ? null : this.innerProperties().xiaomiCredential(); } /** - * Validates the instance. + * Get the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the fcmV1Credential value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } + public FcmV1Credential fcmV1Credential() { + return this.innerProperties() == null ? null : this.innerProperties().fcmV1Credential(); } /** @@ -290,10 +223,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -319,15 +251,15 @@ public static PnsCredentialsResourceInner fromJson(JsonReader jsonReader) throws deserializedPnsCredentialsResourceInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedPnsCredentialsResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPnsCredentialsResourceInner.innerProperties = PnsCredentials.fromJson(reader); } else if ("location".equals(fieldName)) { - deserializedPnsCredentialsResourceInner.withLocation(reader.getString()); + deserializedPnsCredentialsResourceInner.location = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedPnsCredentialsResourceInner.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedPnsCredentialsResourceInner.innerProperties = PnsCredentialsProperties.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedPnsCredentialsResourceInner.sku = Sku.fromJson(reader); + deserializedPnsCredentialsResourceInner.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedPnsCredentialsResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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..d80bb253ffd3 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateEndpointConnectionResourceInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties; +import java.io.IOException; + +/** + * 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. + */ + private PrivateEndpointConnectionProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * 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; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionResourceInner if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionResourceInner. + */ + public static PrivateEndpointConnectionResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionResourceInner deserializedPrivateEndpointConnectionResourceInner + = new PrivateEndpointConnectionResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.properties + = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionResourceInner; + }); + } +} 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..51e491edc13c --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResourceProperties; +import java.io.IOException; + +/** + * A Private Link Arm Resource. + */ +@Immutable +public final class PrivateLinkResourceInner extends ProxyResource { + /* + * Represents properties of Private Link Resource. + */ + private PrivateLinkResourceProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PrivateLinkResourceInner class. + */ + private PrivateLinkResourceInner() { + } + + /** + * Get the properties property: Represents properties of Private Link Resource. + * + * @return the properties value. + */ + public PrivateLinkResourceProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkResourceInner. + */ + public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceInner deserializedPrivateLinkResourceInner = new PrivateLinkResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPrivateLinkResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPrivateLinkResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPrivateLinkResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedPrivateLinkResourceInner.properties = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceInner; + }); + } +} 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 27081da1f65f..412103113fc0 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -12,43 +12,44 @@ import java.io.IOException; /** - * Namespace/NotificationHub Connection String. + * Response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ -@Fluent +@Immutable public final class ResourceListKeysInner implements JsonSerializable { /* - * PrimaryConnectionString of the AuthorizationRule. + * Gets or sets primaryConnectionString of the AuthorizationRule. */ private String primaryConnectionString; /* - * SecondaryConnectionString of the created AuthorizationRule + * Gets or sets secondaryConnectionString of the created + * AuthorizationRule */ private String secondaryConnectionString; /* - * PrimaryKey of the created AuthorizationRule. + * Gets or sets primaryKey of the created AuthorizationRule. */ private String primaryKey; /* - * SecondaryKey of the created AuthorizationRule + * Gets or sets secondaryKey of the created AuthorizationRule */ private String secondaryKey; /* - * KeyName of the created AuthorizationRule + * Gets or sets keyName of the created AuthorizationRule */ private String keyName; /** * Creates an instance of ResourceListKeysInner class. */ - public ResourceListKeysInner() { + private ResourceListKeysInner() { } /** - * Get the primaryConnectionString property: PrimaryConnectionString of the AuthorizationRule. + * Get the primaryConnectionString property: Gets or sets primaryConnectionString of the AuthorizationRule. * * @return the primaryConnectionString value. */ @@ -57,18 +58,8 @@ public String primaryConnectionString() { } /** - * Set the primaryConnectionString property: PrimaryConnectionString of the AuthorizationRule. - * - * @param primaryConnectionString the primaryConnectionString value to set. - * @return the ResourceListKeysInner object itself. - */ - public ResourceListKeysInner withPrimaryConnectionString(String primaryConnectionString) { - this.primaryConnectionString = primaryConnectionString; - return this; - } - - /** - * 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. */ @@ -77,18 +68,7 @@ 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. */ @@ -97,18 +77,7 @@ 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. */ @@ -117,18 +86,7 @@ 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. */ @@ -136,36 +94,12 @@ 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() { - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("primaryConnectionString", this.primaryConnectionString); - jsonWriter.writeStringField("secondaryConnectionString", this.secondaryConnectionString); - jsonWriter.writeStringField("primaryKey", this.primaryKey); - jsonWriter.writeStringField("secondaryKey", this.secondaryKey); - jsonWriter.writeStringField("keyName", this.keyName); return jsonWriter.writeEndObject(); } 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 index 6eab471b9009..a3eaa5740cc9 100644 --- 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 @@ -1,16 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.notificationhubs.models.AccessRights; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; /** @@ -20,47 +22,49 @@ public final class SharedAccessAuthorizationRuleProperties implements JsonSerializable { /* - * The rights associated with the rule. + * Gets or sets the rights associated with the rule. */ private List rights; /* - * A base64-encoded 256-bit primary key for signing and validating the SAS token. + * Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. */ private String primaryKey; /* - * A base64-encoded 256-bit primary key for signing and validating the SAS token. + * Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. */ private String secondaryKey; /* - * A string that describes the authorization rule. + * Gets a string that describes the authorization rule. */ private String keyName; /* - * A string that describes the claim type + * Gets the last modified time for this rule */ - private String claimType; + private OffsetDateTime modifiedTime; /* - * A string that describes the claim value + * Gets the created time for this rule */ - private String claimValue; + private OffsetDateTime createdTime; /* - * The last modified time for this rule + * Gets a string that describes the claim type */ - private String modifiedTime; + private String claimType; /* - * The created time for this rule + * Gets a string that describes the claim value */ - private String createdTime; + private String claimValue; /* - * The revision number for the rule + * Gets the revision number for the rule */ private Integer revision; @@ -71,7 +75,7 @@ public SharedAccessAuthorizationRuleProperties() { } /** - * Get the rights property: The rights associated with the rule. + * Get the rights property: Gets or sets the rights associated with the rule. * * @return the rights value. */ @@ -80,7 +84,7 @@ public List rights() { } /** - * Set the rights property: The rights associated with the rule. + * 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. @@ -91,7 +95,8 @@ public SharedAccessAuthorizationRuleProperties withRights(List rig } /** - * Get the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * Get the primaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * * @return the primaryKey value. */ @@ -100,74 +105,91 @@ public String primaryKey() { } /** - * Get the secondaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * Set the primaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * - * @return the secondaryKey value. + * @param primaryKey the primaryKey value to set. + * @return the SharedAccessAuthorizationRuleProperties object itself. */ - public String secondaryKey() { - return this.secondaryKey; + public SharedAccessAuthorizationRuleProperties withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; } /** - * Get the keyName property: A string that describes the authorization rule. + * Get the secondaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * - * @return the keyName value. + * @return the secondaryKey value. */ - public String keyName() { - return this.keyName; + public String secondaryKey() { + return this.secondaryKey; } /** - * Get the claimType property: A string that describes the claim type. + * Set the secondaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * - * @return the claimType value. + * @param secondaryKey the secondaryKey value to set. + * @return the SharedAccessAuthorizationRuleProperties object itself. */ - public String claimType() { - return this.claimType; + public SharedAccessAuthorizationRuleProperties withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; } /** - * Get the claimValue property: A string that describes the claim value. + * Get the keyName property: Gets a string that describes the authorization rule. * - * @return the claimValue value. + * @return the keyName value. */ - public String claimValue() { - return this.claimValue; + public String keyName() { + return this.keyName; } /** - * Get the modifiedTime property: The last modified time for this rule. + * Get the modifiedTime property: Gets the last modified time for this rule. * * @return the modifiedTime value. */ - public String modifiedTime() { + public OffsetDateTime modifiedTime() { return this.modifiedTime; } /** - * Get the createdTime property: The created time for this rule. + * Get the createdTime property: Gets the created time for this rule. * * @return the createdTime value. */ - public String createdTime() { + public OffsetDateTime createdTime() { return this.createdTime; } /** - * Get the revision property: The revision number for the rule. + * Get the claimType property: Gets a string that describes the claim type. * - * @return the revision value. + * @return the claimType value. */ - public Integer revision() { - return this.revision; + public String claimType() { + return this.claimType; } /** - * Validates the instance. + * Get the claimValue property: Gets a string that describes the claim value. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the claimValue value. */ - public void validate() { + 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; } /** @@ -178,6 +200,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("rights", this.rights, (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("primaryKey", this.primaryKey); + jsonWriter.writeStringField("secondaryKey", this.secondaryKey); return jsonWriter.writeEndObject(); } @@ -187,6 +211,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of SharedAccessAuthorizationRuleProperties if the JsonReader was pointing to an instance of * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the SharedAccessAuthorizationRuleProperties. */ public static SharedAccessAuthorizationRuleProperties fromJson(JsonReader jsonReader) throws IOException { @@ -207,14 +232,16 @@ public static SharedAccessAuthorizationRuleProperties fromJson(JsonReader jsonRe deserializedSharedAccessAuthorizationRuleProperties.secondaryKey = reader.getString(); } else if ("keyName".equals(fieldName)) { deserializedSharedAccessAuthorizationRuleProperties.keyName = reader.getString(); + } else if ("modifiedTime".equals(fieldName)) { + deserializedSharedAccessAuthorizationRuleProperties.modifiedTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("createdTime".equals(fieldName)) { + deserializedSharedAccessAuthorizationRuleProperties.createdTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("claimType".equals(fieldName)) { deserializedSharedAccessAuthorizationRuleProperties.claimType = reader.getString(); } else if ("claimValue".equals(fieldName)) { deserializedSharedAccessAuthorizationRuleProperties.claimValue = reader.getString(); - } else if ("modifiedTime".equals(fieldName)) { - deserializedSharedAccessAuthorizationRuleProperties.modifiedTime = reader.getString(); - } else if ("createdTime".equals(fieldName)) { - deserializedSharedAccessAuthorizationRuleProperties.createdTime = reader.getString(); } else if ("revision".equals(fieldName)) { deserializedSharedAccessAuthorizationRuleProperties.revision = reader.getNullable(JsonReader::getInt); 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 0e7fd83c4703..04ebd1c2373e 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 @@ -1,34 +1,45 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.notificationhubs.models.AccessRights; -import com.azure.resourcemanager.notificationhubs.models.Sku; import java.io.IOException; +import java.time.OffsetDateTime; 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 { +public final class SharedAccessAuthorizationRuleResourceInner extends ProxyResource { /* - * Properties of the Namespace AuthorizationRule. + * SharedAccessAuthorizationRule properties. */ private SharedAccessAuthorizationRuleProperties innerProperties; /* - * The sku of the created namespace + * The location property. */ - private Sku sku; + private String location; + + /* + * The tags property. + */ + private Map tags; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; /* * The type of the resource. @@ -52,7 +63,7 @@ public SharedAccessAuthorizationRuleResourceInner() { } /** - * Get the innerProperties property: Properties of the Namespace AuthorizationRule. + * Get the innerProperties property: SharedAccessAuthorizationRule properties. * * @return the innerProperties value. */ @@ -61,25 +72,54 @@ private SharedAccessAuthorizationRuleProperties innerProperties() { } /** - * Get the sku property: The sku of the created namespace. + * Get the location property: The location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location property. + * + * @param location the location value to set. + * @return the SharedAccessAuthorizationRuleResourceInner object itself. + */ + public SharedAccessAuthorizationRuleResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags property: The tags property. * - * @return the sku value. + * @return the tags value. */ - public Sku sku() { - return this.sku; + public Map tags() { + return this.tags; } /** - * Set the sku property: The sku of the created namespace. + * Set the tags property: The tags property. * - * @param sku the sku value to set. + * @param tags the tags value to set. * @return the SharedAccessAuthorizationRuleResourceInner object itself. */ - public SharedAccessAuthorizationRuleResourceInner withSku(Sku sku) { - this.sku = sku; + public SharedAccessAuthorizationRuleResourceInner 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; + } + /** * Get the type property: The type of the resource. * @@ -111,25 +151,7 @@ public String id() { } /** - * {@inheritDoc} - */ - @Override - public SharedAccessAuthorizationRuleResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SharedAccessAuthorizationRuleResourceInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the rights property: The rights associated with the rule. + * Get the rights property: Gets or sets the rights associated with the rule. * * @return the rights value. */ @@ -138,7 +160,7 @@ public List rights() { } /** - * Set the rights property: The rights associated with the rule. + * Set the rights property: Gets or sets the rights associated with the rule. * * @param rights the rights value to set. * @return the SharedAccessAuthorizationRuleResourceInner object itself. @@ -152,7 +174,8 @@ public SharedAccessAuthorizationRuleResourceInner withRights(List } /** - * Get the primaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * Get the primaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * * @return the primaryKey value. */ @@ -161,80 +184,97 @@ public String primaryKey() { } /** - * Get the secondaryKey property: A base64-encoded 256-bit primary key for signing and validating the SAS token. + * Set the primaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * - * @return the secondaryKey value. + * @param primaryKey the primaryKey value to set. + * @return the SharedAccessAuthorizationRuleResourceInner object itself. */ - public String secondaryKey() { - return this.innerProperties() == null ? null : this.innerProperties().secondaryKey(); + public SharedAccessAuthorizationRuleResourceInner withPrimaryKey(String primaryKey) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedAccessAuthorizationRuleProperties(); + } + this.innerProperties().withPrimaryKey(primaryKey); + return this; } /** - * Get the keyName property: A string that describes the authorization rule. + * Get the secondaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * - * @return the keyName value. + * @return the secondaryKey value. */ - public String keyName() { - return this.innerProperties() == null ? null : this.innerProperties().keyName(); + public String secondaryKey() { + return this.innerProperties() == null ? null : this.innerProperties().secondaryKey(); } /** - * Get the claimType property: A string that describes the claim type. + * Set the secondaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * - * @return the claimType value. + * @param secondaryKey the secondaryKey value to set. + * @return the SharedAccessAuthorizationRuleResourceInner object itself. */ - public String claimType() { - return this.innerProperties() == null ? null : this.innerProperties().claimType(); + public SharedAccessAuthorizationRuleResourceInner withSecondaryKey(String secondaryKey) { + if (this.innerProperties() == null) { + this.innerProperties = new SharedAccessAuthorizationRuleProperties(); + } + this.innerProperties().withSecondaryKey(secondaryKey); + return this; } /** - * Get the claimValue property: A string that describes the claim value. + * Get the keyName property: Gets a string that describes the authorization rule. * - * @return the claimValue value. + * @return the keyName value. */ - public String claimValue() { - return this.innerProperties() == null ? null : this.innerProperties().claimValue(); + public String keyName() { + return this.innerProperties() == null ? null : this.innerProperties().keyName(); } /** - * Get the modifiedTime property: The last modified time for this rule. + * Get the modifiedTime property: Gets the last modified time for this rule. * * @return the modifiedTime value. */ - public String modifiedTime() { + public OffsetDateTime modifiedTime() { return this.innerProperties() == null ? null : this.innerProperties().modifiedTime(); } /** - * Get the createdTime property: The created time for this rule. + * Get the createdTime property: Gets the created time for this rule. * * @return the createdTime value. */ - public String createdTime() { + public OffsetDateTime createdTime() { return this.innerProperties() == null ? null : this.innerProperties().createdTime(); } /** - * Get the revision property: The revision number for the rule. + * Get the claimType property: Gets a string that describes the claim type. * - * @return the revision value. + * @return the claimType value. */ - public Integer revision() { - return this.innerProperties() == null ? null : this.innerProperties().revision(); + public String claimType() { + return this.innerProperties() == null ? null : this.innerProperties().claimType(); } /** - * Validates the instance. + * Get the claimValue property: Gets a string that describes the claim value. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the claimValue value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } + public String claimValue() { + return this.innerProperties() == null ? null : this.innerProperties().claimValue(); + } + + /** + * Get the revision property: Gets the revision number for the rule. + * + * @return the revision value. + */ + public Integer revision() { + return this.innerProperties() == null ? null : this.innerProperties().revision(); } /** @@ -243,10 +283,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -273,16 +312,16 @@ public static SharedAccessAuthorizationRuleResourceInner fromJson(JsonReader jso deserializedSharedAccessAuthorizationRuleResourceInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSharedAccessAuthorizationRuleResourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSharedAccessAuthorizationRuleResourceInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSharedAccessAuthorizationRuleResourceInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedSharedAccessAuthorizationRuleResourceInner.innerProperties = SharedAccessAuthorizationRuleProperties.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedSharedAccessAuthorizationRuleResourceInner.sku = Sku.fromJson(reader); + } else if ("location".equals(fieldName)) { + deserializedSharedAccessAuthorizationRuleResourceInner.location = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSharedAccessAuthorizationRuleResourceInner.tags = tags; + } else if ("systemData".equals(fieldName)) { + deserializedSharedAccessAuthorizationRuleResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 index fa42ceb01832..1224d3151ccc 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.fluent.models; @@ -17,20 +17,30 @@ @Fluent public final class WnsCredentialProperties implements JsonSerializable { /* - * The package ID for this credential. + * Gets or sets the package ID for this credential. */ private String packageSid; /* - * The secret key. + * Gets or sets the secret key. */ private String secretKey; /* - * The Windows Live endpoint. + * Gets or sets the Windows Live endpoint. */ private String windowsLiveEndpoint; + /* + * Ges or sets the WNS Certificate Key. + */ + private String certificateKey; + + /* + * Gets or sets the WNS Certificate. + */ + private String wnsCertificate; + /** * Creates an instance of WnsCredentialProperties class. */ @@ -38,7 +48,7 @@ public WnsCredentialProperties() { } /** - * Get the packageSid property: The package ID for this credential. + * Get the packageSid property: Gets or sets the package ID for this credential. * * @return the packageSid value. */ @@ -47,7 +57,7 @@ public String packageSid() { } /** - * Set the packageSid property: The package ID for this credential. + * 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. @@ -58,7 +68,7 @@ public WnsCredentialProperties withPackageSid(String packageSid) { } /** - * Get the secretKey property: The secret key. + * Get the secretKey property: Gets or sets the secret key. * * @return the secretKey value. */ @@ -67,7 +77,7 @@ public String secretKey() { } /** - * Set the secretKey property: The secret key. + * Set the secretKey property: Gets or sets the secret key. * * @param secretKey the secretKey value to set. * @return the WnsCredentialProperties object itself. @@ -78,7 +88,7 @@ public WnsCredentialProperties withSecretKey(String secretKey) { } /** - * Get the windowsLiveEndpoint property: The Windows Live endpoint. + * Get the windowsLiveEndpoint property: Gets or sets the Windows Live endpoint. * * @return the windowsLiveEndpoint value. */ @@ -87,7 +97,7 @@ public String windowsLiveEndpoint() { } /** - * Set the windowsLiveEndpoint property: The Windows Live endpoint. + * Set the windowsLiveEndpoint property: Gets or sets the Windows Live endpoint. * * @param windowsLiveEndpoint the windowsLiveEndpoint value to set. * @return the WnsCredentialProperties object itself. @@ -98,11 +108,43 @@ public WnsCredentialProperties withWindowsLiveEndpoint(String windowsLiveEndpoin } /** - * Validates the instance. + * Get the certificateKey property: Ges or sets the WNS Certificate Key. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the certificateKey value. */ - public void validate() { + 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; } /** @@ -114,6 +156,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("packageSid", this.packageSid); jsonWriter.writeStringField("secretKey", this.secretKey); jsonWriter.writeStringField("windowsLiveEndpoint", this.windowsLiveEndpoint); + jsonWriter.writeStringField("certificateKey", this.certificateKey); + jsonWriter.writeStringField("wnsCertificate", this.wnsCertificate); return jsonWriter.writeEndObject(); } @@ -138,6 +182,10 @@ public static WnsCredentialProperties fromJson(JsonReader jsonReader) throws IOE deserializedWnsCredentialProperties.secretKey = reader.getString(); } else if ("windowsLiveEndpoint".equals(fieldName)) { deserializedWnsCredentialProperties.windowsLiveEndpoint = reader.getString(); + } else if ("certificateKey".equals(fieldName)) { + deserializedWnsCredentialProperties.certificateKey = reader.getString(); + } else if ("wnsCertificate".equals(fieldName)) { + deserializedWnsCredentialProperties.wnsCertificate = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/XiaomiCredentialProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/XiaomiCredentialProperties.java new file mode 100644 index 000000000000..e60ad9245909 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/XiaomiCredentialProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Description of a NotificationHub XiaomiCredentialProperties. + */ +@Fluent +public final class XiaomiCredentialProperties implements JsonSerializable { + /* + * Gets or sets app secret. + */ + private String appSecret; + + /* + * Gets or sets xiaomi service 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("appSecret", this.appSecret); + jsonWriter.writeStringField("endpoint", this.endpoint); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of XiaomiCredentialProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of XiaomiCredentialProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the XiaomiCredentialProperties. + */ + public static XiaomiCredentialProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + XiaomiCredentialProperties deserializedXiaomiCredentialProperties = new XiaomiCredentialProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("appSecret".equals(fieldName)) { + deserializedXiaomiCredentialProperties.appSecret = reader.getString(); + } else if ("endpoint".equals(fieldName)) { + deserializedXiaomiCredentialProperties.endpoint = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedXiaomiCredentialProperties; + }); + } +} 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 0d52242c1586..8cbaa76cc49b 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the inner data models for NotificationHubsManagementClient. - * Azure NotificationHub client. + * 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 e734f00e5f36..e0cd7e64e841 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the service clients for NotificationHubsManagementClient. - * Azure NotificationHub client. + * 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 1a097162a300..36a0b2a34716 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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; @@ -33,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public Boolean isAvailiable() { + return this.innerModel().isAvailiable(); + } + public String location() { return this.innerModel().location(); } @@ -46,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 1c876535aa63..5bb0a8362637 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 @@ -1,13 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.RegistrationResult; import java.util.Collections; +import java.util.List; import java.util.Map; public final class DebugSendResponseImpl implements DebugSendResponse { @@ -46,20 +48,25 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); + public SystemData systemData() { + return this.innerModel().systemData(); } - public Float success() { + public Long success() { return this.innerModel().success(); } - public Float failure() { + public Long failure() { return this.innerModel().failure(); } - public Object results() { - return this.innerModel().results(); + public List results() { + List inner = this.innerModel().results(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } } 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 52e08bc7acfd..568c44a680d6 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 @@ -1,20 +1,34 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.NamespaceProperties; import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner; -import com.azure.resourcemanager.notificationhubs.models.NamespaceCreateOrUpdateParameters; +import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentials; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; import com.azure.resourcemanager.notificationhubs.models.NamespacePatchParameters; import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; +import com.azure.resourcemanager.notificationhubs.models.NamespaceStatus; import com.azure.resourcemanager.notificationhubs.models.NamespaceType; +import com.azure.resourcemanager.notificationhubs.models.NetworkAcls; +import com.azure.resourcemanager.notificationhubs.models.OperationProvisioningState; +import com.azure.resourcemanager.notificationhubs.models.PnsCredentialsResource; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.notificationhubs.models.PublicNetworkAccess; +import com.azure.resourcemanager.notificationhubs.models.ReplicationRegion; import com.azure.resourcemanager.notificationhubs.models.Sku; +import com.azure.resourcemanager.notificationhubs.models.ZoneRedundancyPreference; import java.time.OffsetDateTime; import java.util.Collections; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class NamespaceResourceImpl implements NamespaceResource, NamespaceResource.Definition, NamespaceResource.Update { @@ -51,14 +65,34 @@ public Sku sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String namePropertiesName() { return this.innerModel().namePropertiesName(); } - public String provisioningState() { + public OperationProvisioningState provisioningState() { return this.innerModel().provisioningState(); } + public NamespaceStatus status() { + return this.innerModel().status(); + } + + public Boolean enabled() { + return this.innerModel().enabled(); + } + + public Boolean critical() { + return this.innerModel().critical(); + } + + public String subscriptionId() { + return this.innerModel().subscriptionId(); + } + public String region() { return this.innerModel().region(); } @@ -67,10 +101,6 @@ public String metricId() { return this.innerModel().metricId(); } - public String status() { - return this.innerModel().status(); - } - public OffsetDateTime createdAt() { return this.innerModel().createdAt(); } @@ -79,32 +109,51 @@ public OffsetDateTime updatedAt() { return this.innerModel().updatedAt(); } - public String serviceBusEndpoint() { - return this.innerModel().serviceBusEndpoint(); + public NamespaceType namespaceType() { + return this.innerModel().namespaceType(); } - public String subscriptionId() { - return this.innerModel().subscriptionId(); + public ReplicationRegion replicationRegion() { + return this.innerModel().replicationRegion(); } - public String scaleUnit() { - return this.innerModel().scaleUnit(); + public ZoneRedundancyPreference zoneRedundancy() { + return this.innerModel().zoneRedundancy(); } - public Boolean enabled() { - return this.innerModel().enabled(); + public NetworkAcls networkAcls() { + return this.innerModel().networkAcls(); } - public Boolean critical() { - return this.innerModel().critical(); + public PnsCredentials pnsCredentials() { + return this.innerModel().pnsCredentials(); + } + + public String serviceBusEndpoint() { + return this.innerModel().serviceBusEndpoint(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new PrivateEndpointConnectionResourceImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public String scaleUnit() { + return this.innerModel().scaleUnit(); } public String dataCenter() { return this.innerModel().dataCenter(); } - public NamespaceType namespaceType() { - return this.innerModel().namespaceType(); + public PublicNetworkAccess publicNetworkAccess() { + return this.innerModel().publicNetworkAccess(); } public String resourceGroupName() { @@ -123,8 +172,6 @@ private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manag private String namespaceName; - private NamespaceCreateOrUpdateParameters createParameters; - private NamespacePatchParameters updateParameters; public NamespaceResourceImpl withExistingResourceGroup(String resourceGroupName) { @@ -135,16 +182,14 @@ public NamespaceResourceImpl withExistingResourceGroup(String resourceGroupName) public NamespaceResource create() { this.innerObject = serviceManager.serviceClient() .getNamespaces() - .createOrUpdateWithResponse(resourceGroupName, namespaceName, createParameters, Context.NONE) - .getValue(); + .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(); + .createOrUpdate(resourceGroupName, namespaceName, this.innerModel(), context); return this; } @@ -153,7 +198,6 @@ public NamespaceResource create(Context context) { this.innerObject = new NamespaceResourceInner(); this.serviceManager = serviceManager; this.namespaceName = name; - this.createParameters = new NamespaceCreateOrUpdateParameters(); } public NamespaceResourceImpl update() { @@ -164,7 +208,7 @@ public NamespaceResourceImpl update() { public NamespaceResource apply() { this.innerObject = serviceManager.serviceClient() .getNamespaces() - .patchWithResponse(resourceGroupName, namespaceName, updateParameters, Context.NONE) + .updateWithResponse(resourceGroupName, namespaceName, updateParameters, Context.NONE) .getValue(); return this; } @@ -172,7 +216,7 @@ public NamespaceResource apply() { public NamespaceResource apply(Context context) { this.innerObject = serviceManager.serviceClient() .getNamespaces() - .patchWithResponse(resourceGroupName, namespaceName, updateParameters, context) + .updateWithResponse(resourceGroupName, namespaceName, updateParameters, context) .getValue(); return this; } @@ -201,102 +245,100 @@ public NamespaceResource refresh(Context context) { 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); + public NamespaceResourceImpl withProvisioningState(OperationProvisioningState provisioningState) { + this.innerModel().withProvisioningState(provisioningState); return this; } - public NamespaceResourceImpl withRegion(String region) { - this.createParameters.withRegion(region); + public NamespaceResourceImpl withStatus(NamespaceStatus status) { + this.innerModel().withStatus(status); return this; } - public NamespaceResourceImpl withStatus(String status) { - this.createParameters.withStatus(status); + public NamespaceResourceImpl withNamespaceType(NamespaceType namespaceType) { + this.innerModel().withNamespaceType(namespaceType); return this; } - public NamespaceResourceImpl withCreatedAt(OffsetDateTime createdAt) { - this.createParameters.withCreatedAt(createdAt); + public NamespaceResourceImpl withReplicationRegion(ReplicationRegion replicationRegion) { + this.innerModel().withReplicationRegion(replicationRegion); return this; } - public NamespaceResourceImpl withUpdatedAt(OffsetDateTime updatedAt) { - this.createParameters.withUpdatedAt(updatedAt); + public NamespaceResourceImpl withZoneRedundancy(ZoneRedundancyPreference zoneRedundancy) { + this.innerModel().withZoneRedundancy(zoneRedundancy); return this; } - public NamespaceResourceImpl withServiceBusEndpoint(String serviceBusEndpoint) { - this.createParameters.withServiceBusEndpoint(serviceBusEndpoint); + public NamespaceResourceImpl withNetworkAcls(NetworkAcls networkAcls) { + this.innerModel().withNetworkAcls(networkAcls); return this; } - public NamespaceResourceImpl withSubscriptionId(String subscriptionId) { - this.createParameters.withSubscriptionId(subscriptionId); + public NamespaceResourceImpl withPnsCredentials(PnsCredentials pnsCredentials) { + this.innerModel().withPnsCredentials(pnsCredentials); return this; } public NamespaceResourceImpl withScaleUnit(String scaleUnit) { - this.createParameters.withScaleUnit(scaleUnit); + this.innerModel().withScaleUnit(scaleUnit); return this; } - public NamespaceResourceImpl withEnabled(Boolean enabled) { - this.createParameters.withEnabled(enabled); - return this; - } - - public NamespaceResourceImpl withCritical(Boolean critical) { - this.createParameters.withCritical(critical); + public NamespaceResourceImpl withDataCenter(String dataCenter) { + this.innerModel().withDataCenter(dataCenter); return this; } - public NamespaceResourceImpl withDataCenter(String dataCenter) { - this.createParameters.withDataCenter(dataCenter); + public NamespaceResourceImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) { + this.innerModel().withPublicNetworkAccess(publicNetworkAccess); return this; } - public NamespaceResourceImpl withNamespaceType(NamespaceType namespaceType) { - this.createParameters.withNamespaceType(namespaceType); + public NamespaceResourceImpl withProperties(NamespaceProperties properties) { + this.updateParameters.withProperties(properties); return this; } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } 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 ff69265f3fb0..bc9d6e902c6d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; @@ -29,6 +29,7 @@ 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.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -36,15 +37,14 @@ 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.implementation.models.NamespaceListResult; +import com.azure.resourcemanager.notificationhubs.implementation.models.SharedAccessAuthorizationRuleListResult; 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.SharedAccessAuthorizationRuleListResult; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -78,824 +78,874 @@ public final class NamespacesClientImpl implements NamespacesClient { * The interface defining all the services for NotificationHubsManagementClientNamespaces to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "NotificationHubsMana") + @Host("{endpoint}") + @ServiceInterface(name = "NotificationHubsManagementClientNamespaces") public interface NamespacesService { @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") @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> getAuthorizationRule( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getAuthorizationRuleSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SharedAccessAuthorizationRuleResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Response createOrUpdateAuthorizationRuleSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SharedAccessAuthorizationRuleResourceInner parameters, 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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, 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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteAuthorizationRuleSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NamespaceCreateOrUpdateParameters parameters, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRules( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> patch(@HostParam("$host") String endpoint, + Response listAuthorizationRulesSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @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("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NamespacePatchParameters parameters, @HeaderParam("Accept") String accept, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + Response listKeysSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyKeyResource parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response regenerateKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyKeyResource parameters, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule( - @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NamespaceResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NamespaceResourceInner parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NamespacePatchParameters parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NamespacePatchParameters parameters, 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}") + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + Mono> delete(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + 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, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getAuthorizationRule( - @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @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("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$skipToken") String skipToken, + @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/namespaces") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRules( - @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/listKeys") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/pnsCredentials") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + Mono> getPnsCredentials(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/pnsCredentials") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys(@HostParam("$host") String endpoint, + Response getPnsCredentialsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkAvailability(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") PolicykeyResource parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckAvailabilityParameters parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckAvailabilityParameters parameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listAuthorizationRulesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAuthorizationRulesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAllNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); + Response listAllNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") 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. + * Gets an authorization rule for a namespace by name. * - * @param parameters The namespace 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 description of a CheckAvailability resource along with {@link Response} on successful completion of + * @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> - checkAvailabilityWithResponseAsync(CheckAvailabilityParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName) { 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.getAuthorizationRule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, 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. + * Gets an authorization rule for a namespace by name. * - * @param parameters 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. + * @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 description of a CheckAvailability resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return an authorization rule for a namespace by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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.checkAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + private Mono getAuthorizationRuleAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .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. + * Gets an authorization rule for a namespace by name. * - * @param parameters The namespace 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 description of a CheckAvailability resource on successful completion of {@link Mono}. + * @return an authorization rule for a namespace by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkAvailabilityAsync(CheckAvailabilityParameters parameters) { - return checkAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response getAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { + final String accept = "application/json"; + return service.getAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, 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. + * Gets an authorization rule for a namespace by name. * - * @param parameters 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. + * @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 description of a CheckAvailability resource along with {@link Response}. + * @return an authorization rule for a namespace by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, - Context context) { - return checkAvailabilityWithResponseAsync(parameters, context).block(); + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, + String namespaceName, String authorizationRuleName) { + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) + .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. + * Creates an authorization rule for a namespace. * - * @param parameters The namespace name. + * @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 description of a CheckAvailability resource. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { - return checkAvailabilityWithResponse(parameters, Context.NONE).getValue(); + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + authorizationRuleName, contentType, accept, parameters, 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. + * Creates an authorization rule for a namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * @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 description of a Namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return response for POST requests that return single SharedAccessAuthorizationRule on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String namespaceName, NamespaceCreateOrUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, namespaceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono createOrUpdateAuthorizationRuleAsync( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { + return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, + parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. + * Creates an authorization rule for a namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * @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 description of a Namespace resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String namespaceName, NamespaceCreateOrUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context) { + final String contentType = "application/json"; 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.createOrUpdateAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, contentType, + accept, parameters, context); } /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. + * Creates an authorization rule for a namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * @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 description of a Namespace resource on successful completion of {@link Mono}. + * @return response for POST requests that return single SharedAccessAuthorizationRule. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, - NamespaceCreateOrUpdateParameters parameters) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String authorizationRuleName, SharedAccessAuthorizationRuleResourceInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, + parameters, Context.NONE).getValue(); } /** - * Creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable. This - * operation is idempotent. + * Deletes a namespace authorization rule. * - * @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. + * @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 description of a Namespace resource along with {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, - NamespaceCreateOrUpdateParameters parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, parameters, context).block(); + private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName) { + return FluxUtil + .withContext( + context -> service.deleteAuthorizationRule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, 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. + * Deletes a namespace authorization rule. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to create a Namespace Resource. + * @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 description of a Namespace resource. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, - NamespaceCreateOrUpdateParameters parameters) { - return createOrUpdateWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE).getValue(); + private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(ignored -> Mono.empty()); } /** - * Patches the existing namespace. + * Deletes a namespace authorization rule. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * @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 description of a Namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync(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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.patch(this.client.getEndpoint(), resourceGroupName, namespaceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + return service.deleteAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, context); } /** - * Patches the existing namespace. + * Deletes a namespace authorization rule. * - * @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. + * @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 description of a 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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.patch(this.client.getEndpoint(), resourceGroupName, namespaceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), parameters, accept, context); + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); } /** - * Patches the existing namespace. + * Gets the authorization rules for a namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * @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 on successful completion of {@link Mono}. + * @return the authorization rules for a namespace along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono patchAsync(String resourceGroupName, String namespaceName, - NamespacePatchParameters parameters) { - return patchWithResponseAsync(resourceGroupName, namespaceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono> + listAuthorizationRulesSinglePageAsync(String resourceGroupName, String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRules(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, 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())); } /** - * Patches the existing namespace. + * Gets the authorization rules for a 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. + * @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 along with {@link Response}. + * @return the authorization rules for a namespace as paginated response with {@link PagedFlux}. */ - @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.COLLECTION) + private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + String namespaceName) { + return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); } /** - * Patches the existing namespace. + * Gets the authorization rules for a namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param parameters Parameters supplied to patch a Namespace Resource. + * @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 authorization rules for a namespace along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NamespaceResourceInner patch(String resourceGroupName, String namespaceName, - NamespacePatchParameters parameters) { - return patchWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE).getValue(); + private PagedResponse + listAuthorizationRulesSinglePage(String resourceGroupName, String namespaceName) { + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * 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 {@link Response} on successful completion of {@link Mono}. + * @return the authorization rules for a namespace along with {@link PagedResponse}. */ @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())); + private PagedResponse + listAuthorizationRulesSinglePage(String resourceGroupName, String namespaceName, Context context) { + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * 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 ManagementException 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}. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ - @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); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName) { + return new PagedIterable<>(() -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink)); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * 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 {@link PollerFlux} for polling of long-running operation. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ - @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.COLLECTION) + public PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, Context context) { + return new PagedIterable<>(() -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName, context), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink, context)); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Gets the Primary and Secondary ConnectionStrings to the 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. + * @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 {@link PollerFlux} for polling of long-running operation. + * @return the Primary and Secondary ConnectionStrings to the namespace along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String namespaceName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, namespaceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, 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. + * Gets the Primary and Secondary ConnectionStrings to 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 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 {@link SyncPoller} for polling of long-running operation. + * @return the Primary and Secondary ConnectionStrings to the namespace on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName) { - return this.beginDeleteAsync(resourceGroupName, namespaceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Gets the Primary and Secondary ConnectionStrings to 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 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 {@link SyncPoller} for polling of long-running operation. + * @return the Primary and Secondary ConnectionStrings to the namespace along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String namespaceName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, namespaceName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + final String accept = "application/json"; + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, accept, context); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Gets the Primary and Secondary ConnectionStrings to 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 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 A {@link Mono} that completes when a successful response is received. + * @return the Primary and Secondary ConnectionStrings to the namespace. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String namespaceName) { - return beginDeleteAsync(resourceGroupName, namespaceName).last().flatMap(this.client::getLroFinalResultOrError); + public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + return listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE).getValue(); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. * - * @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. + * @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 A {@link Mono} that completes when a successful response is received. + * @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 deleteAsync(String resourceGroupName, String namespaceName, Context context) { - return beginDeleteAsync(resourceGroupName, namespaceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> regenerateKeysWithResponseAsync(String resourceGroupName, + String namespaceName, String authorizationRuleName, PolicyKeyResource parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, contentType, + accept, parameters, 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. + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. * - * @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 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) + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName) { - deleteAsync(resourceGroupName, namespaceName).block(); + private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters) { + return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. * - * @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 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 the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String namespaceName, Context context) { - deleteAsync(resourceGroupName, namespaceName, context).block(); + public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.regenerateKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, authorizationRuleName, contentType, + accept, parameters, context); } /** - * Returns the description for the specified namespace. + * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. * - * @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 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 description of a Namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings). */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters) { + return regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, + Context.NONE).getValue(); } /** - * Returns the description for the specified namespace. + * Returns the given 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 ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return description of a Namespace resource along with {@link Response} on successful completion of {@link Mono}. + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + String namespaceName) { 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 FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns the description for the specified namespace. + * Returns the given 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 description of a Namespace resource on successful completion of {@link Mono}. + * @return notification Hubs Namespace Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String namespaceName) { @@ -904,31 +954,33 @@ private Mono getByResourceGroupAsync(String resourceGrou } /** - * Returns the description for the specified namespace. + * Returns the given 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 description of a Namespace resource along with {@link Response}. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, namespaceName, context).block(); + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); } /** - * Returns the description for the specified namespace. + * Returns the given 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 description of a Namespace resource. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) public NamespaceResourceInner getByResourceGroup(String resourceGroupName, String namespaceName) { @@ -936,1109 +988,797 @@ public NamespaceResourceInner getByResourceGroup(String resourceGroupName, Strin } /** - * Creates an authorization rule for a namespace. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @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 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 AuthorizationRules along with {@link Response} on successful completion of + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String namespaceName, NamespaceResourceInner parameters) { + final String contentType = "application/json"; 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.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates an authorization rule for a namespace. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @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. + * @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 AuthorizationRules along with {@link Response} on successful completion of - * {@link Mono}. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context); - } - - /** - * Creates 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAuthorizationRuleAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - return createOrUpdateAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, - parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + Context.NONE); } /** - * Creates an authorization rule for a namespace. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @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 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 AuthorizationRules along with {@link Response}. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @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(); + private Response createOrUpdateWithResponse(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + context); } /** - * Creates an authorization rule for a namespace. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @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 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 AuthorizationRules. + * @return the {@link PollerFlux} for polling of notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, - String namespaceName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, - parameters, Context.NONE).getValue(); + @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()); } /** - * Deletes a namespace authorization rule. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule 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 the {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - return FluxUtil - .withContext( - context -> service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, 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) { + Response response = createOrUpdateWithResponse(resourceGroupName, namespaceName, parameters); + return this.client.getLroResult(response, + NamespaceResourceInner.class, NamespaceResourceInner.class, Context.NONE); } /** - * Deletes a namespace authorization rule. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule 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 the {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of notification Hubs Namespace Resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, NamespaceResourceInner> beginCreateOrUpdate( + String resourceGroupName, String namespaceName, NamespaceResourceInner parameters, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, namespaceName, parameters, context); + return this.client.getLroResult(response, + NamespaceResourceInner.class, NamespaceResourceInner.class, context); } /** - * Deletes a namespace authorization rule. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule 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 A {@link Mono} that completes when a successful response is received. + * @return notification Hubs Namespace Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap(ignored -> Mono.empty()); + private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, namespaceName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a namespace authorization rule. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @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. + * @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 {@link Response}. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, - context).block(); + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters) { + return beginCreateOrUpdate(resourceGroupName, namespaceName, parameters).getFinalResult(); } /** - * Deletes a namespace authorization rule. + * Creates / Updates a Notification Hub namespace. This operation is idempotent. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization Rule 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 notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); + public NamespaceResourceInner createOrUpdate(String resourceGroupName, String namespaceName, + NamespaceResourceInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, namespaceName, parameters, context).getFinalResult(); } /** - * Gets an authorization rule for a namespace by name. + * Patches the existing namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule 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 an authorization rule for a namespace by name along with {@link Response} on successful completion of + * @return notification Hubs Namespace Resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> updateWithResponseAsync(String resourceGroupName, + String namespaceName, NamespacePatchParameters parameters) { + final String contentType = "application/json"; 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets an authorization rule for a namespace by name. + * Patches the existing namespace. * - * @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. + * @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 an authorization rule for a namespace by name along with {@link Response} on successful completion of - * {@link Mono}. + * @return notification Hubs Namespace Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + private Mono updateAsync(String resourceGroupName, String namespaceName, + NamespacePatchParameters parameters) { + return updateWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets an authorization rule for a namespace by name. + * Patches the existing namespace. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param authorizationRuleName Authorization rule 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 an authorization rule for a namespace by name on successful completion of {@link Mono}. + * @return notification Hubs Namespace Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response updateWithResponse(String resourceGroupName, String namespaceName, + NamespacePatchParameters parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + context); } /** - * Gets an authorization rule for a namespace by name. + * Patches the existing namespace. * - * @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. + * @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 an authorization rule for a namespace by name along with {@link Response}. + * @return notification Hubs Namespace Resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String authorizationRuleName, Context context) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context) - .block(); + public NamespaceResourceInner update(String resourceGroupName, String namespaceName, + NamespacePatchParameters parameters) { + return updateWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE).getValue(); } /** - * Gets an authorization rule for a namespace by name. + * 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 authorizationRuleName Authorization rule 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 an authorization rule for a namespace by name. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, - String namespaceName, String authorizationRuleName) { - return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) - .getValue(); + private Mono> deleteWithResponseAsync(String resourceGroupName, String namespaceName) { + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the available namespaces within a resourceGroup. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * @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 Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono deleteAsync(String resourceGroupName, String namespaceName) { + return deleteWithResponseAsync(resourceGroupName, namespaceName).flatMap(ignored -> Mono.empty()); } /** - * Lists the available namespaces within a resourceGroup. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * @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 Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + public Response deleteWithResponse(String resourceGroupName, String namespaceName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, context); } /** - * Lists the available namespaces within a resourceGroup. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * @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 Namespace operation as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String namespaceName) { + deleteWithResponse(resourceGroupName, namespaceName, Context.NONE); } /** - * Lists the available namespaces within a resourceGroup. + * Lists the available namespaces within a resource group. * - * @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. + * @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 response of the List Namespace operation as paginated response with {@link PagedFlux}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @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) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + String skipToken, Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, skipToken, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the available namespaces within a resourceGroup. + * Lists the available namespaces within a resource group. * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * @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 response of the List Namespace operation as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + private PagedFlux listByResourceGroupAsync(String resourceGroupName, String skipToken, + Integer top) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists the available namespaces within a resourceGroup. + * Lists the available namespaces within a resource group. * - * @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. + * @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 PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, skipToken, top), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * 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 response of the List Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String skipToken, Integer top) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * 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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + String skipToken, Integer top, Context context) { 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)); + Response res + = service.listByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * 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}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); + public PagedIterable listByResourceGroup(String resourceGroupName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * 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 PagedFlux}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listAllNextSinglePageAsync(nextLink, context)); + public PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, + Integer top, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * 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 the response of the List Namespace operation as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String skipToken, Integer top) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * Lists all the available namespaces within the subscription. * - * @param context The context to associate with this operation. + * @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 response of the List Namespace operation as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + private PagedFlux listAsync(String skipToken, Integer top) { + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, top), + nextLink -> listAllNextSinglePageAsync(nextLink)); } /** - * Gets the authorization rules for a namespace. + * Lists all the available namespaces within the subscription. * - * @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 authorization rules for a namespace along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAuthorizationRulesSinglePageAsync(String resourceGroupName, String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAuthorizationRules(this.client.getEndpoint(), resourceGroupName, - namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final String skipToken = null; + final Integer top = null; + return new PagedFlux<>(() -> listSinglePageAsync(skipToken, top), + nextLink -> listAllNextSinglePageAsync(nextLink)); } /** - * Gets the authorization rules for a namespace. + * Lists all the available namespaces within the subscription. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param context The context to associate with this operation. + * @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 authorization rules for a namespace along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAuthorizationRulesSinglePageAsync(String resourceGroupName, String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private PagedResponse listSinglePage(String skipToken, Integer top) { 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)); + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the authorization rules for a namespace. + * Lists all the available namespaces within the subscription. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * @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 authorization rules for a namespace as paginated response with {@link PagedFlux}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, - String namespaceName) { - return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String skipToken, Integer top, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets the authorization rules for a namespace. + * Lists all the available namespaces within the subscription. * - * @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. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the authorization rules for a namespace as paginated response with {@link PagedFlux}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, - String namespaceName, Context context) { - return new PagedFlux<>(() -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + public PagedIterable list() { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(skipToken, top), nextLink -> listAllNextSinglePage(nextLink)); } /** - * Gets the authorization rules for a namespace. + * Lists all the available namespaces within the subscription. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * @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 authorization rules for a namespace as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules(String resourceGroupName, - String namespaceName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName)); + public PagedIterable list(String skipToken, Integer top, Context context) { + return new PagedIterable<>(() -> listSinglePage(skipToken, top, context), + nextLink -> listAllNextSinglePage(nextLink, context)); } /** - * Gets the authorization rules for a namespace. + * Lists the PNS credentials 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. + * @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 as paginated response with {@link PagedIterable}. + * @return description of a NotificationHub PNS Credentials along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAuthorizationRules(String resourceGroupName, - String namespaceName, Context context) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPnsCredentialsWithResponseAsync(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getPnsCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * Lists the PNS credentials associated with a 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 along with {@link Response} on successful - * completion of {@link Mono}. + * @return description of a NotificationHub PNS Credentials on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono getPnsCredentialsAsync(String resourceGroupName, String namespaceName) { + return getPnsCredentialsWithResponseAsync(resourceGroupName, namespaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * Lists the PNS credentials associated with a 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 along with {@link Response} on successful - * completion of {@link Mono}. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, - String namespaceName, String authorizationRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response getPnsCredentialsWithResponse(String resourceGroupName, + String namespaceName, Context context) { 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.getPnsCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); } /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * Lists the PNS credentials associated with a 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 on successful completion of {@link Mono}. + * @return description of a NotificationHub PNS Credentials. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listKeysAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName) { + return getPnsCredentialsWithResponse(resourceGroupName, namespaceName, Context.NONE).getValue(); } /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * 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 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 parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 along with {@link Response}. + * @return description of a CheckAvailability resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - return listKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, context).block(); + private Mono> + checkAvailabilityWithResponseAsync(CheckAvailabilityParameters parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * 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 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 The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 description of a CheckAvailability resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceListKeysInner listKeys(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - return listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE).getValue(); + private Mono checkAvailabilityAsync(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * 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 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 parameters The request body. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return description of a CheckAvailability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + public Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, + Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.checkAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, parameters, context); } /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * 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 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 context The context to associate with this operation. + * @param parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return description of a CheckAvailability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, - context); + public CheckAvailabilityResultInner checkAvailability(CheckAvailabilityParameters parameters) { + return checkAvailabilityWithResponse(parameters, Context.NONE).getValue(); } /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * Get the next page of items. * - * @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 nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 on successful completion of {@link Mono}. + * @return the authorization rules for a namespace along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateKeysAsync(String resourceGroupName, String namespaceName, - String authorizationRuleName, PolicykeyResource parameters) { - return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, authorizationRuleName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono> + listAuthorizationRulesNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * Get the next page of items. * - * @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 context The context to associate with this operation. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link Response}. + * @return the authorization rules for a namespace along with {@link PagedResponse}. */ @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 PagedResponse + listAuthorizationRulesNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * Get the next page of items. * - * @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 nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 authorization rules for a namespace along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, - String authorizationRuleName, PolicykeyResource parameters) { - return regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, - Context.NONE).getValue(); + private PagedResponse + listAuthorizationRulesNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2048,18 +1788,11 @@ public ResourceListKeysInner regenerateKeys(String resourceGroupName, String nam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * @return paged collection of NamespaceResource items along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -2071,81 +1804,56 @@ private Mono> listNextSinglePageAsync(Stri * Get the next page of items. * * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { 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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Get the next page of items. * * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * Get the next page of items. * * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of + * @return paged collection of NamespaceResource items along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } + private Mono> listAllNextSinglePageAsync(String nextLink) { 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 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)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2155,27 +1863,15 @@ private Mono> listAllNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAuthorizationRulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listAllNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAuthorizationRulesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listAllNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2186,23 +1882,14 @@ private Mono> listAllNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return paged collection of NamespaceResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAuthorizationRulesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listAllNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listAllNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 b1e26553108d..b3f35ec6a2c3 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; @@ -12,13 +12,15 @@ 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; @@ -35,97 +37,139 @@ public NamespacesImpl(NamespacesClient innerClient, this.serviceManager = serviceManager; } - public Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, - Context context) { - Response inner - = this.serviceClient().checkAvailabilityWithResponse(parameters, context); + public Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String authorizationRuleName, Context context) { + Response inner = this.serviceClient() + .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckAvailabilityResultImpl(inner.getValue(), this.manager())); + new SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public CheckAvailabilityResult checkAvailability(CheckAvailabilityParameters parameters) { - CheckAvailabilityResultInner inner = this.serviceClient().checkAvailability(parameters); + public SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName) { + SharedAccessAuthorizationRuleResourceInner inner + = this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); if (inner != null) { - return new CheckAvailabilityResultImpl(inner, this.manager()); + return new SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); } else { return null; } } - public void deleteByResourceGroup(String resourceGroupName, String namespaceName) { - this.serviceClient().delete(resourceGroupName, namespaceName); + public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context) { + return this.serviceClient() + .deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); } - public void delete(String resourceGroupName, String namespaceName, Context context) { - this.serviceClient().delete(resourceGroupName, namespaceName, context); + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { + this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); } - public Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, - Context context) { - Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, namespaceName, context); + 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 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 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 NamespaceResourceImpl(inner.getValue(), this.manager())); + new ResourceListKeysImpl(inner.getValue(), this.manager())); } else { return null; } } - public NamespaceResource getByResourceGroup(String resourceGroupName, String namespaceName) { - NamespaceResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); + public ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { + ResourceListKeysInner inner + = this.serviceClient().listKeys(resourceGroupName, namespaceName, authorizationRuleName); if (inner != null) { - return new NamespaceResourceImpl(inner, this.manager()); + return new ResourceListKeysImpl(inner, this.manager()); } else { return null; } } - public Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - return this.serviceClient() - .deleteAuthorizationRuleWithResponse(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(), + new ResourceListKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName) { - this.serviceClient().deleteAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + 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 { + return null; + } } - public Response getAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String authorizationRuleName, Context context) { - Response inner = this.serviceClient() - .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, 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 SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); + new NamespaceResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName) { - SharedAccessAuthorizationRuleResourceInner inner - = this.serviceClient().getAuthorizationRule(resourceGroupName, namespaceName, authorizationRuleName); + public NamespaceResource getByResourceGroup(String resourceGroupName, String namespaceName) { + NamespaceResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, namespaceName); if (inner != null) { - return new SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); + 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 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, Context context) { + public PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context) { PagedIterable inner - = this.serviceClient().listByResourceGroup(resourceGroupName, context); + = this.serviceClient().listByResourceGroup(resourceGroupName, skipToken, top, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); } @@ -134,67 +178,48 @@ public PagedIterable list() { return ResourceManagerUtils.mapPage(inner, inner1 -> new NamespaceResourceImpl(inner1, this.manager())); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); + 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 listAuthorizationRules(String resourceGroupName, - String namespaceName) { - PagedIterable inner - = this.serviceClient().listAuthorizationRules(resourceGroupName, namespaceName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new SharedAccessAuthorizationRuleResourceImpl(inner1, this.manager())); - } - - public PagedIterable listAuthorizationRules(String resourceGroupName, + public Response getPnsCredentialsWithResponse(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 Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context) { - Response inner = this.serviceClient() - .listKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, 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())); + new PnsCredentialsResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName) { - ResourceListKeysInner inner - = this.serviceClient().listKeys(resourceGroupName, namespaceName, authorizationRuleName); + public PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName) { + PnsCredentialsResourceInner inner = this.serviceClient().getPnsCredentials(resourceGroupName, namespaceName); if (inner != null) { - return new ResourceListKeysImpl(inner, this.manager()); + return new PnsCredentialsResourceImpl(inner, this.manager()); } else { return null; } } - 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 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 ResourceListKeysImpl(inner.getValue(), this.manager())); + new CheckAvailabilityResultImpl(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 CheckAvailabilityResult checkAvailability(CheckAvailabilityParameters parameters) { + CheckAvailabilityResultInner inner = this.serviceClient().checkAvailability(parameters); if (inner != null) { - return new ResourceListKeysImpl(inner, this.manager()); + return new CheckAvailabilityResultImpl(inner, this.manager()); } else { return null; } @@ -239,10 +264,10 @@ public SharedAccessAuthorizationRuleResource getAuthorizationRuleById(String id) throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - String authorizationRuleName = ResourceManagerUtils.getValueFromIdByName(id, "AuthorizationRules"); + 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))); + String.format("The resource ID '%s' is not valid. Missing path segment 'authorizationRules'.", id))); } return this .getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE) @@ -261,10 +286,10 @@ public Response getAuthorizationRuleByIdW throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - String authorizationRuleName = ResourceManagerUtils.getValueFromIdByName(id, "AuthorizationRules"); + 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))); + String.format("The resource ID '%s' is not valid. Missing path segment 'authorizationRules'.", id))); } return this.getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); } @@ -280,10 +305,10 @@ public void deleteById(String 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) { + public Response deleteByIdWithResponse(String id, Context context) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( @@ -294,7 +319,7 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - this.delete(resourceGroupName, namespaceName, context); + return this.deleteByResourceGroupWithResponse(resourceGroupName, namespaceName, context); } public void deleteAuthorizationRuleById(String id) { @@ -308,10 +333,10 @@ public void deleteAuthorizationRuleById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - String authorizationRuleName = ResourceManagerUtils.getValueFromIdByName(id, "AuthorizationRules"); + 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))); + String.format("The resource ID '%s' is not valid. Missing path segment 'authorizationRules'.", id))); } this.deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, Context.NONE); } @@ -327,10 +352,10 @@ public Response deleteAuthorizationRuleByIdWithResponse(String id, Context throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'namespaces'.", id))); } - String authorizationRuleName = ResourceManagerUtils.getValueFromIdByName(id, "AuthorizationRules"); + 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))); + String.format("The resource ID '%s' is not valid. Missing path segment 'authorizationRules'.", id))); } return this.deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, context); 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 4d4d08efb990..349370e5be28 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 @@ -1,26 +1,29 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.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.BrowserCredential; import com.azure.resourcemanager.notificationhubs.models.DebugSendResponse; +import com.azure.resourcemanager.notificationhubs.models.FcmV1Credential; 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.NotificationHubResource; import com.azure.resourcemanager.notificationhubs.models.PnsCredentialsResource; import com.azure.resourcemanager.notificationhubs.models.Sku; import com.azure.resourcemanager.notificationhubs.models.WnsCredential; +import com.azure.resourcemanager.notificationhubs.models.XiaomiCredential; import java.util.Collections; import java.util.List; import java.util.Map; @@ -60,6 +63,10 @@ public Sku sku() { return this.innerModel().sku(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String namePropertiesName() { return this.innerModel().namePropertiesName(); } @@ -101,6 +108,22 @@ public BaiduCredential baiduCredential() { return this.innerModel().baiduCredential(); } + public BrowserCredential browserCredential() { + return this.innerModel().browserCredential(); + } + + public XiaomiCredential xiaomiCredential() { + return this.innerModel().xiaomiCredential(); + } + + public FcmV1Credential fcmV1Credential() { + return this.innerModel().fcmV1Credential(); + } + + public Long dailyMaxActiveDevices() { + return this.innerModel().dailyMaxActiveDevices(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -127,8 +150,6 @@ private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manag private String notificationHubName; - private NotificationHubCreateOrUpdateParameters createParameters; - private NotificationHubPatchParameters updateParameters; public NotificationHubResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { @@ -140,7 +161,7 @@ public NotificationHubResourceImpl withExistingNamespace(String resourceGroupNam public NotificationHubResource create() { this.innerObject = serviceManager.serviceClient() .getNotificationHubs() - .createOrUpdateWithResponse(resourceGroupName, namespaceName, notificationHubName, createParameters, + .createOrUpdateWithResponse(resourceGroupName, namespaceName, notificationHubName, this.innerModel(), Context.NONE) .getValue(); return this; @@ -149,7 +170,7 @@ public NotificationHubResource create() { public NotificationHubResource create(Context context) { this.innerObject = serviceManager.serviceClient() .getNotificationHubs() - .createOrUpdateWithResponse(resourceGroupName, namespaceName, notificationHubName, createParameters, + .createOrUpdateWithResponse(resourceGroupName, namespaceName, notificationHubName, this.innerModel(), context) .getValue(); return this; @@ -160,7 +181,6 @@ public NotificationHubResource create(Context context) { this.innerObject = new NotificationHubResourceInner(); this.serviceManager = serviceManager; this.notificationHubName = name; - this.createParameters = new NotificationHubCreateOrUpdateParameters(); } public NotificationHubResourceImpl update() { @@ -171,7 +191,7 @@ public NotificationHubResourceImpl update() { public NotificationHubResource apply() { this.innerObject = serviceManager.serviceClient() .getNotificationHubs() - .patchWithResponse(resourceGroupName, namespaceName, notificationHubName, updateParameters, Context.NONE) + .updateWithResponse(resourceGroupName, namespaceName, notificationHubName, updateParameters, Context.NONE) .getValue(); return this; } @@ -179,7 +199,7 @@ public NotificationHubResource apply() { public NotificationHubResource apply(Context context) { this.innerObject = serviceManager.serviceClient() .getNotificationHubs() - .patchWithResponse(resourceGroupName, namespaceName, notificationHubName, updateParameters, context) + .updateWithResponse(resourceGroupName, namespaceName, notificationHubName, updateParameters, context) .getValue(); return this; } @@ -209,9 +229,9 @@ public NotificationHubResource refresh(Context context) { return this; } - public Response debugSendWithResponse(Object parameters, Context context) { + public Response debugSendWithResponse(Context context) { return serviceManager.notificationHubs() - .debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, context); + .debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, context); } public DebugSendResponse debugSend() { @@ -229,18 +249,18 @@ public PnsCredentialsResource getPnsCredentials() { } 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); @@ -250,7 +270,7 @@ public NotificationHubResourceImpl withTags(Map tags) { public NotificationHubResourceImpl withSku(Sku sku) { if (isInCreateMode()) { - this.createParameters.withSku(sku); + this.innerModel().withSku(sku); return this; } else { this.updateParameters.withSku(sku); @@ -259,18 +279,13 @@ public NotificationHubResourceImpl withSku(Sku sku) { } public NotificationHubResourceImpl withNamePropertiesName(String namePropertiesName) { - if (isInCreateMode()) { - this.createParameters.withNamePropertiesName(namePropertiesName); - return this; - } else { - this.updateParameters.withNamePropertiesName(namePropertiesName); - return this; - } + this.innerModel().withNamePropertiesName(namePropertiesName); + return this; } public NotificationHubResourceImpl withRegistrationTtl(String registrationTtl) { if (isInCreateMode()) { - this.createParameters.withRegistrationTtl(registrationTtl); + this.innerModel().withRegistrationTtl(registrationTtl); return this; } else { this.updateParameters.withRegistrationTtl(registrationTtl); @@ -278,20 +293,9 @@ public NotificationHubResourceImpl withRegistrationTtl(String registrationTtl) { } } - 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); + this.innerModel().withApnsCredential(apnsCredential); return this; } else { this.updateParameters.withApnsCredential(apnsCredential); @@ -301,7 +305,7 @@ public NotificationHubResourceImpl withApnsCredential(ApnsCredential apnsCredent public NotificationHubResourceImpl withWnsCredential(WnsCredential wnsCredential) { if (isInCreateMode()) { - this.createParameters.withWnsCredential(wnsCredential); + this.innerModel().withWnsCredential(wnsCredential); return this; } else { this.updateParameters.withWnsCredential(wnsCredential); @@ -311,7 +315,7 @@ public NotificationHubResourceImpl withWnsCredential(WnsCredential wnsCredential public NotificationHubResourceImpl withGcmCredential(GcmCredential gcmCredential) { if (isInCreateMode()) { - this.createParameters.withGcmCredential(gcmCredential); + this.innerModel().withGcmCredential(gcmCredential); return this; } else { this.updateParameters.withGcmCredential(gcmCredential); @@ -321,7 +325,7 @@ public NotificationHubResourceImpl withGcmCredential(GcmCredential gcmCredential public NotificationHubResourceImpl withMpnsCredential(MpnsCredential mpnsCredential) { if (isInCreateMode()) { - this.createParameters.withMpnsCredential(mpnsCredential); + this.innerModel().withMpnsCredential(mpnsCredential); return this; } else { this.updateParameters.withMpnsCredential(mpnsCredential); @@ -331,7 +335,7 @@ public NotificationHubResourceImpl withMpnsCredential(MpnsCredential mpnsCredent public NotificationHubResourceImpl withAdmCredential(AdmCredential admCredential) { if (isInCreateMode()) { - this.createParameters.withAdmCredential(admCredential); + this.innerModel().withAdmCredential(admCredential); return this; } else { this.updateParameters.withAdmCredential(admCredential); @@ -341,7 +345,7 @@ public NotificationHubResourceImpl withAdmCredential(AdmCredential admCredential public NotificationHubResourceImpl withBaiduCredential(BaiduCredential baiduCredential) { if (isInCreateMode()) { - this.createParameters.withBaiduCredential(baiduCredential); + this.innerModel().withBaiduCredential(baiduCredential); return this; } else { this.updateParameters.withBaiduCredential(baiduCredential); @@ -349,7 +353,37 @@ public NotificationHubResourceImpl withBaiduCredential(BaiduCredential baiduCred } } + public NotificationHubResourceImpl withBrowserCredential(BrowserCredential browserCredential) { + if (isInCreateMode()) { + this.innerModel().withBrowserCredential(browserCredential); + return this; + } else { + this.updateParameters.withBrowserCredential(browserCredential); + return this; + } + } + + public NotificationHubResourceImpl withXiaomiCredential(XiaomiCredential xiaomiCredential) { + if (isInCreateMode()) { + this.innerModel().withXiaomiCredential(xiaomiCredential); + return this; + } else { + this.updateParameters.withXiaomiCredential(xiaomiCredential); + return this; + } + } + + public NotificationHubResourceImpl withFcmV1Credential(FcmV1Credential fcmV1Credential) { + if (isInCreateMode()) { + this.innerModel().withFcmV1Credential(fcmV1Credential); + return this; + } else { + this.updateParameters.withFcmV1Credential(fcmV1Credential); + return this; + } + } + private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } 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 69d9e703a3f5..cbdc6b8a49fa 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; @@ -37,13 +37,11 @@ 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.implementation.models.NotificationHubListResult; +import com.azure.resourcemanager.notificationhubs.implementation.models.SharedAccessAuthorizationRuleListResult; 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.SharedAccessAuthorizationRuleListResult; +import com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource; import reactor.core.publisher.Mono; /** @@ -75,425 +73,447 @@ public final class NotificationHubsClientImpl implements NotificationHubsClient * The interface defining all the services for NotificationHubsManagementClientNotificationHubs to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "NotificationHubsMana") + @Host("{endpoint}") + @ServiceInterface(name = "NotificationHubsManagementClientNotificationHubs") public interface NotificationHubsService { @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNotificationHubAvailability( - @HostParam("$host") String endpoint, @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, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NotificationHubCreateOrUpdateParameters parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("notificationHubName") String notificationHubName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationHubResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationHubResourceInner parameters, 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> patch(@HostParam("$host") String endpoint, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") NotificationHubPatchParameters parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("notificationHubName") String notificationHubName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationHubPatchParameters parameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") NotificationHubPatchParameters parameters, 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, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, 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, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, Context context); + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @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); + @QueryParam("$skipToken") String skipToken, @QueryParam("$top") Integer top, + @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 }) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> debugSend(@HostParam("$host") String endpoint, + Mono> debugSend(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") Object parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("notificationHubName") String notificationHubName, @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}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdateAuthorizationRule( - @HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @PathParam("authorizationRuleName") String authorizationRuleName, + Response debugSendSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @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" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteAuthorizationRule(@HostParam("$host") String endpoint, + Mono> getPnsCredentials(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, - @PathParam("notificationHubName") String notificationHubName, - @PathParam("authorizationRuleName") String authorizationRuleName, + @PathParam("notificationHubName") String notificationHubName, @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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getPnsCredentialsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @HeaderParam("Accept") String accept, Context context); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNotificationHubAvailability( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckAvailabilityParameters parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNotificationHubAvailabilitySync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckAvailabilityParameters parameters, Context context); + @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}") + @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("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @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); + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Response getAuthorizationRuleSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdateAuthorizationRule( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SharedAccessAuthorizationRuleResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateAuthorizationRuleSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SharedAccessAuthorizationRuleResourceInner parameters, 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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> deleteAuthorizationRule(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, 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 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteAuthorizationRuleSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules") + @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); + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, @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") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, + Response listAuthorizationRulesSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @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); + @PathParam("notificationHubName") String notificationHubName, @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") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateKeys(@HostParam("$host") String endpoint, + Mono> listKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/listKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, @HeaderParam("Accept") String accept, + Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> regenerateKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("notificationHubName") String notificationHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyKeyResource parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getPnsCredentials(@HostParam("$host") String endpoint, + Response regenerateKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @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); + @PathParam("notificationHubName") String notificationHubName, + @PathParam("authorizationRuleName") String authorizationRuleName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PolicyKeyResource parameters, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listAuthorizationRulesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.checkNotificationHubAvailability(this.client.getEndpoint(), - resourceGroupName, namespaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), - parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listAuthorizationRulesNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Checks the availability of the given notificationHub in a namespace. + * Gets the notification hub. * - * @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 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 CheckAvailability resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the notification hub 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + private Mono> getWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName) { 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 FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Checks the availability of the given notificationHub in a namespace. + * Gets the notification hub. * - * @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 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 CheckAvailability resource on successful completion of {@link Mono}. + * @return the notification hub on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNotificationHubAvailabilityAsync(String resourceGroupName, - String namespaceName, CheckAvailabilityParameters parameters) { - return checkNotificationHubAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters) + private Mono getAsync(String resourceGroupName, String namespaceName, + String notificationHubName) { + return getWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Checks the availability of the given notificationHub in a namespace. + * Gets the notification hub. * - * @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 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 CheckAvailability resource along with {@link Response}. + * @return the notification hub along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, - String namespaceName, CheckAvailabilityParameters parameters, Context context) { - return checkNotificationHubAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters, context) - .block(); + public Response getWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, notificationHubName, accept, context); } /** - * Checks the availability of the given notificationHub in a namespace. + * Gets the notification hub. * - * @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 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 CheckAvailability resource. + * @return the notification hub. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, - CheckAvailabilityParameters parameters) { - return checkNotificationHubAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE) - .getValue(); + public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, + String notificationHubName) { + return getWithResponse(resourceGroupName, namespaceName, notificationHubName, 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. + * @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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return notification Hub Resource 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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + String namespaceName, String notificationHubName, NotificationHubResourceInner parameters) { + final String contentType = "application/json"; 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.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, contentType, + accept, parameters, 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. - * @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 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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.")); - } - 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); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + * @return notification Hub Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String namespaceName, - String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + String notificationHubName, NotificationHubResourceInner parameters) { return createOrUpdateWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -501,39 +521,41 @@ private Mono createOrUpdateAsync(String resourceGr /** * 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 ManagementException thrown 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 along with {@link Response}. + * @return notification Hub Resource along with {@link Response}. */ @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(); + String namespaceName, String notificationHubName, NotificationHubResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, contentType, accept, + parameters, 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. + * @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 createOrUpdate(String resourceGroupName, String namespaceName, - String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { + String notificationHubName, NotificationHubResourceInner parameters) { return createOrUpdateWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, Context.NONE).getValue(); } @@ -541,158 +563,94 @@ public NotificationHubResourceInner createOrUpdate(String resourceGroupName, Str /** * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return notification Hub Resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync(String resourceGroupName, + 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.")); - } - if (parameters != null) { - parameters.validate(); - } + final String contentType = "application/json"; 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.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, contentType, + accept, parameters, 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. - * @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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return notification Hub Resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> patchWithResponseAsync(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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.")); - } - if (parameters != null) { - 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); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono patchAsync(String resourceGroupName, String namespaceName, - String notificationHubName) { - final NotificationHubPatchParameters parameters = null; - return patchWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) + private Mono updateAsync(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubPatchParameters parameters) { + return updateWithResponseAsync(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. - * @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 ManagementException thrown 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 along with {@link Response}. + * @return notification Hub Resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response patchWithResponse(String resourceGroupName, String namespaceName, + public Response updateWithResponse(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubPatchParameters parameters, Context context) { - return patchWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters, context) - .block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, contentType, accept, + parameters, 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 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 patchWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, Context.NONE) + public NotificationHubResourceInner update(String resourceGroupName, String namespaceName, + String notificationHubName, NotificationHubPatchParameters parameters) { + return updateWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, Context.NONE) .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. + * @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. @@ -701,76 +659,18 @@ public NotificationHubResourceInner patch(String resourceGroupName, String names @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.")); - } return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, - notificationHubName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 notificationHubName, 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 (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.")); - } - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, namespaceName, notificationHubName, - this.client.getApiVersion(), this.client.getSubscriptionId(), 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. + * @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. @@ -785,9 +685,9 @@ private Mono deleteAsync(String resourceGroupName, String namespaceName, S /** * 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 ManagementException thrown if the request is rejected by server. @@ -797,15 +697,16 @@ private Mono deleteAsync(String resourceGroupName, String namespaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String namespaceName, String notificationHubName, Context context) { - return deleteWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context).block(); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, 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. + * @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. @@ -818,229 +719,177 @@ public void delete(String resourceGroupName, String namespaceName, String notifi /** * 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 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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return paged collection of NotificationHubResource items along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.")); - } + private Mono> listSinglePageAsync(String resourceGroupName, + String namespaceName, String skipToken, Integer top) { 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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, skipToken, top, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. + * @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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return paged collection of NotificationHubResource items as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.get(this.client.getEndpoint(), resourceGroupName, namespaceName, notificationHubName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + @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)); } /** * 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 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 on successful completion of {@link Mono}. + * @return paged collection of NotificationHubResource items as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String namespaceName, - String notificationHubName) { - return getWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @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)); } /** * 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. + * @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 along with {@link Response}. + * @return paged collection of NotificationHubResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, Context context) { - return getWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, context).block(); + private PagedResponse listSinglePage(String resourceGroupName, String namespaceName, + String skipToken, Integer top) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, skipToken, top, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** * 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 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 paged collection of NotificationHubResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public NotificationHubResourceInner get(String resourceGroupName, String namespaceName, - String notificationHubName) { - return getWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE).getValue(); + private PagedResponse listSinglePage(String resourceGroupName, String namespaceName, + String skipToken, Integer top, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, skipToken, top, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * test send a push notification. + * 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 parameters Debug send parameters. + * @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 along with {@link Response} on successful completion of - * {@link Mono}. + * @return paged collection of NotificationHubResource items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> debugSendWithResponseAsync(String resourceGroupName, - String namespaceName, String notificationHubName, Object parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (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)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + final String skipToken = null; + final Integer top = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, namespaceName, skipToken, top), + nextLink -> listNextSinglePage(nextLink)); } /** - * test send a push notification. + * 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 parameters Debug send parameters. + * @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 paged collection of NotificationHubResource items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName, + String skipToken, Integer top, Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, namespaceName, skipToken, top, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * 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 NotificationHub Resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> debugSendWithResponseAsync(String resourceGroupName, - String namespaceName, String notificationHubName, Object parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (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.")); - } + String namespaceName, String notificationHubName) { 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); + return FluxUtil.withContext(context -> service.debugSend(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * test send a push notification. + * 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 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. @@ -1049,18 +898,16 @@ private Mono> debugSendWithResponseAsync(String @ServiceMethod(returns = ReturnType.SINGLE) private Mono debugSendAsync(String resourceGroupName, String namespaceName, String notificationHubName) { - final Object parameters = null; - return debugSendWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters) + return debugSendWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * test send a push notification. + * 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. + * @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. @@ -1069,17 +916,18 @@ private Mono debugSendAsync(String resourceGroupName, St */ @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(); + String notificationHubName, Context context) { + final String accept = "application/json"; + return service.debugSendSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, accept, context); } /** - * test send a push notification. + * 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 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. @@ -1088,633 +936,436 @@ public Response debugSendWithResponse(String resourceGro @ServiceMethod(returns = ReturnType.SINGLE) public DebugSendResponseInner debugSend(String resourceGroupName, String namespaceName, String notificationHubName) { - final Object parameters = null; - return debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, Context.NONE) - .getValue(); + return debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE).getValue(); } /** - * Creates/Updates an authorization rule for a NotificationHub. + * 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 authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @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 along with {@link Response} on successful completion of + * @return description of a NotificationHub PNS Credentials 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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (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(); - } + private Mono> getPnsCredentialsWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName) { 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.getPnsCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates/Updates an authorization rule for a NotificationHub. + * 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 authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. - * @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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (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); - } - - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 on successful completion of {@link Mono}. + * @return description of a NotificationHub PNS Credentials 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(res -> Mono.justOrEmpty(res.getValue())); + private Mono getPnsCredentialsAsync(String resourceGroupName, String namespaceName, + String notificationHubName) { + return getPnsCredentialsWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates/Updates an authorization rule for a NotificationHub. + * 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 authorizationRuleName Authorization Rule Name. - * @param parameters The shared access 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 along with {@link Response}. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ @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 Response getPnsCredentialsWithResponse(String resourceGroupName, + String namespaceName, String notificationHubName, Context context) { + final String accept = "application/json"; + return service.getPnsCredentialsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, accept, context); } /** - * Creates/Updates an authorization rule for a NotificationHub. + * 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 authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @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 PNS Credentials. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, - String namespaceName, String notificationHubName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { - return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName, parameters, Context.NONE).getValue(); + public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, + String notificationHubName) { + return getPnsCredentialsWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE) + .getValue(); } /** - * Deletes a notificationHub authorization rule. + * Checks the availability of the given notificationHub in a namespace. * - * @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 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 {@link Response} on successful completion of {@link Mono}. + * @return description of a CheckAvailability resource 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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (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.")); - } + private Mono> checkNotificationHubAvailabilityWithResponseAsync( + String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters) { + final String contentType = "application/json"; + 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.checkNotificationHubAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a notificationHub authorization rule. + * Checks the availability of the given notificationHub in a namespace. * - * @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. + * @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 {@link Response} on successful completion of {@link Mono}. + * @return description of a CheckAvailability resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (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.")); - } - context = this.client.mergeContext(context); - return service.deleteAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - notificationHubName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - context); + private Mono checkNotificationHubAvailabilityAsync(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithResponseAsync(resourceGroupName, namespaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a notificationHub authorization rule. + * Checks the availability of the given notificationHub in a namespace. * - * @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 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 A {@link Mono} that completes when a successful response is received. + * @return description of a CheckAvailability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, - String notificationHubName, String authorizationRuleName) { - return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName).flatMap(ignored -> Mono.empty()); + public Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNotificationHubAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, contentType, accept, parameters, + context); } /** - * Deletes a notificationHub authorization rule. + * Checks the availability of the given notificationHub in a namespace. * - * @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. + * @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 {@link Response}. + * @return description of a CheckAvailability resource. */ @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 CheckAvailabilityResultInner checkNotificationHubAvailability(String resourceGroupName, String namespaceName, + CheckAvailabilityParameters parameters) { + return checkNotificationHubAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, Context.NONE) + .getValue(); } /** - * Deletes a notificationHub authorization rule. + * 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 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 along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, - String authorizationRuleName) { - deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName, Context.NONE); + private Mono> getAuthorizationRuleWithResponseAsync( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, 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. + * @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 along with {@link Response} on successful completion - * of {@link Mono}. + * @return an authorization rule for a NotificationHub by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, - namespaceName, notificationHubName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + private Mono getAuthorizationRuleAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName) { + return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName).flatMap(res -> Mono.justOrEmpty(res.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. + * @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 along with {@link Response} on successful completion - * of {@link Mono}. + * @return an authorization rule for a NotificationHub by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getAuthorizationRuleWithResponseAsync( + public Response getAuthorizationRuleWithResponse( 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getAuthorizationRule(this.client.getEndpoint(), resourceGroupName, namespaceName, - notificationHubName, authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), - accept, context); + return service.getAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, 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. + * @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 on successful completion of {@link Mono}. + * @return an authorization rule for a NotificationHub by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAuthorizationRuleAsync(String resourceGroupName, + public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, Context.NONE).getValue(); } /** - * Gets an authorization rule for a NotificationHub by name. + * 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 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 an authorization rule for a NotificationHub by name along with {@link Response}. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAuthorizationRuleWithResponse( + private Mono> createOrUpdateAuthorizationRuleWithResponseAsync( String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, - Context context) { - return getAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName, context).block(); + SharedAccessAuthorizationRuleResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdateAuthorizationRule(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + notificationHubName, authorizationRuleName, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets an authorization rule for a NotificationHub by name. + * 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 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 an authorization rule for a NotificationHub by name. + * @return response for POST requests that return single SharedAccessAuthorizationRule on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SharedAccessAuthorizationRuleResourceInner getAuthorizationRule(String resourceGroupName, - String namespaceName, String notificationHubName, String authorizationRuleName) { - return getAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName, Context.NONE).getValue(); + 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())); } /** - * Lists the notification hubs associated with a namespace. + * Creates/Updates an authorization rule for a NotificationHub. * - * @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 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 response of the List NotificationHub operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String namespaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, namespaceName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.createOrUpdateAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, contentType, accept, parameters, context); } /** - * Lists the notification hubs associated with a namespace. + * Creates/Updates an authorization rule for a NotificationHub. * - * @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. + * @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 response of the List NotificationHub operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return response for POST requests that return single SharedAccessAuthorizationRule. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String namespaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (namespaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter namespaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, namespaceName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + public SharedAccessAuthorizationRuleResourceInner createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { + return createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, parameters, Context.NONE).getValue(); } /** - * Lists the notification hubs associated with a namespace. + * Deletes a notificationHub authorization rule. * - * @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 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 as paginated response with {@link PagedFlux}. + * @return the {@link Response} 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> deleteAuthorizationRuleWithResponseAsync(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName) { + return FluxUtil + .withContext(context -> service.deleteAuthorizationRule(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + notificationHubName, authorizationRuleName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the notification hubs associated with a namespace. + * Deletes a notificationHub authorization rule. * - * @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. + * @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 as paginated response with {@link PagedFlux}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String namespaceName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, namespaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAuthorizationRuleAsync(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName) { + return deleteAuthorizationRuleWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName).flatMap(ignored -> Mono.empty()); } /** - * Lists the notification hubs associated with a namespace. + * Deletes a notificationHub authorization rule. * - * @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 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 as paginated response with {@link PagedIterable}. + * @return the {@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 deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, String authorizationRuleName, Context context) { + return service.deleteAuthorizationRuleSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, context); } /** - * Lists the notification hubs associated with a namespace. + * Deletes a notificationHub authorization rule. * - * @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. + * @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 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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, + String authorizationRuleName) { + deleteAuthorizationRuleWithResponse(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, Context.NONE); } /** * 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. @@ -1724,30 +1375,11 @@ public PagedIterable list(String resourceGroupName @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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.listAuthorizationRules(this.client.getEndpoint(), resourceGroupName, namespaceName, - notificationHubName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listAuthorizationRules(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, namespaceName, + notificationHubName, accept, context)) .>map( res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1757,92 +1389,73 @@ private Mono> listAuth /** * 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 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the authorization rules for a NotificationHub as paginated response with {@link PagedFlux}. */ - @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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 - .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)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, + String namespaceName, String notificationHubName) { + return new PagedFlux<>( + () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), + nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); } /** * 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 as paginated response with {@link PagedFlux}. + * @return the authorization rules for a NotificationHub along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, - String namespaceName, String notificationHubName) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listAuthorizationRulesSinglePage(String resourceGroupName, String namespaceName, String notificationHubName) { + final String accept = "application/json"; + Response res = service.listAuthorizationRulesSync( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, accept, Context.NONE); + return 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. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 as paginated response with {@link PagedFlux}. + * @return the authorization rules for a NotificationHub along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAuthorizationRulesAsync(String resourceGroupName, - String namespaceName, String notificationHubName, Context context) { - return new PagedFlux<>( - () -> listAuthorizationRulesSinglePageAsync(resourceGroupName, namespaceName, notificationHubName, context), - nextLink -> listAuthorizationRulesNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAuthorizationRulesSinglePage( + String resourceGroupName, String namespaceName, String notificationHubName, Context context) { + final String accept = "application/json"; + Response res = service.listAuthorizationRulesSync( + this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, + namespaceName, notificationHubName, accept, context); + return 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. @@ -1851,15 +1464,17 @@ private PagedFlux listAuthorizationR @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String notificationHubName) { - return new PagedIterable<>(listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName)); + return new PagedIterable<>( + () -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName, notificationHubName), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink)); } /** * 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. @@ -1870,16 +1485,17 @@ public PagedIterable listAuthorizati public PagedIterable listAuthorizationRules(String resourceGroupName, String namespaceName, String notificationHubName, Context context) { return new PagedIterable<>( - listAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName, context)); + () -> listAuthorizationRulesSinglePage(resourceGroupName, namespaceName, notificationHubName, context), + nextLink -> listAuthorizationRulesNextSinglePage(nextLink, 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. @@ -1889,90 +1505,21 @@ public PagedIterable listAuthorizati @ServiceMethod(returns = ReturnType.SINGLE) 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, - notificationHubName, authorizationRuleName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (authorizationRuleName == null) { - return Mono - .error(new IllegalArgumentException("Parameter authorizationRuleName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), 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. @@ -1989,10 +1536,10 @@ private Mono listKeysAsync(String resourceGroupName, Stri /** * 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. @@ -2002,17 +1549,19 @@ private Mono listKeysAsync(String resourceGroupName, Stri @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(); + final String accept = "application/json"; + return service.listKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, 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. @@ -2028,126 +1577,46 @@ public ResourceListKeysInner listKeys(String resourceGroupName, String namespace /** * 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 along with {@link Response} on successful completion of - * {@link Mono}. + * @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) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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 (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(); - } + String namespaceName, String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters) { + final String contentType = "application/json"; 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, contentType, accept, parameters, 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 context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 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, - 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 (notificationHubName == null) { - 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.regenerateKeys(this.client.getEndpoint(), resourceGroupName, namespaceName, notificationHubName, - authorizationRuleName, this.client.getApiVersion(), this.client.getSubscriptionId(), 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 on successful completion of {@link Mono}. + * @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) { + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters) { return regenerateKeysWithResponseAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -2155,182 +1624,67 @@ private Mono regenerateKeysAsync(String resourceGroupName /** * 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 along with {@link Response}. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ @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(); + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.regenerateKeysSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, contentType, accept, parameters, 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). */ @ServiceMethod(returns = ReturnType.SINGLE) public ResourceListKeysInner regenerateKeys(String resourceGroupName, String namespaceName, - String notificationHubName, String authorizationRuleName, PolicykeyResource parameters) { + 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 . + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. - * @param notificationHubName The notification hub name. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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}. + * @return paged collection of NotificationHubResource items along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - 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.")); - } + private Mono> listNextSinglePageAsync(String nextLink) { 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)) + 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())); } - /** - * 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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, String notificationHubName, 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 (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.getPnsCredentials(this.client.getEndpoint(), resourceGroupName, namespaceName, - notificationHubName, this.client.getApiVersion(), this.client.getSubscriptionId(), 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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, - String notificationHubName) { - return getPnsCredentialsWithResponseAsync(resourceGroupName, namespaceName, notificationHubName) - .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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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, 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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, - String notificationHubName) { - return getPnsCredentialsWithResponse(resourceGroupName, namespaceName, notificationHubName, Context.NONE) - .getValue(); - } - /** * Get the next page of items. * @@ -2338,23 +1692,15 @@ public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of NotificationHubResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2365,24 +1711,15 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of NotificationHubResource items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -2392,19 +1729,12 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the authorization rules for a NotificationHub along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAuthorizationRulesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -2415,6 +1745,25 @@ private Mono> listNextSinglePageAsyn .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse + listAuthorizationRulesNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -2423,23 +1772,15 @@ private Mono> listNextSinglePageAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response of the List Namespace operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the authorization rules for a NotificationHub along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listAuthorizationRulesNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse + listAuthorizationRulesNextSinglePage(String nextLink, Context context) { 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)); + Response res + = service.listAuthorizationRulesNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 b3ff3545038f..a9dbe85c593d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; @@ -22,9 +22,8 @@ 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; public final class NotificationHubsImpl implements NotificationHubs { @@ -40,24 +39,23 @@ public NotificationHubsImpl(NotificationHubsClient innerClient, this.serviceManager = serviceManager; } - public Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, - String namespaceName, CheckAvailabilityParameters parameters, Context context) { - Response inner = this.serviceClient() - .checkNotificationHubAvailabilityWithResponse(resourceGroupName, namespaceName, parameters, 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(), - new CheckAvailabilityResultImpl(inner.getValue(), this.manager())); + new NotificationHubResourceImpl(inner.getValue(), this.manager())); } else { return null; } } - public CheckAvailabilityResult checkNotificationHubAvailability(String resourceGroupName, String namespaceName, - CheckAvailabilityParameters parameters) { - CheckAvailabilityResultInner inner - = this.serviceClient().checkNotificationHubAvailability(resourceGroupName, namespaceName, parameters); + public NotificationHubResource get(String resourceGroupName, String namespaceName, String notificationHubName) { + NotificationHubResourceInner inner + = this.serviceClient().get(resourceGroupName, namespaceName, notificationHubName); if (inner != null) { - return new CheckAvailabilityResultImpl(inner, this.manager()); + return new NotificationHubResourceImpl(inner, this.manager()); } else { return null; } @@ -72,32 +70,22 @@ public void delete(String resourceGroupName, String namespaceName, String notifi this.serviceClient().delete(resourceGroupName, namespaceName, notificationHubName); } - 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(), - new NotificationHubResourceImpl(inner.getValue(), 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 NotificationHubResourceImpl(inner1, this.manager())); } - public NotificationHubResource get(String resourceGroupName, String namespaceName, String notificationHubName) { - NotificationHubResourceInner inner - = this.serviceClient().get(resourceGroupName, namespaceName, notificationHubName); - if (inner != null) { - return new NotificationHubResourceImpl(inner, this.manager()); - } else { - return null; - } + 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, Object parameters, Context context) { + String notificationHubName, Context context) { Response inner = this.serviceClient() - .debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, parameters, context); + .debugSendWithResponse(resourceGroupName, namespaceName, notificationHubName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new DebugSendResponseImpl(inner.getValue(), this.manager())); @@ -116,44 +104,50 @@ public DebugSendResponse debugSend(String resourceGroupName, String namespaceNam } } - 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); + 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 SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SharedAccessAuthorizationRuleResourceImpl(inner.getValue(), this.manager())); + new PnsCredentialsResourceImpl(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 PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName, + String notificationHubName) { + PnsCredentialsResourceInner inner + = this.serviceClient().getPnsCredentials(resourceGroupName, namespaceName, notificationHubName); if (inner != null) { - return new SharedAccessAuthorizationRuleResourceImpl(inner, this.manager()); + return new PnsCredentialsResourceImpl(inner, 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 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(), + new CheckAvailabilityResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, - String authorizationRuleName) { - this.serviceClient() - .deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); + public CheckAvailabilityResult checkNotificationHubAvailability(String resourceGroupName, String namespaceName, + CheckAvailabilityParameters parameters) { + CheckAvailabilityResultInner inner + = this.serviceClient().checkNotificationHubAvailability(resourceGroupName, namespaceName, parameters); + if (inner != null) { + return new CheckAvailabilityResultImpl(inner, this.manager()); + } else { + return null; + } } public Response getAuthorizationRuleWithResponse(String resourceGroupName, @@ -180,16 +174,44 @@ public SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourc } } - 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 Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner 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 PagedIterable list(String resourceGroupName, String namespaceName, - Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, namespaceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new NotificationHubResourceImpl(inner1, this.manager())); + public SharedAccessAuthorizationRuleResource createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters) { + SharedAccessAuthorizationRuleResourceInner inner = this.serviceClient() + .createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, + authorizationRuleName, parameters); + if (inner != null) { + return new SharedAccessAuthorizationRuleResourceImpl(inner, 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 PagedIterable listAuthorizationRules(String resourceGroupName, @@ -233,7 +255,7 @@ public ResourceListKeys listKeys(String resourceGroupName, String namespaceName, } public Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, String authorizationRuleName, PolicykeyResource parameters, Context context) { + String notificationHubName, String authorizationRuleName, PolicyKeyResource parameters, Context context) { Response inner = this.serviceClient() .regenerateKeysWithResponse(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, context); @@ -246,7 +268,7 @@ public Response regenerateKeysWithResponse(String resourceGrou } public ResourceListKeys regenerateKeys(String resourceGroupName, String namespaceName, String notificationHubName, - String authorizationRuleName, PolicykeyResource parameters) { + String authorizationRuleName, PolicyKeyResource parameters) { ResourceListKeysInner inner = this.serviceClient() .regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters); if (inner != null) { @@ -256,29 +278,6 @@ public ResourceListKeys regenerateKeys(String resourceGroupName, String namespac } } - 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 SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PnsCredentialsResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName, - String notificationHubName) { - PnsCredentialsResourceInner inner - = this.serviceClient().getPnsCredentials(resourceGroupName, namespaceName, notificationHubName); - if (inner != null) { - return new PnsCredentialsResourceImpl(inner, this.manager()); - } else { - return null; - } - } - public NotificationHubResource getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { 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 index 1f76e6808497..231fa1d750a8 100644 --- 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; @@ -20,36 +20,34 @@ @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. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID - * forms part of the URI for every service call. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the NotificationHubsManagementClientBuilder. */ - public NotificationHubsManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public NotificationHubsManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the NotificationHubsManagementClientBuilder. */ - public NotificationHubsManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public NotificationHubsManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -134,7 +132,7 @@ public NotificationHubsManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); NotificationHubsManagementClientImpl client = new NotificationHubsManagementClientImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); 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/NotificationHubsManagementClientImpl.java index e4ca71b58dfe..26e40ca42ed5 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/NotificationHubsManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; @@ -15,18 +15,22 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; 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.OperationsClient; +import com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -42,28 +46,12 @@ @ServiceClient(builder = NotificationHubsManagementClientBuilder.class) public final class NotificationHubsManagementClientImpl implements NotificationHubsManagementClient { /** - * Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms - * part of the URI for every service call. - */ - 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. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -72,12 +60,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -85,6 +73,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -169,6 +171,20 @@ public NotificationHubsClient getNotificationHubs() { return this.notificationHubs; } + /** + * 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 NotificationHubsManagementClient client. * @@ -176,21 +192,21 @@ public NotificationHubsClient getNotificationHubs() { * @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 endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ NotificationHubsManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2017-04-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2023-10-01-preview"; this.operations = new OperationsClientImpl(this); this.namespaces = new NamespacesClientImpl(this); this.notificationHubs = new NotificationHubsClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); } /** @@ -230,6 +246,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * 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 f6d3ca9bee4d..7523e80232f0 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; 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; @@ -27,6 +28,14 @@ public OperationDisplay display() { return this.innerModel().display(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationProperties properties() { + return this.innerModel().properties(); + } + 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 e80e67761558..4271c040435a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.notificationhubs.fluent.OperationsClient; import com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner; -import com.azure.resourcemanager.notificationhubs.models.OperationListResult; +import com.azure.resourcemanager.notificationhubs.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +59,21 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for NotificationHubsManagementClientOperations to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "NotificationHubsMana") + @Host("{endpoint}") + @ServiceInterface(name = "NotificationHubsManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.NotificationHubs/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.NotificationHubs/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,23 +81,26 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @throws 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of Operation items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( @@ -101,81 +111,75 @@ private Mono> listSinglePageAsync() { } /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of Operation items as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @throws 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 as paginated response with {@link PagedFlux}. + * @return paged collection of Operation items along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 as paginated response with {@link PagedFlux}. + * @return paged collection of Operation items along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @throws 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 as paginated response with - * {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 as paginated response with - * {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -185,18 +189,11 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of Operation items along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -204,6 +201,24 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of Operation items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -212,22 +227,13 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return paged collection of Operation items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { 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)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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 9f63228665c3..508de0c774e2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; 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 ae11032396c2..e932d32446bf 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 @@ -1,18 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.BrowserCredential; +import com.azure.resourcemanager.notificationhubs.models.FcmV1Credential; import com.azure.resourcemanager.notificationhubs.models.GcmCredential; import com.azure.resourcemanager.notificationhubs.models.MpnsCredential; import com.azure.resourcemanager.notificationhubs.models.PnsCredentialsResource; -import com.azure.resourcemanager.notificationhubs.models.Sku; import com.azure.resourcemanager.notificationhubs.models.WnsCredential; +import com.azure.resourcemanager.notificationhubs.models.XiaomiCredential; import java.util.Collections; import java.util.Map; @@ -52,16 +55,24 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AdmCredential admCredential() { + return this.innerModel().admCredential(); } public ApnsCredential apnsCredential() { return this.innerModel().apnsCredential(); } - public WnsCredential wnsCredential() { - return this.innerModel().wnsCredential(); + public BaiduCredential baiduCredential() { + return this.innerModel().baiduCredential(); + } + + public BrowserCredential browserCredential() { + return this.innerModel().browserCredential(); } public GcmCredential gcmCredential() { @@ -72,12 +83,16 @@ public MpnsCredential mpnsCredential() { return this.innerModel().mpnsCredential(); } - public AdmCredential admCredential() { - return this.innerModel().admCredential(); + public WnsCredential wnsCredential() { + return this.innerModel().wnsCredential(); } - public BaiduCredential baiduCredential() { - return this.innerModel().baiduCredential(); + public XiaomiCredential xiaomiCredential() { + return this.innerModel().xiaomiCredential(); + } + + public FcmV1Credential fcmV1Credential() { + return this.innerModel().fcmV1Credential(); } 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..705208c22e8c --- /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) TypeSpec 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..5648fe782537 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,1155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.BinaryData; +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.implementation.models.PrivateEndpointConnectionResourceListResult; +import com.azure.resourcemanager.notificationhubs.implementation.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 NotificationHubsManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PrivateEndpointConnectionsClientImpl(NotificationHubsManagementClientImpl client) { + this.service = RestProxy.create(PrivateEndpointConnectionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NotificationHubsManagementClientPrivateEndpointConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "NotificationHubsManagementClientPrivateEndpointConnections") + public interface PrivateEndpointConnectionsService { + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @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) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionResourceInner parameters, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionResourceInner parameters, Context context); + + @Headers({ "Accept: application/json;q=0.9", "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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, 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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @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) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("subResourceName") String subResourceName, @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) + Response getGroupIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @PathParam("subResourceName") String subResourceName, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @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) + Response listGroupIdsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("namespaceName") String namespaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGroupIdsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listGroupIdsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, 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 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, + 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, privateEndpointConnectionName, 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionResourceInner get(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName) { + return getWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, Context.NONE) + .getValue(); + } + + /** + * 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, + contentType, accept, parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) + private Response updateWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, + contentType, accept, parameters, Context.NONE); + } + + /** + * 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, PrivateEndpointConnectionResourceInner parameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, + contentType, accept, parameters, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + Response response + = updateWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters); + return this.client.getLroResult( + response, PrivateEndpointConnectionResourceInner.class, PrivateEndpointConnectionResourceInner.class, + Context.NONE); + } + + /** + * 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) { + Response response + = updateWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, context); + return this.client.getLroResult( + response, 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 beginUpdate(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters) + .getFinalResult(); + } + + /** + * 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 beginUpdate(resourceGroupName, namespaceName, privateEndpointConnectionName, parameters, context) + .getFinalResult(); + } + + /** + * 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) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, + Context.NONE); + } + + /** + * 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String namespaceName, + String privateEndpointConnectionName, Context context) { + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, privateEndpointConnectionName, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) { + Response response + = deleteWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * 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) { + Response response + = deleteWithResponse(resourceGroupName, namespaceName, privateEndpointConnectionName, context); + return this.client.getLroResult(response, 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 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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) { + beginDelete(resourceGroupName, namespaceName, privateEndpointConnectionName).getFinalResult(); + } + + /** + * 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) { + beginDelete(resourceGroupName, namespaceName, privateEndpointConnectionName, context).getFinalResult(); + } + + /** + * 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 a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, 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())); + } + + /** + * 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 a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String namespaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * 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 a PrivateEndpointConnectionResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), 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. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a PrivateEndpointConnectionResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String namespaceName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, namespaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), 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 a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, namespaceName), + nextLink -> listNextSinglePage(nextLink)); + } + + /** + * 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 a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String namespaceName, + Context context) { + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, namespaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * 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) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getGroupId(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, subResourceName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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())); + } + + /** + * 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) { + final String accept = "application/json"; + return service.getGroupIdSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, subResourceName, accept, context); + } + + /** + * 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(); + } + + /** + * 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 a PrivateLinkResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGroupIdsSinglePageAsync(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGroupIds(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, 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())); + } + + /** + * 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 a PrivateLinkResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGroupIdsAsync(String resourceGroupName, String namespaceName) { + return new PagedFlux<>(() -> listGroupIdsSinglePageAsync(resourceGroupName, namespaceName), + nextLink -> listGroupIdsNextSinglePageAsync(nextLink)); + } + + /** + * 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 a PrivateLinkResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listGroupIdsSinglePage(String resourceGroupName, + String namespaceName) { + final String accept = "application/json"; + Response res + = service.listGroupIdsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 a PrivateLinkResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listGroupIdsSinglePage(String resourceGroupName, + String namespaceName, Context context) { + final String accept = "application/json"; + Response res + = service.listGroupIdsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, namespaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * 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 a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGroupIds(String resourceGroupName, String namespaceName) { + return new PagedIterable<>(() -> listGroupIdsSinglePage(resourceGroupName, namespaceName), + nextLink -> listGroupIdsNextSinglePage(nextLink)); + } + + /** + * 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 a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGroupIds(String resourceGroupName, String namespaceName, + Context context) { + return new PagedIterable<>(() -> listGroupIdsSinglePage(resourceGroupName, namespaceName, context), + nextLink -> listGroupIdsNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a PrivateEndpointConnectionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a PrivateEndpointConnectionResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a PrivateEndpointConnectionResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a PrivateLinkResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGroupIdsNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGroupIdsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a PrivateLinkResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listGroupIdsNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listGroupIdsNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown 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 a PrivateLinkResource list operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listGroupIdsNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listGroupIdsNextSync(nextLink, this.client.getEndpoint(), accept, context); + return 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/PrivateEndpointConnectionsImpl.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..15761128a708 --- /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) TypeSpec 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 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 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 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..5e2c7086b770 --- /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) TypeSpec 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 da8404016e1f..f174aa4d2479 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceManagerUtils.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceManagerUtils.java index d5b88618cdef..f3617c6d930b 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceManagerUtils.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.implementation; 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 2bd747f22082..d58afb9c70f4 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 @@ -1,20 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.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.SharedAccessAuthorizationRuleResource; -import com.azure.resourcemanager.notificationhubs.models.Sku; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -50,8 +49,8 @@ public Map tags() { } } - public Sku sku() { - return this.innerModel().sku(); + public SystemData systemData() { + return this.innerModel().systemData(); } public List rights() { @@ -75,20 +74,20 @@ public String keyName() { return this.innerModel().keyName(); } - public String claimType() { - return this.innerModel().claimType(); + public OffsetDateTime modifiedTime() { + return this.innerModel().modifiedTime(); } - public String claimValue() { - return this.innerModel().claimValue(); + public OffsetDateTime createdTime() { + return this.innerModel().createdTime(); } - public String modifiedTime() { - return this.innerModel().modifiedTime(); + public String claimType() { + return this.innerModel().claimType(); } - public String createdTime() { - return this.innerModel().createdTime(); + public String claimValue() { + return this.innerModel().claimValue(); } public Integer revision() { @@ -121,10 +120,6 @@ private com.azure.resourcemanager.notificationhubs.NotificationHubsManager manag private String authorizationRuleName; - private SharedAccessAuthorizationRuleCreateOrUpdateParameters createParameters; - - private SharedAccessAuthorizationRuleCreateOrUpdateParameters updateParameters; - public SharedAccessAuthorizationRuleResourceImpl withExistingNamespace(String resourceGroupName, String namespaceName) { this.resourceGroupName = resourceGroupName; @@ -136,7 +131,7 @@ public SharedAccessAuthorizationRuleResource create() { this.innerObject = serviceManager.serviceClient() .getNamespaces() .createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, - createParameters, Context.NONE) + this.innerModel(), Context.NONE) .getValue(); return this; } @@ -145,7 +140,7 @@ public SharedAccessAuthorizationRuleResource create(Context context) { this.innerObject = serviceManager.serviceClient() .getNamespaces() .createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, - createParameters, context) + this.innerModel(), context) .getValue(); return this; } @@ -155,11 +150,9 @@ public SharedAccessAuthorizationRuleResource create(Context context) { this.innerObject = new SharedAccessAuthorizationRuleResourceInner(); this.serviceManager = serviceManager; this.authorizationRuleName = name; - this.createParameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); } public SharedAccessAuthorizationRuleResourceImpl update() { - this.updateParameters = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); return this; } @@ -167,7 +160,7 @@ public SharedAccessAuthorizationRuleResource apply() { this.innerObject = serviceManager.serviceClient() .getNamespaces() .createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, - updateParameters, Context.NONE) + this.innerModel(), Context.NONE) .getValue(); return this; } @@ -176,7 +169,7 @@ public SharedAccessAuthorizationRuleResource apply(Context context) { this.innerObject = serviceManager.serviceClient() .getNamespaces() .createOrUpdateAuthorizationRuleWithResponse(resourceGroupName, namespaceName, authorizationRuleName, - updateParameters, context) + this.innerModel(), context) .getValue(); return this; } @@ -187,7 +180,7 @@ public SharedAccessAuthorizationRuleResource apply(Context context) { this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); this.namespaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "namespaces"); - this.authorizationRuleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "AuthorizationRules"); + this.authorizationRuleName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "authorizationRules"); } public SharedAccessAuthorizationRuleResource refresh() { @@ -215,28 +208,43 @@ public ResourceListKeys listKeys() { return serviceManager.namespaces().listKeys(resourceGroupName, namespaceName, authorizationRuleName); } - public Response regenerateKeysWithResponse(PolicykeyResource parameters, Context context) { + public Response regenerateKeysWithResponse(PolicyKeyResource parameters, Context context) { return serviceManager.namespaces() .regenerateKeysWithResponse(resourceGroupName, namespaceName, authorizationRuleName, parameters, context); } - public ResourceListKeys regenerateKeys(PolicykeyResource parameters) { + public ResourceListKeys regenerateKeys(PolicyKeyResource parameters) { return serviceManager.namespaces() .regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName, parameters); } - public SharedAccessAuthorizationRuleResourceImpl - withProperties(SharedAccessAuthorizationRuleProperties properties) { - if (isInCreateMode()) { - this.createParameters.withProperties(properties); - return this; - } else { - this.updateParameters.withProperties(properties); - return this; - } + public SharedAccessAuthorizationRuleResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SharedAccessAuthorizationRuleResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SharedAccessAuthorizationRuleResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; } - private boolean isInCreateMode() { - return this.innerModel().id() == null; + public SharedAccessAuthorizationRuleResourceImpl withRights(List rights) { + this.innerModel().withRights(rights); + return this; + } + + public SharedAccessAuthorizationRuleResourceImpl withPrimaryKey(String primaryKey) { + this.innerModel().withPrimaryKey(primaryKey); + return this; + } + + public SharedAccessAuthorizationRuleResourceImpl withSecondaryKey(String secondaryKey) { + this.innerModel().withSecondaryKey(secondaryKey); + return this; } } 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/implementation/models/NamespaceListResult.java similarity index 60% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceListResult.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/NamespaceListResult.java index 9f008d707dda..0f43a65575ea 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/implementation/models/NamespaceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.notificationhubs.models; +package com.azure.resourcemanager.notificationhubs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * The response of the List Namespace operation. + * Paged collection of NamespaceResource items. */ -@Fluent +@Immutable public final class NamespaceListResult implements JsonSerializable { /* - * Result of the List Namespace operation. + * The NamespaceResource items on this page */ private List value; /* - * Link to the next set of results. Not empty if Value contains incomplete list of Namespaces + * The link to the next page of items */ private String nextLink; /** * Creates an instance of NamespaceListResult class. */ - public NamespaceListResult() { + private NamespaceListResult() { } /** - * Get the value property: Result of the List Namespace operation. + * Get the value property: The NamespaceResource items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: Result of the List Namespace operation. - * - * @param value the value value to set. - * @return the NamespaceListResult object itself. - */ - public NamespaceListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * Namespaces. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,36 +52,12 @@ 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() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -104,6 +68,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of NamespaceListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the NamespaceListResult. */ public static NamespaceListResult fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/NotificationHubListResult.java similarity index 60% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubListResult.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/NotificationHubListResult.java index 94f96b18e4a4..d7985e1ad830 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/implementation/models/NotificationHubListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.notificationhubs.models; +package com.azure.resourcemanager.notificationhubs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +14,28 @@ import java.util.List; /** - * The response of the List NotificationHub operation. + * Paged collection of NotificationHubResource items. */ -@Fluent +@Immutable public final class NotificationHubListResult implements JsonSerializable { /* - * Result of the List NotificationHub operation. + * The NotificationHubResource items on this page */ private List value; /* - * Link to the next set of results. Not empty if Value contains incomplete list of NotificationHub + * The link to the next page of items */ private String nextLink; /** * Creates an instance of NotificationHubListResult class. */ - public NotificationHubListResult() { + private NotificationHubListResult() { } /** - * Get the value property: Result of the List NotificationHub operation. + * Get the value property: The NotificationHubResource items on this page. * * @return the value value. */ @@ -44,19 +44,7 @@ public List value() { } /** - * Set the value property: Result of the List NotificationHub operation. - * - * @param value the value value to set. - * @return the NotificationHubListResult object itself. - */ - public NotificationHubListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * NotificationHub. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -64,36 +52,12 @@ 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() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -104,6 +68,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of NotificationHubListResult if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the NotificationHubListResult. */ public static NotificationHubListResult fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/OperationListResult.java similarity index 71% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationListResult.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/OperationListResult.java index 70004b1ea834..1aeaed85a5bd 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/implementation/models/OperationListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.notificationhubs.models; +package com.azure.resourcemanager.notificationhubs.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -14,30 +14,28 @@ 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. + * Paged collection of Operation items. */ @Immutable public final class OperationListResult implements JsonSerializable { /* - * List of NotificationHubs operations supported by the Microsoft.NotificationHubs resource provider. + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results if there are any. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of NotificationHubs operations supported by the Microsoft.NotificationHubs resource - * provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -46,7 +44,7 @@ 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: The link to the next page of items. * * @return the nextLink value. */ @@ -54,23 +52,13 @@ 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()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -80,6 +68,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateEndpointConnectionResourceListResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateEndpointConnectionResourceListResult.java new file mode 100644 index 000000000000..b74e77283642 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateEndpointConnectionResourceListResult.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PrivateEndpointConnectionResource list operation. + */ +@Immutable +public final class PrivateEndpointConnectionResourceListResult + implements JsonSerializable { + /* + * The PrivateEndpointConnectionResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PrivateEndpointConnectionResourceListResult class. + */ + private PrivateEndpointConnectionResourceListResult() { + } + + /** + * Get the value property: The PrivateEndpointConnectionResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionResourceListResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionResourceListResult. + */ + public static PrivateEndpointConnectionResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionResourceListResult deserializedPrivateEndpointConnectionResourceListResult + = new PrivateEndpointConnectionResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateEndpointConnectionResourceInner.fromJson(reader1)); + deserializedPrivateEndpointConnectionResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionResourceListResult; + }); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateLinkResourceListResult.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateLinkResourceListResult.java new file mode 100644 index 000000000000..f6145196be54 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateLinkResourceListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PrivateLinkResource list operation. + */ +@Immutable +public final class PrivateLinkResourceListResult implements JsonSerializable { + /* + * The PrivateLinkResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PrivateLinkResourceListResult class. + */ + private PrivateLinkResourceListResult() { + } + + /** + * Get the value property: The PrivateLinkResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PrivateLinkResourceListResult. + */ + public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceListResult deserializedPrivateLinkResourceListResult + = new PrivateLinkResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); + deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceListResult; + }); + } +} 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/implementation/models/SharedAccessAuthorizationRuleListResult.java similarity index 61% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleListResult.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/SharedAccessAuthorizationRuleListResult.java index 0e225443ba9f..0a9f62ec5ed4 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/implementation/models/SharedAccessAuthorizationRuleListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.notificationhubs.models; +package com.azure.resourcemanager.notificationhubs.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,29 +14,29 @@ import java.util.List; /** - * The response of the List Namespace operation. + * Paged collection of SharedAccessAuthorizationRuleResource items. */ -@Fluent +@Immutable public final class SharedAccessAuthorizationRuleListResult implements JsonSerializable { /* - * Result of the List AuthorizationRules operation. + * The SharedAccessAuthorizationRuleResource items on this page */ private List value; /* - * Link to the next set of results. Not empty if Value contains incomplete list of AuthorizationRules + * The link to the next page of items */ private String nextLink; /** * Creates an instance of SharedAccessAuthorizationRuleListResult class. */ - public SharedAccessAuthorizationRuleListResult() { + private SharedAccessAuthorizationRuleListResult() { } /** - * Get the value property: Result of the List AuthorizationRules operation. + * Get the value property: The SharedAccessAuthorizationRuleResource items on this page. * * @return the value value. */ @@ -45,19 +45,7 @@ public List value() { } /** - * Set the value property: Result of the List AuthorizationRules operation. - * - * @param value the value value to set. - * @return the SharedAccessAuthorizationRuleListResult object itself. - */ - public SharedAccessAuthorizationRuleListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: Link to the next set of results. Not empty if Value contains incomplete list of - * AuthorizationRules. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -65,36 +53,12 @@ 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() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -105,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of SharedAccessAuthorizationRuleListResult if the JsonReader was pointing to an instance of * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the SharedAccessAuthorizationRuleListResult. */ public static SharedAccessAuthorizationRuleListResult fromJson(JsonReader jsonReader) throws IOException { 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 ea453fc30156..4366bb9a3d32 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the implementations for NotificationHubsManagementClient. - * Azure NotificationHub client. + * 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 0de2c6e40eef..37066cea2abe 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 @@ -1,61 +1,56 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** * Defines values for AccessRights. */ -public enum AccessRights { +public final class AccessRights extends ExpandableStringEnum { /** - * Enum value Manage. + * Static value Manage for AccessRights. */ - MANAGE("Manage"), + public static final AccessRights MANAGE = fromString("Manage"); /** - * Enum value Send. + * Static value Send for AccessRights. */ - SEND("Send"), + public static final AccessRights SEND = fromString("Send"); /** - * Enum value Listen. + * Static value Listen for AccessRights. */ - LISTEN("Listen"); + public static final AccessRights LISTEN = fromString("Listen"); /** - * The actual serialized value for a AccessRights instance. + * Creates a new instance of AccessRights value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - AccessRights(String value) { - this.value = value; + @Deprecated + public AccessRights() { } /** - * Parses a serialized value to a AccessRights instance. + * Creates or finds a AccessRights from its string representation. * - * @param value the serialized value to parse. - * @return the parsed AccessRights object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding AccessRights. */ - public static AccessRights fromString(String value) { - if (value == null) { - return null; - } - AccessRights[] items = AccessRights.values(); - for (AccessRights item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + public static AccessRights fromString(String name) { + return fromString(name, AccessRights.class); } /** - * {@inheritDoc} + * Gets known AccessRights values. + * + * @return known AccessRights values. */ - @Override - public String toString() { - return this.value; + 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 c4a745bce903..09af8307e74e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -18,9 +18,9 @@ @Fluent public final class AdmCredential implements JsonSerializable { /* - * Properties of NotificationHub AdmCredential. + * Description of a NotificationHub AdmCredential. */ - private AdmCredentialProperties innerProperties; + private AdmCredentialProperties innerProperties = new AdmCredentialProperties(); /** * Creates an instance of AdmCredential class. @@ -29,7 +29,7 @@ public AdmCredential() { } /** - * Get the innerProperties property: Properties of NotificationHub AdmCredential. + * Get the innerProperties property: Description of a NotificationHub AdmCredential. * * @return the innerProperties value. */ @@ -38,7 +38,7 @@ private AdmCredentialProperties innerProperties() { } /** - * Get the clientId property: The client identifier. + * Get the clientId property: Gets or sets the client identifier. * * @return the clientId value. */ @@ -47,7 +47,7 @@ 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 AdmCredential object itself. @@ -61,7 +61,7 @@ public AdmCredential 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. */ @@ -70,7 +70,7 @@ 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 AdmCredential object itself. @@ -84,7 +84,7 @@ public AdmCredential 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. */ @@ -93,7 +93,7 @@ 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 AdmCredential object itself. @@ -106,17 +106,6 @@ public AdmCredential withAuthTokenUrl(String authTokenUrl) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -133,6 +122,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AdmCredential if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the AdmCredential. */ public static AdmCredential fromJson(JsonReader jsonReader) throws IOException { 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 0fad4fd6c840..c92d84645f03 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -18,9 +18,9 @@ @Fluent public final class ApnsCredential implements JsonSerializable { /* - * Properties of NotificationHub ApnsCredential. + * Description of a NotificationHub ApnsCredential. */ - private ApnsCredentialProperties innerProperties; + private ApnsCredentialProperties innerProperties = new ApnsCredentialProperties(); /** * Creates an instance of ApnsCredential class. @@ -29,7 +29,7 @@ public ApnsCredential() { } /** - * Get the innerProperties property: Properties of NotificationHub ApnsCredential. + * Get the innerProperties property: Description of a NotificationHub ApnsCredential. * * @return the innerProperties value. */ @@ -38,7 +38,7 @@ private ApnsCredentialProperties innerProperties() { } /** - * Get the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode. + * Get the apnsCertificate property: Gets or sets the APNS certificate. * * @return the apnsCertificate value. */ @@ -47,7 +47,7 @@ public String apnsCertificate() { } /** - * Set the apnsCertificate property: The APNS certificate. Specify if using Certificate Authentication Mode. + * Set the apnsCertificate property: Gets or sets the APNS certificate. * * @param apnsCertificate the apnsCertificate value to set. * @return the ApnsCredential object itself. @@ -61,7 +61,7 @@ public ApnsCredential withApnsCertificate(String apnsCertificate) { } /** - * Get the certificateKey property: The APNS certificate password if it exists. + * Get the certificateKey property: Gets or sets the certificate key. * * @return the certificateKey value. */ @@ -70,7 +70,7 @@ public String certificateKey() { } /** - * Set the certificateKey property: The APNS certificate password if it exists. + * Set the certificateKey property: Gets or sets the certificate key. * * @param certificateKey the certificateKey value to set. * @return the ApnsCredential object itself. @@ -84,11 +84,7 @@ public ApnsCredential withCertificateKey(String certificateKey) { } /** - * 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'. + * Get the endpoint property: Gets or sets the endpoint of this credential. * * @return the endpoint value. */ @@ -97,11 +93,7 @@ public String 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'. + * Set the endpoint property: Gets or sets the endpoint of this credential. * * @param endpoint the endpoint value to set. * @return the ApnsCredential object itself. @@ -115,7 +107,7 @@ public ApnsCredential withEndpoint(String endpoint) { } /** - * Get the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. + * Get the thumbprint property: Gets or sets the APNS certificate Thumbprint. * * @return the thumbprint value. */ @@ -124,7 +116,7 @@ public String thumbprint() { } /** - * Set the thumbprint property: The APNS certificate thumbprint. Specify if using Certificate Authentication Mode. + * Set the thumbprint property: Gets or sets the APNS certificate Thumbprint. * * @param thumbprint the thumbprint value to set. * @return the ApnsCredential object itself. @@ -138,8 +130,8 @@ public ApnsCredential withThumbprint(String thumbprint) { } /** - * Get the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if - * using Token Authentication Mode. + * Get the keyId property: Gets or sets a 10-character key identifier (kid) key, obtained from + * your developer account. * * @return the keyId value. */ @@ -148,8 +140,8 @@ public String keyId() { } /** - * Set the keyId property: A 10-character key identifier (kid) key, obtained from your developer account. Specify if - * using Token Authentication Mode. + * 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 ApnsCredential object itself. @@ -163,7 +155,7 @@ public ApnsCredential withKeyId(String keyId) { } /** - * Get the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode. + * Get the appName property: Gets or sets the name of the application. * * @return the appName value. */ @@ -172,7 +164,7 @@ public String appName() { } /** - * Set the appName property: The name of the application or BundleId. Specify if using Token Authentication Mode. + * Set the appName property: Gets or sets the name of the application. * * @param appName the appName value to set. * @return the ApnsCredential object itself. @@ -186,8 +178,8 @@ public ApnsCredential withAppName(String appName) { } /** - * 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. + * 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. */ @@ -196,8 +188,8 @@ public String 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. + * 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 ApnsCredential object itself. @@ -211,8 +203,8 @@ public ApnsCredential withAppId(String appId) { } /** - * Get the token property: Provider Authentication Token, obtained through your developer account. Specify if using - * Token Authentication Mode. + * Get the token property: Gets or sets provider Authentication Token, obtained through your + * developer account. * * @return the token value. */ @@ -221,8 +213,8 @@ public String token() { } /** - * Set the token property: Provider Authentication Token, obtained through your developer account. Specify if using - * Token Authentication Mode. + * Set the token property: Gets or sets provider Authentication Token, obtained through your + * developer account. * * @param token the token value to set. * @return the ApnsCredential object itself. @@ -235,17 +227,6 @@ public ApnsCredential withToken(String token) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -262,6 +243,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ApnsCredential if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ApnsCredential. */ public static ApnsCredential fromJson(JsonReader jsonReader) throws IOException { 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..afc1401762ee --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/Availability.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents metric availability (part of RP operation descriptions). + */ +@Immutable +public final class Availability implements JsonSerializable { + /* + * Time grain of the availability. + */ + private String timeGrain; + + /* + * Duration of the availability blob. + */ + private String blobDuration; + + /** + * Creates an instance of Availability class. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Availability from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Availability if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the Availability. + */ + public static Availability fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Availability deserializedAvailability = new Availability(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("timeGrain".equals(fieldName)) { + deserializedAvailability.timeGrain = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedAvailability.blobDuration = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAvailability; + }); + } +} 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 6f09113734ed..ecfc4efbcebd 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -18,9 +18,9 @@ @Fluent public final class BaiduCredential implements JsonSerializable { /* - * Properties of NotificationHub BaiduCredential. + * Description of a NotificationHub BaiduCredential. */ - private BaiduCredentialProperties innerProperties; + private BaiduCredentialProperties innerProperties = new BaiduCredentialProperties(); /** * Creates an instance of BaiduCredential class. @@ -29,7 +29,7 @@ public BaiduCredential() { } /** - * Get the innerProperties property: Properties of NotificationHub BaiduCredential. + * Get the innerProperties property: Description of a NotificationHub BaiduCredential. * * @return the innerProperties value. */ @@ -38,7 +38,7 @@ private BaiduCredentialProperties innerProperties() { } /** - * Get the baiduApiKey property: Baidu Api Key. + * Get the baiduApiKey property: Gets or sets baidu Api Key. * * @return the baiduApiKey value. */ @@ -47,7 +47,7 @@ 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 BaiduCredential object itself. @@ -61,7 +61,7 @@ public BaiduCredential withBaiduApiKey(String baiduApiKey) { } /** - * Get the baiduEndPoint property: Baidu Endpoint. + * Get the baiduEndPoint property: Gets or sets baidu Endpoint. * * @return the baiduEndPoint value. */ @@ -70,7 +70,7 @@ 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 BaiduCredential object itself. @@ -84,7 +84,7 @@ public BaiduCredential withBaiduEndPoint(String baiduEndPoint) { } /** - * Get the baiduSecretKey property: Baidu Secret Key. + * Get the baiduSecretKey property: Gets or sets baidu Secret Key. * * @return the baiduSecretKey value. */ @@ -93,7 +93,7 @@ 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 BaiduCredential object itself. @@ -106,17 +106,6 @@ public BaiduCredential withBaiduSecretKey(String baiduSecretKey) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -133,6 +122,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of BaiduCredential if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the BaiduCredential. */ public static BaiduCredential fromJson(JsonReader jsonReader) throws IOException { 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..7d84f36c1701 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredential.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.fluent.models.BrowserCredentialProperties; +import java.io.IOException; + +/** + * Description of a NotificationHub BrowserCredential. + */ +@Fluent +public final class BrowserCredential implements JsonSerializable { + /* + * Description of a NotificationHub BrowserCredential. + */ + private BrowserCredentialProperties innerProperties = new BrowserCredentialProperties(); + + /** + * Creates an instance of BrowserCredential class. + */ + public BrowserCredential() { + } + + /** + * Get the innerProperties property: Description of a NotificationHub BrowserCredential. + * + * @return the innerProperties value. + */ + private BrowserCredentialProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the subject property: Gets or sets web push subject. + * + * @return the subject value. + */ + public String subject() { + return this.innerProperties() == null ? null : this.innerProperties().subject(); + } + + /** + * Set the subject property: Gets or sets web push subject. + * + * @param subject the subject value to set. + * @return the BrowserCredential object itself. + */ + public BrowserCredential withSubject(String subject) { + if (this.innerProperties() == null) { + this.innerProperties = new BrowserCredentialProperties(); + } + this.innerProperties().withSubject(subject); + return this; + } + + /** + * Get the vapidPrivateKey property: Gets or sets VAPID private key. + * + * @return the vapidPrivateKey value. + */ + public String vapidPrivateKey() { + return this.innerProperties() == null ? null : this.innerProperties().vapidPrivateKey(); + } + + /** + * Set the vapidPrivateKey property: Gets or sets VAPID private key. + * + * @param vapidPrivateKey the vapidPrivateKey value to set. + * @return the BrowserCredential object itself. + */ + public BrowserCredential withVapidPrivateKey(String vapidPrivateKey) { + if (this.innerProperties() == null) { + this.innerProperties = new BrowserCredentialProperties(); + } + this.innerProperties().withVapidPrivateKey(vapidPrivateKey); + return this; + } + + /** + * Get the vapidPublicKey property: Gets or sets VAPID public key. + * + * @return the vapidPublicKey value. + */ + public String vapidPublicKey() { + return this.innerProperties() == null ? null : this.innerProperties().vapidPublicKey(); + } + + /** + * Set the vapidPublicKey property: Gets or sets VAPID public key. + * + * @param vapidPublicKey the vapidPublicKey value to set. + * @return the BrowserCredential object itself. + */ + public BrowserCredential withVapidPublicKey(String vapidPublicKey) { + if (this.innerProperties() == null) { + this.innerProperties = new BrowserCredentialProperties(); + } + this.innerProperties().withVapidPublicKey(vapidPublicKey); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BrowserCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BrowserCredential if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BrowserCredential. + */ + public static BrowserCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BrowserCredential deserializedBrowserCredential = new BrowserCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedBrowserCredential.innerProperties = BrowserCredentialProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBrowserCredential; + }); + } +} 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 0d4035b2604c..ba9dcb221073 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,44 +13,45 @@ 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 implements JsonSerializable { /* - * Resource Id + * Gets resource Id */ private String id; /* - * Resource name + * Gets or sets resource name */ private String name; /* - * Resource type + * Gets resource type */ private String type; /* - * Resource location + * Gets or sets resource location */ private String location; /* - * Resource tags + * Gets or sets resource tags */ private Map tags; /* - * The sku of the created namespace + * Not used and deprecated since API version 2023-01-01-preview */ - private Sku sku; + private Boolean isAvailiable; /* - * True if the name is available and can be used to create new Namespace/NotificationHub. Otherwise false. + * The Sku description for a namespace */ - private Boolean isAvailiable; + private Sku sku; /** * Creates an instance of CheckAvailabilityParameters class. @@ -60,7 +60,7 @@ public CheckAvailabilityParameters() { } /** - * Get the id property: Resource Id. + * Get the id property: Gets resource Id. * * @return the id value. */ @@ -69,7 +69,7 @@ public String id() { } /** - * Get the name property: Resource name. + * Get the name property: Gets or sets resource name. * * @return the name value. */ @@ -78,7 +78,7 @@ 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. @@ -89,7 +89,7 @@ public CheckAvailabilityParameters withName(String name) { } /** - * Get the type property: Resource type. + * Get the type property: Gets resource type. * * @return the type value. */ @@ -98,7 +98,7 @@ public String type() { } /** - * Get the location property: Resource location. + * Get the location property: Gets or sets resource location. * * @return the location value. */ @@ -107,7 +107,7 @@ 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. @@ -118,7 +118,7 @@ public CheckAvailabilityParameters withLocation(String location) { } /** - * Get the tags property: Resource tags. + * Get the tags property: Gets or sets resource tags. * * @return the tags value. */ @@ -127,7 +127,7 @@ 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. @@ -138,65 +138,45 @@ public CheckAvailabilityParameters withTags(Map tags) { } /** - * Get the sku property: The sku of the created namespace. + * Get the isAvailiable property: Not used and deprecated since API version 2023-01-01-preview. * - * @return the sku value. + * @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. + * Set the isAvailiable property: Not used and deprecated since API version 2023-01-01-preview. * - * @param sku the sku value to set. + * @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. + * Get the sku property: The Sku description for a namespace. * - * @return the isAvailiable value. + * @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. + * Set the sku property: The Sku description for a namespace. * - * @param isAvailiable the isAvailiable value to set. + * @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.atError() - .log(new IllegalArgumentException( - "Missing required property name in model CheckAvailabilityParameters")); - } - if (sku() != null) { - sku().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CheckAvailabilityParameters.class); - /** * {@inheritDoc} */ @@ -206,8 +186,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("location", this.location); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("sku", this.sku); jsonWriter.writeBooleanField("isAvailiable", this.isAvailiable); + jsonWriter.writeJsonField("sku", this.sku); return jsonWriter.writeEndObject(); } @@ -238,10 +218,10 @@ public static CheckAvailabilityParameters fromJson(JsonReader jsonReader) throws } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedCheckAvailabilityParameters.tags = tags; - } else if ("sku".equals(fieldName)) { - deserializedCheckAvailabilityParameters.sku = Sku.fromJson(reader); } else if ("isAvailiable".equals(fieldName)) { deserializedCheckAvailabilityParameters.isAvailiable = reader.getNullable(JsonReader::getBoolean); + } else if ("sku".equals(fieldName)) { + deserializedCheckAvailabilityParameters.sku = Sku.fromJson(reader); } else { reader.skipChildren(); } 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 35ae18e54b7f..ac447a19482c 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner; import java.util.Map; @@ -33,33 +34,40 @@ public interface CheckAvailabilityResult { 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. + * Gets the sku property: The Sku description for a namespace. * - * @return the isAvailiable value. + * @return the sku value. */ - Boolean isAvailiable(); + Sku sku(); /** - * Gets the sku property: The sku of the created namespace. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the sku value. + * @return the systemData value. */ - Sku sku(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner object. 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 7a70d1426791..f878168c9c9b 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 @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner; +import java.util.List; import java.util.Map; /** @@ -33,46 +35,46 @@ public interface DebugSendResponse { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * 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. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the sku value. + * @return the systemData value. */ - Sku sku(); + SystemData systemData(); /** - * Gets the success property: successful send. + * Gets the success property: Gets or sets successful send. * * @return the success value. */ - Float success(); + Long success(); /** - * Gets the failure property: send failure. + * Gets the failure property: Gets or sets send failure. * * @return the failure value. */ - Float failure(); + Long failure(); /** - * Gets the results property: actual failure description. + * Gets the results property: Gets or sets actual failure description. * * @return the results value. */ - Object results(); + List results(); /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner object. 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..ff532735a22d --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1Credential.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.fluent.models.FcmV1CredentialProperties; +import java.io.IOException; + +/** + * Description of a NotificationHub FcmV1Credential. + */ +@Fluent +public final class FcmV1Credential implements JsonSerializable { + /* + * Description of a NotificationHub FcmV1Credential. + */ + private FcmV1CredentialProperties innerProperties = new FcmV1CredentialProperties(); + + /** + * Creates an instance of FcmV1Credential class. + */ + public FcmV1Credential() { + } + + /** + * Get the innerProperties property: Description of a NotificationHub FcmV1Credential. + * + * @return the innerProperties value. + */ + private FcmV1CredentialProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the clientEmail property: Gets or sets client email. + * + * @return the clientEmail value. + */ + public String clientEmail() { + return this.innerProperties() == null ? null : this.innerProperties().clientEmail(); + } + + /** + * Set the clientEmail property: Gets or sets client email. + * + * @param clientEmail the clientEmail value to set. + * @return the FcmV1Credential object itself. + */ + public FcmV1Credential withClientEmail(String clientEmail) { + if (this.innerProperties() == null) { + this.innerProperties = new FcmV1CredentialProperties(); + } + this.innerProperties().withClientEmail(clientEmail); + return this; + } + + /** + * Get the privateKey property: Gets or sets private key. + * + * @return the privateKey value. + */ + public String privateKey() { + return this.innerProperties() == null ? null : this.innerProperties().privateKey(); + } + + /** + * Set the privateKey property: Gets or sets private key. + * + * @param privateKey the privateKey value to set. + * @return the FcmV1Credential object itself. + */ + public FcmV1Credential withPrivateKey(String privateKey) { + if (this.innerProperties() == null) { + this.innerProperties = new FcmV1CredentialProperties(); + } + this.innerProperties().withPrivateKey(privateKey); + return this; + } + + /** + * Get the projectId property: Gets or sets project id. + * + * @return the projectId value. + */ + public String projectId() { + return this.innerProperties() == null ? null : this.innerProperties().projectId(); + } + + /** + * Set the projectId property: Gets or sets project id. + * + * @param projectId the projectId value to set. + * @return the FcmV1Credential object itself. + */ + public FcmV1Credential withProjectId(String projectId) { + if (this.innerProperties() == null) { + this.innerProperties = new FcmV1CredentialProperties(); + } + this.innerProperties().withProjectId(projectId); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FcmV1Credential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FcmV1Credential if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FcmV1Credential. + */ + public static FcmV1Credential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FcmV1Credential deserializedFcmV1Credential = new FcmV1Credential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedFcmV1Credential.innerProperties = FcmV1CredentialProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFcmV1Credential; + }); + } +} 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 17c3ee8dbd5f..67b64d5d982f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -18,9 +18,9 @@ @Fluent public final class GcmCredential implements JsonSerializable { /* - * Properties of NotificationHub GcmCredential. + * Description of a NotificationHub GcmCredential. */ - private GcmCredentialProperties innerProperties; + private GcmCredentialProperties innerProperties = new GcmCredentialProperties(); /** * Creates an instance of GcmCredential class. @@ -29,7 +29,7 @@ public GcmCredential() { } /** - * Get the innerProperties property: Properties of NotificationHub GcmCredential. + * Get the innerProperties property: Description of a NotificationHub GcmCredential. * * @return the innerProperties value. */ @@ -38,7 +38,7 @@ private GcmCredentialProperties innerProperties() { } /** - * Get the gcmEndpoint property: The FCM legacy endpoint. Default value is 'https://fcm.googleapis.com/fcm/send'. + * Get the gcmEndpoint property: Gets or sets the GCM endpoint. * * @return the gcmEndpoint value. */ @@ -47,7 +47,7 @@ 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 GcmCredential object itself. @@ -61,7 +61,7 @@ public GcmCredential 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. */ @@ -70,7 +70,7 @@ 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 GcmCredential object itself. @@ -83,17 +83,6 @@ public GcmCredential withGoogleApiKey(String googleApiKey) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -110,6 +99,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of GcmCredential if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the GcmCredential. */ public static GcmCredential fromJson(JsonReader jsonReader) throws IOException { 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..28430b836cd8 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/IpRule.java @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A network authorization rule that filters traffic based on IP address. + */ +@Fluent +public final class IpRule implements JsonSerializable { + /* + * IP mask. + */ + private String ipMask; + + /* + * List of access rights. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipMask", this.ipMask); + jsonWriter.writeArrayField("rights", this.rights, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of IpRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of IpRule if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the IpRule. + */ + public static IpRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + IpRule deserializedIpRule = new IpRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipMask".equals(fieldName)) { + deserializedIpRule.ipMask = reader.getString(); + } else if ("rights".equals(fieldName)) { + List rights + = reader.readArray(reader1 -> AccessRights.fromString(reader1.getString())); + deserializedIpRule.rights = rights; + } else { + reader.skipChildren(); + } + } + + return deserializedIpRule; + }); + } +} 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..d6095c73e0c3 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/LogSpecification.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A single log category specification. + */ +@Immutable +public final class LogSpecification implements JsonSerializable { + /* + * Name of the log category. + */ + private String name; + + /* + * Display name of the log category. + */ + private String displayName; + + /* + * Duration of data written to a single blob. + */ + private String blobDuration; + + /* + * Category group for the log specification. + */ + private List categoryGroups; + + /** + * Creates an instance of LogSpecification class. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("categoryGroups", this.categoryGroups, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LogSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LogSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LogSpecification. + */ + public static LogSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LogSpecification deserializedLogSpecification = new LogSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedLogSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedLogSpecification.displayName = reader.getString(); + } else if ("blobDuration".equals(fieldName)) { + deserializedLogSpecification.blobDuration = reader.getString(); + } else if ("categoryGroups".equals(fieldName)) { + List categoryGroups = reader.readArray(reader1 -> reader1.getString()); + deserializedLogSpecification.categoryGroups = categoryGroups; + } else { + reader.skipChildren(); + } + } + + return deserializedLogSpecification; + }); + } +} 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..38ebbffba7db --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/MetricSpecification.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A metric specification. + */ +@Immutable +public final class MetricSpecification implements JsonSerializable { + /* + * Metric name / id. + */ + private String name; + + /* + * User-visible metric name. + */ + private String displayName; + + /* + * Description of the metric. + */ + private String displayDescription; + + /* + * Metric unit. + */ + private String unit; + + /* + * Type of the aggregation (Average, Minimum, Maximum, Total or Count). + */ + private String aggregationType; + + /* + * List of availabilities. + */ + private List availabilities; + + /* + * List of supported time grain types. + */ + private List supportedTimeGrainTypes; + + /* + * The matching regex pattern to be applied to the field pointed by the "metricsFilterPathSelector" flag in the ARM + * manifest. + */ + private String metricFilterPattern; + + /* + * Optional property. If set to true, then zero will be returned for time duration where no metric is emitted / + * published. + */ + private Boolean fillGapWithZero; + + /** + * Creates an instance of MetricSpecification class. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MetricSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MetricSpecification if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MetricSpecification. + */ + public static MetricSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MetricSpecification deserializedMetricSpecification = new MetricSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedMetricSpecification.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedMetricSpecification.displayName = reader.getString(); + } else if ("displayDescription".equals(fieldName)) { + deserializedMetricSpecification.displayDescription = reader.getString(); + } else if ("unit".equals(fieldName)) { + deserializedMetricSpecification.unit = reader.getString(); + } else if ("aggregationType".equals(fieldName)) { + deserializedMetricSpecification.aggregationType = reader.getString(); + } else if ("availabilities".equals(fieldName)) { + List availabilities = reader.readArray(reader1 -> Availability.fromJson(reader1)); + deserializedMetricSpecification.availabilities = availabilities; + } else if ("supportedTimeGrainTypes".equals(fieldName)) { + List supportedTimeGrainTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedMetricSpecification.supportedTimeGrainTypes = supportedTimeGrainTypes; + } else if ("metricFilterPattern".equals(fieldName)) { + deserializedMetricSpecification.metricFilterPattern = reader.getString(); + } else if ("fillGapWithZero".equals(fieldName)) { + deserializedMetricSpecification.fillGapWithZero = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMetricSpecification; + }); + } +} 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 588b1d6e80af..11305e2a371d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -18,9 +18,9 @@ @Fluent public final class MpnsCredential implements JsonSerializable { /* - * Properties of NotificationHub MpnsCredential. + * Description of a NotificationHub MpnsCredential. */ - private MpnsCredentialProperties innerProperties; + private MpnsCredentialProperties innerProperties = new MpnsCredentialProperties(); /** * Creates an instance of MpnsCredential class. @@ -29,7 +29,7 @@ public MpnsCredential() { } /** - * Get the innerProperties property: Properties of NotificationHub MpnsCredential. + * Get the innerProperties property: Description of a NotificationHub MpnsCredential. * * @return the innerProperties value. */ @@ -38,7 +38,7 @@ private MpnsCredentialProperties innerProperties() { } /** - * Get the mpnsCertificate property: The MPNS certificate. + * Get the mpnsCertificate property: Gets or sets the MPNS certificate. * * @return the mpnsCertificate value. */ @@ -47,7 +47,7 @@ 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 MpnsCredential object itself. @@ -61,7 +61,7 @@ public MpnsCredential 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. */ @@ -70,7 +70,7 @@ 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 MpnsCredential object itself. @@ -84,7 +84,7 @@ public MpnsCredential 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. */ @@ -93,7 +93,7 @@ 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 MpnsCredential object itself. @@ -106,17 +106,6 @@ public MpnsCredential withThumbprint(String thumbprint) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -133,6 +122,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of MpnsCredential if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the MpnsCredential. */ public static MpnsCredential fromJson(JsonReader jsonReader) throws IOException { 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 3fc629fbc2e4..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceCreateOrUpdateParameters.java +++ /dev/null @@ -1,512 +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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceProperties; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Map; - -/** - * Parameters supplied to the CreateOrUpdate Namespace operation. - */ -@Fluent -public final class NamespaceCreateOrUpdateParameters extends Resource { - /* - * Properties of the Namespace. - */ - private NamespaceProperties innerProperties; - - /* - * The sku of the created namespace - */ - private Sku sku; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of NamespaceCreateOrUpdateParameters class. - */ - public NamespaceCreateOrUpdateParameters() { - } - - /** - * 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; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@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(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NamespaceCreateOrUpdateParameters from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NamespaceCreateOrUpdateParameters if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the NamespaceCreateOrUpdateParameters. - */ - public static NamespaceCreateOrUpdateParameters fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NamespaceCreateOrUpdateParameters deserializedNamespaceCreateOrUpdateParameters - = new NamespaceCreateOrUpdateParameters(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedNamespaceCreateOrUpdateParameters.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedNamespaceCreateOrUpdateParameters.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedNamespaceCreateOrUpdateParameters.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedNamespaceCreateOrUpdateParameters.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedNamespaceCreateOrUpdateParameters.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedNamespaceCreateOrUpdateParameters.innerProperties - = NamespaceProperties.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedNamespaceCreateOrUpdateParameters.sku = Sku.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedNamespaceCreateOrUpdateParameters; - }); - } -} 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 1a4b75b1bae4..3f692c985e8c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -9,23 +9,29 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceProperties; import java.io.IOException; import java.util.Map; /** - * Parameters supplied to the Patch Namespace operation. + * Patch parameter for NamespaceResource. */ @Fluent public final class NamespacePatchParameters implements JsonSerializable { /* - * Resource tags + * The Sku description for a namespace */ - private Map tags; + private Sku sku; /* - * The sku of the created namespace + * Represents namespace properties. */ - private Sku sku; + private NamespaceProperties properties; + + /* + * Dictionary of + */ + private Map tags; /** * Creates an instance of NamespacePatchParameters class. @@ -34,54 +40,63 @@ public NamespacePatchParameters() { } /** - * Get the tags property: Resource tags. + * Get the sku property: The Sku description for a namespace. * - * @return the tags value. + * @return the sku value. */ - public Map tags() { - return this.tags; + public Sku sku() { + return this.sku; } /** - * Set the tags property: Resource tags. + * Set the sku property: The Sku description for a namespace. * - * @param tags the tags value to set. + * @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. + * Get the properties property: Represents namespace properties. * - * @return the sku value. + * @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. + * Set the properties property: Represents namespace properties. * - * @param sku the sku value to set. + * @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; } /** - * Validates the instance. + * Get the tags property: Dictionary of <string>. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the tags value. */ - public void validate() { - if (sku() != null) { - sku().validate(); - } + 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; } /** @@ -90,8 +105,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -110,11 +126,13 @@ public static NamespacePatchParameters fromJson(JsonReader jsonReader) throws IO String fieldName = reader.getFieldName(); reader.nextToken(); - if ("tags".equals(fieldName)) { + if ("sku".equals(fieldName)) { + deserializedNamespacePatchParameters.sku = Sku.fromJson(reader); + } else if ("properties".equals(fieldName)) { + deserializedNamespacePatchParameters.properties = NamespaceProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedNamespacePatchParameters.tags = tags; - } else if ("sku".equals(fieldName)) { - deserializedNamespacePatchParameters.sku = Sku.fromJson(reader); } else { reader.skipChildren(); } 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 c748d6859978..ff221da21301 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 @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.NamespaceProperties; import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner; +import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentials; import java.time.OffsetDateTime; +import java.util.List; import java.util.Map; /** @@ -50,113 +55,163 @@ public interface NamespaceResource { 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. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the namePropertiesName property: Name of the Notification Hubs namespace. This is immutable property, set + * automatically + * by the service when the namespace is created. * * @return the namePropertiesName value. */ String namePropertiesName(); /** - * Gets the provisioningState property: Provisioning state of the Namespace. + * Gets the provisioningState property: Defines values for OperationProvisioningState. * * @return the provisioningState value. */ - String provisioningState(); + OperationProvisioningState provisioningState(); /** - * 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. + * Gets the status property: Namespace status. * - * @return the region value. + * @return the status value. */ - String region(); + NamespaceStatus status(); /** - * Gets the metricId property: Identifier for Azure Insights metrics. + * Gets the enabled property: Gets or sets whether or not the namespace is currently enabled. * - * @return the metricId value. + * @return the enabled value. */ - String metricId(); + Boolean enabled(); /** - * Gets the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 - * = Suspended4 = Deleting. + * Gets the critical property: Gets or sets whether or not the namespace is set as Critical. * - * @return the status value. + * @return the critical value. + */ + Boolean critical(); + + /** + * Gets the subscriptionId property: Namespace subscription id. + * + * @return the subscriptionId value. */ - String status(); + String subscriptionId(); + + /** + * Gets 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. + */ + String region(); /** - * Gets the createdAt property: The time the namespace was created. + * Gets the metricId property: Azure Insights Metrics id. + * + * @return the metricId value. + */ + String metricId(); + + /** + * Gets the createdAt property: Time when the namespace was created. * * @return the createdAt value. */ OffsetDateTime createdAt(); /** - * Gets the updatedAt property: The time the namespace was updated. + * Gets the updatedAt property: Time when the namespace was updated. * * @return the updatedAt value. */ OffsetDateTime updatedAt(); /** - * Gets the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations. + * Gets the namespaceType property: Defines values for NamespaceType. * - * @return the serviceBusEndpoint value. + * @return the namespaceType value. */ - String serviceBusEndpoint(); + NamespaceType namespaceType(); /** - * Gets the subscriptionId property: The Id of the Azure subscription associated with the namespace. + * Gets the replicationRegion property: Allowed replication region. * - * @return the subscriptionId value. + * @return the replicationRegion value. */ - String subscriptionId(); + ReplicationRegion replicationRegion(); /** - * Gets the scaleUnit property: ScaleUnit where the namespace gets created. + * Gets the zoneRedundancy property: Namespace SKU name. * - * @return the scaleUnit value. + * @return the zoneRedundancy value. */ - String scaleUnit(); + ZoneRedundancyPreference zoneRedundancy(); /** - * Gets the enabled property: Whether or not the namespace is currently enabled. + * Gets the networkAcls property: A collection of network authorization rules. * - * @return the enabled value. + * @return the networkAcls value. */ - Boolean enabled(); + NetworkAcls networkAcls(); /** - * Gets the critical property: Whether or not the namespace is set as Critical. + * Gets the pnsCredentials property: Collection of Notification Hub or Notification Hub Namespace PNS credentials. * - * @return the critical value. + * @return the pnsCredentials value. */ - Boolean critical(); + PnsCredentials pnsCredentials(); + + /** + * Gets the serviceBusEndpoint property: Gets or sets endpoint you can use to perform NotificationHub + * operations. + * + * @return the serviceBusEndpoint value. + */ + String serviceBusEndpoint(); + + /** + * Gets the privateEndpointConnections property: Private Endpoint Connections for namespace. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the scaleUnit property: Gets or sets scaleUnit where the namespace gets created. + * + * @return the scaleUnit value. + */ + String scaleUnit(); /** - * Gets the dataCenter property: Data center for the namespace. + * Gets the dataCenter property: Deprecated. * * @return the dataCenter value. */ String dataCenter(); /** - * Gets the namespaceType property: The namespace type. + * Gets the publicNetworkAccess property: Type of public network access. * - * @return the namespaceType value. + * @return the publicNetworkAccess value. */ - NamespaceType namespaceType(); + PublicNetworkAccess publicNetworkAccess(); /** * Gets the name of the resource group. @@ -176,7 +231,7 @@ public interface NamespaceResource { * The entirety of the NamespaceResource definition. */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + DefinitionStages.WithResourceGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { } /** @@ -199,7 +254,7 @@ interface WithLocation { * @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. @@ -207,7 +262,7 @@ interface WithLocation { * @param location The geo-location where the resource lives. * @return the next definition stage. */ - WithResourceGroup withLocation(String location); + WithResourceGroup withRegion(String location); } /** @@ -217,22 +272,33 @@ 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. + */ + 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 withExistingResourceGroup(String resourceGroupName); + 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.WithProvisioningState, + DefinitionStages.WithStatus, DefinitionStages.WithNamespaceType, DefinitionStages.WithReplicationRegion, + DefinitionStages.WithZoneRedundancy, DefinitionStages.WithNetworkAcls, DefinitionStages.WithPnsCredentials, + DefinitionStages.WithScaleUnit, DefinitionStages.WithDataCenter, DefinitionStages.WithPublicNetworkAccess { /** * Executes the create request. * @@ -262,129 +328,96 @@ interface WithTags { 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.. + * Specifies the provisioningState property: Defines values for OperationProvisioningState.. * - * @param provisioningState Provisioning state of the Namespace. + * @param provisioningState Defines values for OperationProvisioningState. * @return the next definition stage. */ - WithCreate withProvisioningState(String provisioningState); + WithCreate withProvisioningState(OperationProvisioningState provisioningState); } /** - * The stage of the NamespaceResource definition allowing to specify region. + * The stage of the NamespaceResource definition allowing to specify status. */ - interface WithRegion { + interface WithStatus { /** - * 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. + * Specifies the status property: Namespace status.. * - * @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. + * @param status Namespace status. * @return the next definition stage. */ - WithCreate withRegion(String region); + WithCreate withStatus(NamespaceStatus status); } /** - * The stage of the NamespaceResource definition allowing to specify status. + * The stage of the NamespaceResource definition allowing to specify namespaceType. */ - interface WithStatus { + interface WithNamespaceType { /** - * Specifies the status property: Status of the namespace. It can be any of these values:1 = Created/Active2 - * = Creating3 = Suspended4 = Deleting. + * Specifies the namespaceType property: Defines values for NamespaceType.. * - * @param status Status of the namespace. It can be any of these values:1 = Created/Active2 = Creating3 = - * Suspended4 = Deleting. + * @param namespaceType Defines values for NamespaceType. * @return the next definition stage. */ - WithCreate withStatus(String status); + WithCreate withNamespaceType(NamespaceType namespaceType); } /** - * The stage of the NamespaceResource definition allowing to specify createdAt. + * The stage of the NamespaceResource definition allowing to specify replicationRegion. */ - interface WithCreatedAt { + interface WithReplicationRegion { /** - * Specifies the createdAt property: The time the namespace was created.. + * Specifies the replicationRegion property: Allowed replication region. * - * @param createdAt The time the namespace was created. + * @param replicationRegion Allowed replication region. * @return the next definition stage. */ - WithCreate withCreatedAt(OffsetDateTime createdAt); + WithCreate withReplicationRegion(ReplicationRegion replicationRegion); } /** - * The stage of the NamespaceResource definition allowing to specify updatedAt. + * The stage of the NamespaceResource definition allowing to specify zoneRedundancy. */ - interface WithUpdatedAt { + interface WithZoneRedundancy { /** - * Specifies the updatedAt property: The time the namespace was updated.. + * Specifies the zoneRedundancy property: Namespace SKU name.. * - * @param updatedAt The time the namespace was updated. + * @param zoneRedundancy Namespace SKU name. * @return the next definition stage. */ - WithCreate withUpdatedAt(OffsetDateTime updatedAt); + WithCreate withZoneRedundancy(ZoneRedundancyPreference zoneRedundancy); } /** - * The stage of the NamespaceResource definition allowing to specify serviceBusEndpoint. + * The stage of the NamespaceResource definition allowing to specify networkAcls. */ - interface WithServiceBusEndpoint { + interface WithNetworkAcls { /** - * Specifies the serviceBusEndpoint property: Endpoint you can use to perform NotificationHub operations.. + * Specifies the networkAcls property: A collection of network authorization rules.. * - * @param serviceBusEndpoint Endpoint you can use to perform NotificationHub operations. + * @param networkAcls A collection of network authorization rules. * @return the next definition stage. */ - WithCreate withServiceBusEndpoint(String serviceBusEndpoint); + WithCreate withNetworkAcls(NetworkAcls networkAcls); } /** - * The stage of the NamespaceResource definition allowing to specify subscriptionId. + * The stage of the NamespaceResource definition allowing to specify pnsCredentials. */ - interface WithSubscriptionId { + interface WithPnsCredentials { /** - * Specifies the subscriptionId property: The Id of the Azure subscription associated with the namespace.. + * Specifies the pnsCredentials property: Collection of Notification Hub or Notification Hub Namespace PNS + * credentials.. * - * @param subscriptionId The Id of the Azure subscription associated with the namespace. + * @param pnsCredentials Collection of Notification Hub or Notification Hub Namespace PNS credentials. * @return the next definition stage. */ - WithCreate withSubscriptionId(String subscriptionId); + WithCreate withPnsCredentials(PnsCredentials pnsCredentials); } /** @@ -392,64 +425,38 @@ interface WithSubscriptionId { */ interface WithScaleUnit { /** - * Specifies the scaleUnit property: ScaleUnit where the namespace gets created. + * Specifies the scaleUnit property: Gets or sets scaleUnit where the namespace gets created. * - * @param scaleUnit ScaleUnit where the namespace gets created. + * @param scaleUnit Gets or sets 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. + * Specifies the dataCenter property: Deprecated.. * - * @param dataCenter Data center for the namespace. + * @param dataCenter Deprecated. * @return the next definition stage. */ WithCreate withDataCenter(String dataCenter); } /** - * The stage of the NamespaceResource definition allowing to specify namespaceType. + * The stage of the NamespaceResource definition allowing to specify publicNetworkAccess. */ - interface WithNamespaceType { + interface WithPublicNetworkAccess { /** - * Specifies the namespaceType property: The namespace type.. + * Specifies the publicNetworkAccess property: Type of public network access.. * - * @param namespaceType The namespace type. + * @param publicNetworkAccess Type of public network access. * @return the next definition stage. */ - WithCreate withNamespaceType(NamespaceType namespaceType); + WithCreate withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess); } } @@ -463,7 +470,7 @@ interface WithNamespaceType { /** * The template for NamespaceResource update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithSku { + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithProperties { /** * Executes the update request. * @@ -489,9 +496,9 @@ interface UpdateStages { */ interface WithTags { /** - * Specifies the tags property: Resource tags. + * Specifies the tags property: Dictionary of <string>. * - * @param tags Resource tags. + * @param tags Dictionary of <string>. * @return the next definition stage. */ Update withTags(Map tags); @@ -502,13 +509,26 @@ interface WithTags { */ interface WithSku { /** - * Specifies the sku property: The sku of the created namespace. + * Specifies the sku property: The Sku description for a namespace. * - * @param sku The sku of the created 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); + } } /** @@ -525,4 +545,24 @@ interface WithSku { * @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..165dd60a02ee --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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 b66386c35089..bca6b195e776 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 @@ -1,56 +1,51 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + /** - * The namespace type. + * Defines values for NamespaceType. */ -public enum NamespaceType { +public final class NamespaceType extends ExpandableStringEnum { /** - * Enum value Messaging. + * Static value Messaging for NamespaceType. */ - MESSAGING("Messaging"), + public static final NamespaceType MESSAGING = fromString("Messaging"); /** - * Enum value NotificationHub. + * Static value NotificationHub for NamespaceType. */ - NOTIFICATION_HUB("NotificationHub"); + public static final NamespaceType NOTIFICATION_HUB = fromString("NotificationHub"); /** - * The actual serialized value for a NamespaceType instance. + * Creates a new instance of NamespaceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - NamespaceType(String value) { - this.value = value; + @Deprecated + public NamespaceType() { } /** - * Parses a serialized value to a NamespaceType instance. + * Creates or finds a NamespaceType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed NamespaceType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding NamespaceType. */ - public static NamespaceType fromString(String value) { - if (value == null) { - return null; - } - 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); } /** - * {@inheritDoc} + * Gets known NamespaceType values. + * + * @return known NamespaceType values. */ - @Override - public String toString() { - return this.value; + 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 853707ba44b5..c241b438fea5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -13,287 +13,318 @@ */ 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. + * Gets an authorization rule for a namespace by name. * - * @param parameters The namespace 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 description of a CheckAvailability resource along with {@link Response}. + * @return an authorization rule for a namespace by name along with {@link Response}. */ - Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, - Context context); + Response getAuthorizationRuleWithResponse(String resourceGroupName, + String namespaceName, String authorizationRuleName, 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. + * Gets an authorization rule for a namespace by name. * - * @param parameters The namespace 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 description of a CheckAvailability resource. + * @return an authorization rule for a namespace by name. */ - CheckAvailabilityResult checkAvailability(CheckAvailabilityParameters parameters); + SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupName, String namespaceName, + String authorizationRuleName); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Deletes a namespace authorization rule. * - * @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 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 {@link Response}. */ - void deleteByResourceGroup(String resourceGroupName, String namespaceName); + Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, Context context); /** - * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. + * Deletes a namespace authorization rule. * - * @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. + * @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 delete(String resourceGroupName, String namespaceName, Context context); + void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Returns the description for the specified namespace. + * 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 description of a Namespace resource along with {@link Response}. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String namespaceName, - Context context); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName); /** - * Returns the description for the specified namespace. + * 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 description of a Namespace resource. + * @return the authorization rules for a namespace as paginated response with {@link PagedIterable}. */ - NamespaceResource getByResourceGroup(String resourceGroupName, String namespaceName); + PagedIterable listAuthorizationRules(String resourceGroupName, + String namespaceName, Context context); /** - * Deletes a namespace authorization rule. + * Gets the Primary and Secondary ConnectionStrings to 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 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 {@link Response}. + * @return the Primary and Secondary ConnectionStrings to the namespace along with {@link Response}. */ - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, + Response listKeysWithResponse(String resourceGroupName, String namespaceName, String authorizationRuleName, Context context); /** - * Deletes a namespace authorization rule. + * Gets the Primary and Secondary ConnectionStrings to 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 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 namespace. */ - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String authorizationRuleName); + ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); /** - * Gets an authorization rule for a namespace by name. + * 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 Authorization rule name. + * @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 along with {@link Response}. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ - Response getAuthorizationRuleWithResponse(String resourceGroupName, - String namespaceName, String authorizationRuleName, Context context); + Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, + String authorizationRuleName, PolicyKeyResource parameters, Context context); /** - * Gets an authorization rule for a namespace by name. + * 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 Authorization rule name. + * @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 the POST request that returns Namespace or NotificationHub access keys (connection strings). */ - SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupName, String namespaceName, - String authorizationRuleName); + ResourceListKeys regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, + PolicyKeyResource parameters); /** - * Lists the available namespaces within a resourceGroup. + * Returns the given namespace. * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * @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 Namespace operation as paginated response with {@link PagedIterable}. + * @return notification Hubs Namespace Resource along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + 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); /** - * Lists the available namespaces within a resourceGroup. + * Deletes an existing namespace. This operation also removes all associated notificationHubs under the namespace. * - * @param resourceGroupName The name of the resource group. If resourceGroupName value is null the method lists all - * the namespaces within subscription. + * @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 Namespace operation as paginated response with {@link PagedIterable}. + * @return the {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + Response deleteByResourceGroupWithResponse(String resourceGroupName, String namespaceName, Context context); /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * 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 the response of the List Namespace operation as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + void deleteByResourceGroup(String resourceGroupName, String namespaceName); /** - * Lists all the available namespaces within the subscription irrespective of the resourceGroups. + * Lists the available namespaces within a resource group. * - * @param context The context to associate with this operation. + * @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 of the List Namespace operation as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Gets the authorization rules for a namespace. + * Lists the available namespaces within a resource group. * - * @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 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 authorization rules for a namespace as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ - PagedIterable listAuthorizationRules(String resourceGroupName, - String namespaceName); + PagedIterable listByResourceGroup(String resourceGroupName, String skipToken, Integer top, + Context context); /** - * Gets the authorization rules for a namespace. + * Lists all the available namespaces within the subscription. * - * @param resourceGroupName The name of the resource group. - * @param namespaceName The namespace name. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * 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 authorization rules for a namespace as paginated response with {@link PagedIterable}. + * @return paged collection of NamespaceResource items as paginated response with {@link PagedIterable}. */ - PagedIterable listAuthorizationRules(String resourceGroupName, - String namespaceName, Context context); + PagedIterable list(String skipToken, Integer top, Context context); /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * Lists the PNS credentials associated with a 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 along with {@link Response}. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ - Response listKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, Context context); + Response getPnsCredentialsWithResponse(String resourceGroupName, String namespaceName, + Context context); /** - * Gets the Primary and Secondary ConnectionStrings to the namespace. + * Lists the PNS credentials associated with a 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 description of a NotificationHub PNS Credentials. */ - ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String authorizationRuleName); + PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName); /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * 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 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 parameters The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 along with {@link Response}. + * @return description of a CheckAvailability resource along with {@link Response}. */ - Response regenerateKeysWithResponse(String resourceGroupName, String namespaceName, - String authorizationRuleName, PolicykeyResource parameters, Context context); + Response checkAvailabilityWithResponse(CheckAvailabilityParameters parameters, + Context context); /** - * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. + * 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 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 parameters The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 CheckAvailability resource. */ - ResourceListKeys regenerateKeys(String resourceGroupName, String namespaceName, String authorizationRuleName, - PolicykeyResource parameters); + CheckAvailabilityResult checkAvailability(CheckAvailabilityParameters parameters); /** - * Returns the description for the specified 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 description of a Namespace resource along with {@link Response}. + * @return notification Hubs Namespace Resource along with {@link Response}. */ NamespaceResource getById(String id); /** - * Returns the description for the specified 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 description of a Namespace resource along with {@link Response}. + * @return notification Hubs Namespace Resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -338,8 +369,9 @@ ResourceListKeys regenerateKeys(String resourceGroupName, String namespaceName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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 deleteByIdWithResponse(String id, Context context); + Response deleteByIdWithResponse(String id, Context context); /** * Deletes a namespace authorization rule. 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..65544f706b14 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NetworkAcls.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * A collection of network authorization rules. + */ +@Fluent +public final class NetworkAcls implements JsonSerializable { + /* + * List of IP rules. + */ + private List ipRules; + + /* + * A default (public Internet) network authorization rule, which contains rights if no other network rule matches. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("ipRules", this.ipRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("publicNetworkRule", this.publicNetworkRule); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkAcls from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkAcls if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkAcls. + */ + public static NetworkAcls fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkAcls deserializedNetworkAcls = new NetworkAcls(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipRules".equals(fieldName)) { + List ipRules = reader.readArray(reader1 -> IpRule.fromJson(reader1)); + deserializedNetworkAcls.ipRules = ipRules; + } else if ("publicNetworkRule".equals(fieldName)) { + deserializedNetworkAcls.publicNetworkRule = PublicInternetAuthorizationRule.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkAcls; + }); + } +} 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 dee23070bbce..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubCreateOrUpdateParameters.java +++ /dev/null @@ -1,414 +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.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.notificationhubs.fluent.models.NotificationHubProperties; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; -import java.io.IOException; -import java.util.List; -import java.util.Map; - -/** - * Parameters supplied to the CreateOrUpdate NotificationHub operation. - */ -@Fluent -public final class NotificationHubCreateOrUpdateParameters extends Resource { - /* - * Properties of the NotificationHub. - */ - private NotificationHubProperties innerProperties = new NotificationHubProperties(); - - /* - * The sku of the created namespace - */ - private Sku sku; - - /* - * The type of the resource. - */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; - - /** - * Creates an instance of NotificationHubCreateOrUpdateParameters class. - */ - public NotificationHubCreateOrUpdateParameters() { - } - - /** - * 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; - } - - /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. - * - * @return the name value. - */ - @Override - public String name() { - return this.name; - } - - /** - * Get the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@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.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model NotificationHubCreateOrUpdateParameters")); - } else { - innerProperties().validate(); - } - if (sku() != null) { - sku().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(NotificationHubCreateOrUpdateParameters.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeJsonField("sku", this.sku); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of NotificationHubCreateOrUpdateParameters from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of NotificationHubCreateOrUpdateParameters if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the NotificationHubCreateOrUpdateParameters. - */ - public static NotificationHubCreateOrUpdateParameters fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - NotificationHubCreateOrUpdateParameters deserializedNotificationHubCreateOrUpdateParameters - = new NotificationHubCreateOrUpdateParameters(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedNotificationHubCreateOrUpdateParameters.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedNotificationHubCreateOrUpdateParameters.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedNotificationHubCreateOrUpdateParameters.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedNotificationHubCreateOrUpdateParameters.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedNotificationHubCreateOrUpdateParameters.withTags(tags); - } else if ("properties".equals(fieldName)) { - deserializedNotificationHubCreateOrUpdateParameters.innerProperties - = NotificationHubProperties.fromJson(reader); - } else if ("sku".equals(fieldName)) { - deserializedNotificationHubCreateOrUpdateParameters.sku = Sku.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedNotificationHubCreateOrUpdateParameters; - }); - } -} 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 c3467d174680..da875f2f43af 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 @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.notificationhubs.fluent.models.NotificationHubProperties; @@ -16,34 +16,24 @@ import java.util.Map; /** - * Parameters supplied to the patch NotificationHub operation. + * Patch parameter for NamespaceResource. */ @Fluent -public final class NotificationHubPatchParameters extends Resource { +public final class NotificationHubPatchParameters implements JsonSerializable { /* - * Properties of the NotificationHub. + * NotificationHub properties. */ private NotificationHubProperties innerProperties; /* - * The sku of the created namespace + * The Sku description for a namespace */ private Sku sku; /* - * The type of the resource. + * Dictionary of */ - private String type; - - /* - * The name of the resource. - */ - private String name; - - /* - * Fully qualified resource Id for the resource. - */ - private String id; + private Map tags; /** * Creates an instance of NotificationHubPatchParameters class. @@ -52,7 +42,7 @@ public NotificationHubPatchParameters() { } /** - * Get the innerProperties property: Properties of the NotificationHub. + * Get the innerProperties property: NotificationHub properties. * * @return the innerProperties value. */ @@ -61,7 +51,7 @@ private NotificationHubProperties innerProperties() { } /** - * Get the sku property: The sku of the created namespace. + * Get the sku property: The Sku description for a namespace. * * @return the sku value. */ @@ -70,7 +60,7 @@ 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 NotificationHubPatchParameters object itself. @@ -81,69 +71,41 @@ public NotificationHubPatchParameters withSku(Sku sku) { } /** - * Get the type property: The type of the resource. - * - * @return the type value. - */ - @Override - public String type() { - return this.type; - } - - /** - * Get the name property: The name of the resource. + * Get the tags property: Dictionary of <string>. * - * @return the name value. + * @return the tags value. */ - @Override - public String name() { - return this.name; + public Map tags() { + return this.tags; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Set the tags property: Dictionary of <string>. * - * @return the id value. - */ - @Override - public String id() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Override - public NotificationHubPatchParameters withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} + * @param tags the tags value to set. + * @return the NotificationHubPatchParameters object itself. */ - @Override public NotificationHubPatchParameters withTags(Map tags) { - super.withTags(tags); + this.tags = tags; return this; } /** - * Get the name property: The NotificationHub name. + * Get the name property: Gets or sets the NotificationHub name. * * @return the name value. */ - public String namePropertiesName() { + public String name() { return this.innerProperties() == null ? null : this.innerProperties().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 NotificationHubPatchParameters object itself. */ - public NotificationHubPatchParameters withNamePropertiesName(String name) { + public NotificationHubPatchParameters withName(String name) { if (this.innerProperties() == null) { this.innerProperties = new NotificationHubProperties(); } @@ -152,7 +114,7 @@ public NotificationHubPatchParameters withNamePropertiesName(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. */ @@ -161,7 +123,7 @@ 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 NotificationHubPatchParameters object itself. @@ -175,7 +137,7 @@ public NotificationHubPatchParameters 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. */ @@ -184,22 +146,7 @@ public List 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. + * Get the apnsCredential property: Description of a NotificationHub ApnsCredential. * * @return the apnsCredential value. */ @@ -208,7 +155,7 @@ 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 NotificationHubPatchParameters object itself. @@ -222,7 +169,7 @@ public NotificationHubPatchParameters withApnsCredential(ApnsCredential apnsCred } /** - * Get the wnsCredential property: The WnsCredential of the created NotificationHub. + * Get the wnsCredential property: Description of a NotificationHub WnsCredential. * * @return the wnsCredential value. */ @@ -231,7 +178,7 @@ 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 NotificationHubPatchParameters object itself. @@ -245,7 +192,7 @@ public NotificationHubPatchParameters withWnsCredential(WnsCredential wnsCredent } /** - * Get the gcmCredential property: The GcmCredential of the created NotificationHub. + * Get the gcmCredential property: Description of a NotificationHub GcmCredential. * * @return the gcmCredential value. */ @@ -254,7 +201,7 @@ 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 NotificationHubPatchParameters object itself. @@ -268,7 +215,7 @@ public NotificationHubPatchParameters withGcmCredential(GcmCredential gcmCredent } /** - * Get the mpnsCredential property: The MpnsCredential of the created NotificationHub. + * Get the mpnsCredential property: Description of a NotificationHub MpnsCredential. * * @return the mpnsCredential value. */ @@ -277,7 +224,7 @@ 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 NotificationHubPatchParameters object itself. @@ -291,7 +238,7 @@ public NotificationHubPatchParameters withMpnsCredential(MpnsCredential mpnsCred } /** - * Get the admCredential property: The AdmCredential of the created NotificationHub. + * Get the admCredential property: Description of a NotificationHub AdmCredential. * * @return the admCredential value. */ @@ -300,7 +247,7 @@ 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 NotificationHubPatchParameters object itself. @@ -314,7 +261,7 @@ public NotificationHubPatchParameters withAdmCredential(AdmCredential admCredent } /** - * Get the baiduCredential property: The BaiduCredential of the created NotificationHub. + * Get the baiduCredential property: Description of a NotificationHub BaiduCredential. * * @return the baiduCredential value. */ @@ -323,7 +270,7 @@ 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 NotificationHubPatchParameters object itself. @@ -337,17 +284,81 @@ public NotificationHubPatchParameters withBaiduCredential(BaiduCredential baiduC } /** - * Validates the instance. + * Get the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @return the browserCredential value. + */ + public BrowserCredential browserCredential() { + return this.innerProperties() == null ? null : this.innerProperties().browserCredential(); + } + + /** + * Set the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @param browserCredential the browserCredential value to set. + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withBrowserCredential(BrowserCredential browserCredential) { + if (this.innerProperties() == null) { + this.innerProperties = new NotificationHubProperties(); + } + this.innerProperties().withBrowserCredential(browserCredential); + return this; + } + + /** + * Get the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the xiaomiCredential value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public XiaomiCredential xiaomiCredential() { + return this.innerProperties() == null ? null : this.innerProperties().xiaomiCredential(); + } + + /** + * Set the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. + * + * @param xiaomiCredential the xiaomiCredential value to set. + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withXiaomiCredential(XiaomiCredential xiaomiCredential) { + if (this.innerProperties() == null) { + this.innerProperties = new NotificationHubProperties(); } - if (sku() != null) { - sku().validate(); + this.innerProperties().withXiaomiCredential(xiaomiCredential); + return this; + } + + /** + * Get the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @return the fcmV1Credential value. + */ + public FcmV1Credential fcmV1Credential() { + return this.innerProperties() == null ? null : this.innerProperties().fcmV1Credential(); + } + + /** + * Set the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @param fcmV1Credential the fcmV1Credential value to set. + * @return the NotificationHubPatchParameters object itself. + */ + public NotificationHubPatchParameters withFcmV1Credential(FcmV1Credential fcmV1Credential) { + if (this.innerProperties() == null) { + this.innerProperties = new NotificationHubProperties(); } + this.innerProperties().withFcmV1Credential(fcmV1Credential); + return this; + } + + /** + * Get the dailyMaxActiveDevices property: The dailyMaxActiveDevices property. + * + * @return the dailyMaxActiveDevices value. + */ + public Long dailyMaxActiveDevices() { + return this.innerProperties() == null ? null : this.innerProperties().dailyMaxActiveDevices(); } /** @@ -356,10 +367,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); jsonWriter.writeJsonField("sku", this.sku); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } @@ -369,7 +379,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of NotificationHubPatchParameters if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the NotificationHubPatchParameters. */ public static NotificationHubPatchParameters fromJson(JsonReader jsonReader) throws IOException { @@ -380,22 +389,14 @@ public static NotificationHubPatchParameters fromJson(JsonReader jsonReader) thr String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { - deserializedNotificationHubPatchParameters.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedNotificationHubPatchParameters.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedNotificationHubPatchParameters.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedNotificationHubPatchParameters.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedNotificationHubPatchParameters.withTags(tags); - } else if ("properties".equals(fieldName)) { + if ("properties".equals(fieldName)) { deserializedNotificationHubPatchParameters.innerProperties = NotificationHubProperties.fromJson(reader); } else if ("sku".equals(fieldName)) { deserializedNotificationHubPatchParameters.sku = Sku.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedNotificationHubPatchParameters.tags = tags; } else { reader.skipChildren(); } 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 814345228f80..d58302627a53 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 @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.NotificationHubResourceInner; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; @@ -52,75 +53,110 @@ public interface NotificationHubResource { 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 NotificationHub name. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the namePropertiesName property: Gets or sets the NotificationHub name. * * @return the namePropertiesName value. */ String namePropertiesName(); /** - * Gets the registrationTtl property: The RegistrationTtl of the created NotificationHub. + * Gets the registrationTtl property: Gets or sets the RegistrationTtl of the created NotificationHub. * * @return the registrationTtl value. */ String registrationTtl(); /** - * Gets the authorizationRules property: The AuthorizationRules of the created NotificationHub. + * Gets the authorizationRules property: Gets or sets the AuthorizationRules of the created NotificationHub. * * @return the authorizationRules value. */ List authorizationRules(); /** - * Gets the apnsCredential property: The ApnsCredential of the created NotificationHub. + * Gets the apnsCredential property: Description of a NotificationHub ApnsCredential. * * @return the apnsCredential value. */ ApnsCredential apnsCredential(); /** - * Gets the wnsCredential property: The WnsCredential of the created NotificationHub. + * Gets the wnsCredential property: Description of a NotificationHub WnsCredential. * * @return the wnsCredential value. */ WnsCredential wnsCredential(); /** - * Gets the gcmCredential property: The GcmCredential of the created NotificationHub. + * Gets the gcmCredential property: Description of a NotificationHub GcmCredential. * * @return the gcmCredential value. */ GcmCredential gcmCredential(); /** - * Gets the mpnsCredential property: The MpnsCredential of the created NotificationHub. + * Gets the mpnsCredential property: Description of a NotificationHub MpnsCredential. * * @return the mpnsCredential value. */ MpnsCredential mpnsCredential(); /** - * Gets the admCredential property: The AdmCredential of the created NotificationHub. + * Gets the admCredential property: Description of a NotificationHub AdmCredential. * * @return the admCredential value. */ AdmCredential admCredential(); /** - * Gets the baiduCredential property: The BaiduCredential of the created NotificationHub. + * Gets the baiduCredential property: Description of a NotificationHub BaiduCredential. * * @return the baiduCredential value. */ BaiduCredential baiduCredential(); + /** + * Gets the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @return the browserCredential value. + */ + BrowserCredential browserCredential(); + + /** + * Gets the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. + * + * @return the xiaomiCredential value. + */ + XiaomiCredential xiaomiCredential(); + + /** + * Gets the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @return the fcmV1Credential value. + */ + FcmV1Credential fcmV1Credential(); + + /** + * Gets the dailyMaxActiveDevices property: The dailyMaxActiveDevices property. + * + * @return the dailyMaxActiveDevices value. + */ + Long dailyMaxActiveDevices(); + /** * Gets the region of the resource. * @@ -194,8 +230,8 @@ 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); @@ -207,9 +243,10 @@ interface WithParentResource { */ 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 { + DefinitionStages.WithApnsCredential, DefinitionStages.WithWnsCredential, DefinitionStages.WithGcmCredential, + DefinitionStages.WithMpnsCredential, DefinitionStages.WithAdmCredential, + DefinitionStages.WithBaiduCredential, DefinitionStages.WithBrowserCredential, + DefinitionStages.WithXiaomiCredential, DefinitionStages.WithFcmV1Credential { /** * Executes the create request. * @@ -244,9 +281,9 @@ interface WithTags { */ interface WithSku { /** - * Specifies the sku property: The sku of the created namespace. + * Specifies the sku property: The Sku description for a namespace. * - * @param sku The sku of the created namespace. + * @param sku The Sku description for a namespace. * @return the next definition stage. */ WithCreate withSku(Sku sku); @@ -257,9 +294,9 @@ interface WithSku { */ interface WithNamePropertiesName { /** - * Specifies the namePropertiesName property: The NotificationHub name.. + * Specifies the namePropertiesName property: Gets or sets the NotificationHub name.. * - * @param namePropertiesName The NotificationHub name. + * @param namePropertiesName Gets or sets the NotificationHub name. * @return the next definition stage. */ WithCreate withNamePropertiesName(String namePropertiesName); @@ -270,35 +307,22 @@ interface WithNamePropertiesName { */ interface WithRegistrationTtl { /** - * Specifies the registrationTtl property: The RegistrationTtl of the created NotificationHub. + * Specifies the registrationTtl property: Gets or sets the RegistrationTtl of the created NotificationHub. * - * @param registrationTtl The RegistrationTtl of the created NotificationHub. + * @param registrationTtl Gets or sets 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. + * Specifies the apnsCredential property: Description of a NotificationHub ApnsCredential.. * - * @param apnsCredential The ApnsCredential of the created NotificationHub. + * @param apnsCredential Description of a NotificationHub ApnsCredential. * @return the next definition stage. */ WithCreate withApnsCredential(ApnsCredential apnsCredential); @@ -309,9 +333,9 @@ interface WithApnsCredential { */ interface WithWnsCredential { /** - * Specifies the wnsCredential property: The WnsCredential of the created NotificationHub. + * Specifies the wnsCredential property: Description of a NotificationHub WnsCredential.. * - * @param wnsCredential The WnsCredential of the created NotificationHub. + * @param wnsCredential Description of a NotificationHub WnsCredential. * @return the next definition stage. */ WithCreate withWnsCredential(WnsCredential wnsCredential); @@ -322,9 +346,9 @@ interface WithWnsCredential { */ interface WithGcmCredential { /** - * Specifies the gcmCredential property: The GcmCredential of the created NotificationHub. + * Specifies the gcmCredential property: Description of a NotificationHub GcmCredential.. * - * @param gcmCredential The GcmCredential of the created NotificationHub. + * @param gcmCredential Description of a NotificationHub GcmCredential. * @return the next definition stage. */ WithCreate withGcmCredential(GcmCredential gcmCredential); @@ -335,9 +359,9 @@ interface WithGcmCredential { */ interface WithMpnsCredential { /** - * Specifies the mpnsCredential property: The MpnsCredential of the created NotificationHub. + * Specifies the mpnsCredential property: Description of a NotificationHub MpnsCredential.. * - * @param mpnsCredential The MpnsCredential of the created NotificationHub. + * @param mpnsCredential Description of a NotificationHub MpnsCredential. * @return the next definition stage. */ WithCreate withMpnsCredential(MpnsCredential mpnsCredential); @@ -348,9 +372,9 @@ interface WithMpnsCredential { */ interface WithAdmCredential { /** - * Specifies the admCredential property: The AdmCredential of the created NotificationHub. + * Specifies the admCredential property: Description of a NotificationHub AdmCredential.. * - * @param admCredential The AdmCredential of the created NotificationHub. + * @param admCredential Description of a NotificationHub AdmCredential. * @return the next definition stage. */ WithCreate withAdmCredential(AdmCredential admCredential); @@ -361,13 +385,52 @@ interface WithAdmCredential { */ interface WithBaiduCredential { /** - * Specifies the baiduCredential property: The BaiduCredential of the created NotificationHub. + * Specifies the baiduCredential property: Description of a NotificationHub BaiduCredential.. * - * @param baiduCredential The BaiduCredential of the created NotificationHub. + * @param baiduCredential Description of a NotificationHub BaiduCredential. * @return the next definition stage. */ WithCreate withBaiduCredential(BaiduCredential baiduCredential); } + + /** + * The stage of the NotificationHubResource definition allowing to specify browserCredential. + */ + interface WithBrowserCredential { + /** + * Specifies the browserCredential property: Description of a NotificationHub BrowserCredential.. + * + * @param browserCredential Description of a NotificationHub BrowserCredential. + * @return the next definition stage. + */ + WithCreate withBrowserCredential(BrowserCredential browserCredential); + } + + /** + * The stage of the NotificationHubResource definition allowing to specify xiaomiCredential. + */ + interface WithXiaomiCredential { + /** + * Specifies the xiaomiCredential property: Description of a NotificationHub XiaomiCredential.. + * + * @param xiaomiCredential Description of a NotificationHub XiaomiCredential. + * @return the next definition stage. + */ + WithCreate withXiaomiCredential(XiaomiCredential xiaomiCredential); + } + + /** + * The stage of the NotificationHubResource definition allowing to specify fcmV1Credential. + */ + interface WithFcmV1Credential { + /** + * Specifies the fcmV1Credential property: Description of a NotificationHub FcmV1Credential.. + * + * @param fcmV1Credential Description of a NotificationHub FcmV1Credential. + * @return the next definition stage. + */ + WithCreate withFcmV1Credential(FcmV1Credential fcmV1Credential); + } } /** @@ -380,10 +443,10 @@ interface WithBaiduCredential { /** * 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 { + interface Update extends UpdateStages.WithTags, UpdateStages.WithSku, UpdateStages.WithRegistrationTtl, + UpdateStages.WithApnsCredential, UpdateStages.WithWnsCredential, UpdateStages.WithGcmCredential, + UpdateStages.WithMpnsCredential, UpdateStages.WithAdmCredential, UpdateStages.WithBaiduCredential, + UpdateStages.WithBrowserCredential, UpdateStages.WithXiaomiCredential, UpdateStages.WithFcmV1Credential { /** * Executes the update request. * @@ -409,9 +472,9 @@ interface UpdateStages { */ interface WithTags { /** - * Specifies the tags property: Resource tags.. + * Specifies the tags property: Dictionary of <string>. * - * @param tags Resource tags. + * @param tags Dictionary of <string>. * @return the next definition stage. */ Update withTags(Map tags); @@ -422,61 +485,35 @@ interface WithTags { */ interface WithSku { /** - * Specifies the sku property: The sku of the created namespace. + * Specifies the sku property: The Sku description for a namespace. * - * @param sku The sku of the created namespace. + * @param sku The Sku description for a 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. + * Specifies the registrationTtl property: Gets or sets the RegistrationTtl of the created NotificationHub. * - * @param registrationTtl The RegistrationTtl of the created NotificationHub. + * @param registrationTtl Gets or sets 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. + * Specifies the apnsCredential property: Description of a NotificationHub ApnsCredential.. * - * @param apnsCredential The ApnsCredential of the created NotificationHub. + * @param apnsCredential Description of a NotificationHub ApnsCredential. * @return the next definition stage. */ Update withApnsCredential(ApnsCredential apnsCredential); @@ -487,9 +524,9 @@ interface WithApnsCredential { */ interface WithWnsCredential { /** - * Specifies the wnsCredential property: The WnsCredential of the created NotificationHub. + * Specifies the wnsCredential property: Description of a NotificationHub WnsCredential.. * - * @param wnsCredential The WnsCredential of the created NotificationHub. + * @param wnsCredential Description of a NotificationHub WnsCredential. * @return the next definition stage. */ Update withWnsCredential(WnsCredential wnsCredential); @@ -500,9 +537,9 @@ interface WithWnsCredential { */ interface WithGcmCredential { /** - * Specifies the gcmCredential property: The GcmCredential of the created NotificationHub. + * Specifies the gcmCredential property: Description of a NotificationHub GcmCredential.. * - * @param gcmCredential The GcmCredential of the created NotificationHub. + * @param gcmCredential Description of a NotificationHub GcmCredential. * @return the next definition stage. */ Update withGcmCredential(GcmCredential gcmCredential); @@ -513,9 +550,9 @@ interface WithGcmCredential { */ interface WithMpnsCredential { /** - * Specifies the mpnsCredential property: The MpnsCredential of the created NotificationHub. + * Specifies the mpnsCredential property: Description of a NotificationHub MpnsCredential.. * - * @param mpnsCredential The MpnsCredential of the created NotificationHub. + * @param mpnsCredential Description of a NotificationHub MpnsCredential. * @return the next definition stage. */ Update withMpnsCredential(MpnsCredential mpnsCredential); @@ -526,9 +563,9 @@ interface WithMpnsCredential { */ interface WithAdmCredential { /** - * Specifies the admCredential property: The AdmCredential of the created NotificationHub. + * Specifies the admCredential property: Description of a NotificationHub AdmCredential.. * - * @param admCredential The AdmCredential of the created NotificationHub. + * @param admCredential Description of a NotificationHub AdmCredential. * @return the next definition stage. */ Update withAdmCredential(AdmCredential admCredential); @@ -539,13 +576,52 @@ interface WithAdmCredential { */ interface WithBaiduCredential { /** - * Specifies the baiduCredential property: The BaiduCredential of the created NotificationHub. + * Specifies the baiduCredential property: Description of a NotificationHub BaiduCredential.. * - * @param baiduCredential The BaiduCredential of the created NotificationHub. + * @param baiduCredential Description of a NotificationHub BaiduCredential. * @return the next definition stage. */ Update withBaiduCredential(BaiduCredential baiduCredential); } + + /** + * The stage of the NotificationHubResource update allowing to specify browserCredential. + */ + interface WithBrowserCredential { + /** + * Specifies the browserCredential property: Description of a NotificationHub BrowserCredential.. + * + * @param browserCredential Description of a NotificationHub BrowserCredential. + * @return the next definition stage. + */ + Update withBrowserCredential(BrowserCredential browserCredential); + } + + /** + * The stage of the NotificationHubResource update allowing to specify xiaomiCredential. + */ + interface WithXiaomiCredential { + /** + * Specifies the xiaomiCredential property: Description of a NotificationHub XiaomiCredential.. + * + * @param xiaomiCredential Description of a NotificationHub XiaomiCredential. + * @return the next definition stage. + */ + Update withXiaomiCredential(XiaomiCredential xiaomiCredential); + } + + /** + * The stage of the NotificationHubResource update allowing to specify fcmV1Credential. + */ + interface WithFcmV1Credential { + /** + * Specifies the fcmV1Credential property: Description of a NotificationHub FcmV1Credential.. + * + * @param fcmV1Credential Description of a NotificationHub FcmV1Credential. + * @return the next definition stage. + */ + Update withFcmV1Credential(FcmV1Credential fcmV1Credential); + } } /** @@ -564,19 +640,18 @@ interface WithBaiduCredential { NotificationHubResource refresh(Context context); /** - * test send a push notification. + * 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. * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. */ - Response debugSendWithResponse(Object parameters, Context context); + Response debugSendWithResponse(Context context); /** - * test send a push notification. + * 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. @@ -585,7 +660,7 @@ interface WithBaiduCredential { 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. @@ -596,7 +671,7 @@ interface WithBaiduCredential { Response getPnsCredentialsWithResponse(Context context); /** - * Lists the PNS Credentials associated with a notification hub . + * 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. 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 d2b2b9fb5d8d..2f31f749c8b1 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 @@ -1,52 +1,52 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.SharedAccessAuthorizationRuleResourceInner; /** * Resource collection API of NotificationHubs. */ public interface NotificationHubs { /** - * Checks the availability of the given notificationHub in a namespace. + * Gets the notification hub. * - * @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 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 CheckAvailability resource along with {@link Response}. + * @return the notification hub along with {@link Response}. */ - Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, - String namespaceName, CheckAvailabilityParameters parameters, Context context); + Response getWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); /** - * Checks the availability of the given notificationHub in a namespace. + * Gets the notification hub. * - * @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 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 CheckAvailability resource. + * @return the notification hub. */ - CheckAvailabilityResult checkNotificationHubAvailability(String resourceGroupName, String namespaceName, - CheckAvailabilityParameters parameters); + 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. @@ -59,9 +59,9 @@ Response deleteWithResponse(String resourceGroupName, String namespaceName /** * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -71,38 +71,37 @@ Response deleteWithResponse(String resourceGroupName, String namespaceName /** * 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 along with {@link Response}. + * @return paged collection of NotificationHubResource items as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, Context context); + PagedIterable list(String resourceGroupName, String namespaceName); /** * 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 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 paged collection of NotificationHubResource items as paginated response with {@link PagedIterable}. */ - NotificationHubResource get(String resourceGroupName, String namespaceName, String notificationHubName); + PagedIterable list(String resourceGroupName, String namespaceName, String skipToken, + Integer top, Context context); /** - * test send a push notification. + * 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. + * @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. @@ -110,14 +109,14 @@ Response getWithResponse(String resourceGroupName, Stri * @return description of a NotificationHub Resource along with {@link Response}. */ Response debugSendWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, Object parameters, Context context); + String notificationHubName, Context context); /** - * test send a push notification. + * 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 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. @@ -126,77 +125,70 @@ Response debugSendWithResponse(String resourceGroupName, Stri DebugSendResponse debugSend(String resourceGroupName, String namespaceName, String notificationHubName); /** - * Creates/Updates an authorization rule for a NotificationHub. + * 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 authorizationRuleName Authorization Rule Name. - * @param parameters The shared access 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 context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown 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 along with {@link Response}. + * @return description of a NotificationHub PNS Credentials along with {@link Response}. */ - Response createOrUpdateAuthorizationRuleWithResponse( - String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters, Context context); + Response getPnsCredentialsWithResponse(String resourceGroupName, String namespaceName, + String notificationHubName, Context context); /** - * Creates/Updates an authorization rule for a NotificationHub. + * 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 authorizationRuleName Authorization Rule Name. - * @param parameters The shared access authorization rule. + * @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 PNS Credentials. */ - SharedAccessAuthorizationRuleResource createOrUpdateAuthorizationRule(String resourceGroupName, - String namespaceName, String notificationHubName, String authorizationRuleName, - SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters); + PnsCredentialsResource getPnsCredentials(String resourceGroupName, String namespaceName, + String notificationHubName); /** - * Deletes a notificationHub authorization rule. + * Checks the availability of the given notificationHub in a namespace. * - * @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 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 {@link Response}. + * @return description of a CheckAvailability resource along with {@link Response}. */ - Response deleteAuthorizationRuleWithResponse(String resourceGroupName, String namespaceName, - String notificationHubName, String authorizationRuleName, Context context); + Response checkNotificationHubAvailabilityWithResponse(String resourceGroupName, + String namespaceName, CheckAvailabilityParameters parameters, Context context); /** - * Deletes a notificationHub authorization rule. + * Checks the availability of the given notificationHub in a namespace. * - * @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 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. */ - void deleteAuthorizationRule(String resourceGroupName, String namespaceName, String notificationHubName, - String authorizationRuleName); + CheckAvailabilityResult checkNotificationHubAvailability(String resourceGroupName, String namespaceName, + CheckAvailabilityParameters parameters); /** * 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. @@ -209,10 +201,10 @@ Response getAuthorizationRuleWithResponse /** * 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. @@ -222,36 +214,76 @@ SharedAccessAuthorizationRuleResource getAuthorizationRule(String resourceGroupN String notificationHubName, String authorizationRuleName); /** - * Lists the notification hubs associated with a namespace. + * Creates/Updates an authorization rule for a NotificationHub. * - * @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 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 response of the List NotificationHub operation as paginated response with {@link PagedIterable}. + * @return response for POST requests that return single SharedAccessAuthorizationRule along with {@link Response}. */ - PagedIterable list(String resourceGroupName, String namespaceName); + Response createOrUpdateAuthorizationRuleWithResponse( + String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters, Context context); /** - * Lists the notification hubs associated with a namespace. + * Creates/Updates an authorization rule for a NotificationHub. * - * @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 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. + */ + SharedAccessAuthorizationRuleResource createOrUpdateAuthorizationRule(String resourceGroupName, + String namespaceName, String notificationHubName, String authorizationRuleName, + SharedAccessAuthorizationRuleResourceInner parameters); + + /** + * 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 com.azure.core.management.exception.ManagementException thrown 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}. + * @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. 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. */ - PagedIterable list(String resourceGroupName, String namespaceName, Context context); + void deleteAuthorizationRule(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. @@ -263,9 +295,9 @@ PagedIterable listAuthorizationRules(Stri /** * 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. @@ -278,10 +310,10 @@ PagedIterable listAuthorizationRules(Stri /** * 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. @@ -294,10 +326,10 @@ Response listKeysWithResponse(String resourceGroupName, String /** * 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -309,85 +341,57 @@ ResourceListKeys listKeys(String resourceGroupName, String namespaceName, String /** * 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 along with {@link Response}. + * @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 notificationHubName, String authorizationRuleName, PolicykeyResource parameters, Context context); + 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 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). */ ResourceListKeys 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. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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(String resourceGroupName, String namespaceName, - String notificationHubName, Context context); + 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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); - - /** - * Lists the notification hubs associated with a namespace. + * 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 description of a NotificationHub Resource along with {@link Response}. + * @return the notification hub along with {@link Response}. */ NotificationHubResource getById(String id); /** - * Lists the notification hubs associated with a namespace. + * 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 description of a NotificationHub Resource along with {@link Response}. + * @return the notification hub along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); 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 fbd2295f38f0..e46adf7fdcad 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -11,19 +11,33 @@ */ public interface Operation { /** - * Gets the name property: Operation name: {provider}/{resource}/{operation}. + * Gets the name property: The name of the operation being performed on this particular object.". * * @return the name value. */ String name(); /** - * Gets the display property: The object that represents the operation. + * Gets the display property: he localized display information for this particular operation / action. * * @return the display value. */ OperationDisplay display(); + /** + * Gets the isDataAction property: The intended executor of the operation.". + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the properties property: Additional descriptions for the operation. + * + * @return the properties value. + */ + OperationProperties properties(); + /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner object. * 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 4e30604332c1..ae564bc60ed3 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -12,33 +12,42 @@ import java.io.IOException; /** - * The object that represents the operation. + * The OperationDisplay model. */ @Immutable public final class OperationDisplay implements JsonSerializable { /* - * Service provider: Microsoft.NotificationHubs + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ private String provider; /* - * Resource on which the operation is performed: Invoice, etc. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ private String resource; /* - * Operation type: Read, write, delete, etc. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ private String operation; + /* + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + */ + private String description; + /** * Creates an instance of OperationDisplay class. */ - public OperationDisplay() { + private OperationDisplay() { } /** - * Get the provider property: Service provider: Microsoft.NotificationHubs. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -47,7 +56,8 @@ public String provider() { } /** - * Get the resource property: Resource on which the operation is performed: Invoice, etc. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -56,7 +66,8 @@ public String resource() { } /** - * Get the operation property: Operation type: Read, write, delete, etc. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". * * @return the operation value. */ @@ -65,11 +76,13 @@ public String operation() { } /** - * Validates the instance. + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the description value. */ - public void validate() { + public String description() { + return this.description; } /** @@ -102,6 +115,8 @@ public static OperationDisplay fromJson(JsonReader jsonReader) throws IOExceptio deserializedOperationDisplay.resource = reader.getString(); } else if ("operation".equals(fieldName)) { deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); } else { reader.skipChildren(); } 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..9aa2109f6415 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProperties.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Optional operation properties. + */ +@Immutable +public final class OperationProperties implements JsonSerializable { + /* + * Optional service specification used in Operations API. + */ + private ServiceSpecification serviceSpecification; + + /** + * Creates an instance of OperationProperties class. + */ + private OperationProperties() { + } + + /** + * Get the serviceSpecification property: Optional service specification used in Operations API. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("serviceSpecification", this.serviceSpecification); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationProperties. + */ + public static OperationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationProperties deserializedOperationProperties = new OperationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceSpecification".equals(fieldName)) { + deserializedOperationProperties.serviceSpecification = ServiceSpecification.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationProperties; + }); + } +} 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..2603435f4266 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProvisioningState.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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 e417e428ceab..62280eb2ecdc 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -12,24 +12,22 @@ */ public interface Operations { /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.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 as paginated response with - * {@link PagedIterable}. + * @return paged collection of Operation items as paginated response with {@link PagedIterable}. */ PagedIterable list(); /** - * Lists all of the available NotificationHubs REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 as paginated response with - * {@link PagedIterable}. + * @return paged collection of Operation items 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/PnsCredentialsResource.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentialsResource.java index e272877ca4c0..1e4218cc1042 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner; import java.util.Map; @@ -33,67 +34,88 @@ public interface PnsCredentialsResource { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * 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. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the sku value. + * @return the systemData value. */ - Sku sku(); + SystemData systemData(); /** - * Gets the apnsCredential property: The ApnsCredential of the created NotificationHub. + * Gets the admCredential property: Description of a NotificationHub AdmCredential. + * + * @return the admCredential value. + */ + AdmCredential admCredential(); + + /** + * Gets the apnsCredential property: Description of a NotificationHub ApnsCredential. * * @return the apnsCredential value. */ ApnsCredential apnsCredential(); /** - * Gets the wnsCredential property: The WnsCredential of the created NotificationHub. + * Gets the baiduCredential property: Description of a NotificationHub BaiduCredential. * - * @return the wnsCredential value. + * @return the baiduCredential value. */ - WnsCredential wnsCredential(); + BaiduCredential baiduCredential(); + + /** + * Gets the browserCredential property: Description of a NotificationHub BrowserCredential. + * + * @return the browserCredential value. + */ + BrowserCredential browserCredential(); /** - * Gets the gcmCredential property: The GcmCredential of the created NotificationHub. + * Gets the gcmCredential property: Description of a NotificationHub GcmCredential. * * @return the gcmCredential value. */ GcmCredential gcmCredential(); /** - * Gets the mpnsCredential property: The MpnsCredential of the created NotificationHub. + * Gets the mpnsCredential property: Description of a NotificationHub MpnsCredential. * * @return the mpnsCredential value. */ MpnsCredential mpnsCredential(); /** - * Gets the admCredential property: The AdmCredential of the created NotificationHub. + * Gets the wnsCredential property: Description of a NotificationHub WnsCredential. * - * @return the admCredential value. + * @return the wnsCredential value. */ - AdmCredential admCredential(); + WnsCredential wnsCredential(); /** - * Gets the baiduCredential property: The BaiduCredential of the created NotificationHub. + * Gets the xiaomiCredential property: Description of a NotificationHub XiaomiCredential. * - * @return the baiduCredential value. + * @return the xiaomiCredential value. */ - BaiduCredential baiduCredential(); + XiaomiCredential xiaomiCredential(); + + /** + * Gets the fcmV1Credential property: Description of a NotificationHub FcmV1Credential. + * + * @return the fcmV1Credential value. + */ + FcmV1Credential fcmV1Credential(); /** * Gets the inner com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner object. 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..f7c84c887e52 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyResource.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Namespace / NotificationHub Regenerate Keys request. + */ +@Fluent +public final class PolicyKeyResource implements JsonSerializable { + /* + * Type of Shared Access Policy Key (primary or secondary). + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("policyKey", this.policyKey == null ? null : this.policyKey.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PolicyKeyResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PolicyKeyResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PolicyKeyResource. + */ + public static PolicyKeyResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PolicyKeyResource deserializedPolicyKeyResource = new PolicyKeyResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyKey".equals(fieldName)) { + deserializedPolicyKeyResource.policyKey = PolicyKeyType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedPolicyKeyResource; + }); + } +} 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..41926960716d --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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 9bbe6f601f16..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicykeyResource.java +++ /dev/null @@ -1,96 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Namespace/NotificationHub Regenerate Keys. - */ -@Fluent -public final class PolicykeyResource implements JsonSerializable { - /* - * Name of the key that has to be regenerated for the Namespace/Notification Hub Authorization Rule. The value can - * be Primary Key/Secondary Key. - */ - private String policyKey; - - /** - * Creates an instance of PolicykeyResource class. - */ - public PolicykeyResource() { - } - - /** - * 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() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("policyKey", this.policyKey); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PolicykeyResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PolicykeyResource if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the PolicykeyResource. - */ - public static PolicykeyResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PolicykeyResource deserializedPolicykeyResource = new PolicykeyResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("policyKey".equals(fieldName)) { - deserializedPolicykeyResource.policyKey = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedPolicykeyResource; - }); - } -} 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..064624b885e3 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Private Endpoint Connection properties. + */ +@Fluent +public final class PrivateEndpointConnectionProperties + implements JsonSerializable { + /* + * State of Private Endpoint Connection. + */ + private PrivateEndpointConnectionProvisioningState provisioningState; + + /* + * Represents a Private Endpoint that is connected to Notification Hubs namespace using Private Endpoint Connection. + */ + private RemotePrivateEndpointConnection privateEndpoint; + + /* + * List of group ids. For Notification Hubs, it always contains a single "namespace" element. + */ + private List groupIds; + + /* + * State of the Private Link Service connection. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + jsonWriter.writeJsonField("privateEndpoint", this.privateEndpoint); + jsonWriter.writeJsonField("privateLinkServiceConnectionState", this.privateLinkServiceConnectionState); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateEndpointConnectionProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateEndpointConnectionProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateEndpointConnectionProperties. + */ + public static PrivateEndpointConnectionProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateEndpointConnectionProperties deserializedPrivateEndpointConnectionProperties + = new PrivateEndpointConnectionProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.provisioningState + = PrivateEndpointConnectionProvisioningState.fromString(reader.getString()); + } else if ("privateEndpoint".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateEndpoint + = RemotePrivateEndpointConnection.fromJson(reader); + } else if ("groupIds".equals(fieldName)) { + List groupIds = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateEndpointConnectionProperties.groupIds = groupIds; + } else if ("privateLinkServiceConnectionState".equals(fieldName)) { + deserializedPrivateEndpointConnectionProperties.privateLinkServiceConnectionState + = RemotePrivateLinkServiceConnectionState.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateEndpointConnectionProperties; + }); + } +} 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..fed2a2ae7537 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProvisioningState.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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..5d9c87af1ddd --- /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) TypeSpec 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/PrivateEndpointConnections.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnections.java new file mode 100644 index 000000000000..4ef5aa5480d6 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnections.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 { + /** + * 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); + + /** + * 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 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 a PrivateEndpointConnectionResource list 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 a PrivateEndpointConnectionResource list operation as paginated response with + * {@link PagedIterable}. + */ + PagedIterable list(String resourceGroupName, String namespaceName, + Context context); + + /** + * 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); + + /** + * 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); + + /** + * 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 a PrivateLinkResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listGroupIds(String resourceGroupName, String namespaceName); + + /** + * 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 a PrivateLinkResource list 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..c66c3db22d79 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkConnectionStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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..1a8360989e9e --- /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) TypeSpec 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/PrivateLinkResourceProperties.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceProperties.java new file mode 100644 index 000000000000..86de189e682f --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceProperties.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represents properties of Private Link Resource. + */ +@Immutable +public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * A Group Id for Private Link. For Notification Hubs, it is always set to "namespace". + */ + private String groupId; + + /* + * Required members. For Notification Hubs, it's always a collection with a single "namespace" item. + */ + private List requiredMembers; + + /* + * Required DNS zone names. For Notification Hubs, it contains two CNames for Service Bus and Notification Hubs + * zones. + */ + private List requiredZoneNames; + + /** + * Creates an instance of PrivateLinkResourceProperties class. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PrivateLinkResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PrivateLinkResourceProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PrivateLinkResourceProperties. + */ + public static PrivateLinkResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PrivateLinkResourceProperties deserializedPrivateLinkResourceProperties + = new PrivateLinkResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("groupId".equals(fieldName)) { + deserializedPrivateLinkResourceProperties.groupId = reader.getString(); + } else if ("requiredMembers".equals(fieldName)) { + List requiredMembers = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredMembers = requiredMembers; + } else if ("requiredZoneNames".equals(fieldName)) { + List requiredZoneNames = reader.readArray(reader1 -> reader1.getString()); + deserializedPrivateLinkResourceProperties.requiredZoneNames = requiredZoneNames; + } else { + reader.skipChildren(); + } + } + + return deserializedPrivateLinkResourceProperties; + }); + } +} 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..99129fbb8d3d --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicInternetAuthorizationRule.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +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 implements JsonSerializable { + /* + * List of access rights. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("rights", this.rights, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicInternetAuthorizationRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicInternetAuthorizationRule if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PublicInternetAuthorizationRule. + */ + public static PublicInternetAuthorizationRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicInternetAuthorizationRule deserializedPublicInternetAuthorizationRule + = new PublicInternetAuthorizationRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("rights".equals(fieldName)) { + List rights + = reader.readArray(reader1 -> AccessRights.fromString(reader1.getString())); + deserializedPublicInternetAuthorizationRule.rights = rights; + } else { + reader.skipChildren(); + } + } + + return deserializedPublicInternetAuthorizationRule; + }); + } +} 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..4f662a9dd678 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicNetworkAccess.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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..d5e4e5e6de84 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RegistrationResult.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Notification result for a single registration. + */ +@Immutable +public final class RegistrationResult implements JsonSerializable { + /* + * PNS type. + */ + private String applicationPlatform; + + /* + * PNS handle. + */ + private String pnsHandle; + + /* + * Registration id. + */ + private String registrationId; + + /* + * Notification outcome. + */ + private String outcome; + + /** + * Creates an instance of RegistrationResult class. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RegistrationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RegistrationResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the RegistrationResult. + */ + public static RegistrationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RegistrationResult deserializedRegistrationResult = new RegistrationResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("applicationPlatform".equals(fieldName)) { + deserializedRegistrationResult.applicationPlatform = reader.getString(); + } else if ("pnsHandle".equals(fieldName)) { + deserializedRegistrationResult.pnsHandle = reader.getString(); + } else if ("registrationId".equals(fieldName)) { + deserializedRegistrationResult.registrationId = reader.getString(); + } else if ("outcome".equals(fieldName)) { + deserializedRegistrationResult.outcome = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRegistrationResult; + }); + } +} 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..c2c6c0f99735 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateEndpointConnection.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents a Private Endpoint that is connected to Notification Hubs namespace using Private Endpoint Connection. + */ +@Immutable +public final class RemotePrivateEndpointConnection implements JsonSerializable { + /* + * ARM resource ID of the Private Endpoint. This may belong to different subscription and resource group than a + * Notification Hubs namespace. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemotePrivateEndpointConnection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemotePrivateEndpointConnection if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RemotePrivateEndpointConnection. + */ + public static RemotePrivateEndpointConnection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RemotePrivateEndpointConnection deserializedRemotePrivateEndpointConnection + = new RemotePrivateEndpointConnection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRemotePrivateEndpointConnection.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRemotePrivateEndpointConnection; + }); + } +} 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..3aec111d09f8 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateLinkServiceConnectionState.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * State of the Private Link Service connection. + */ +@Fluent +public final class RemotePrivateLinkServiceConnectionState + implements JsonSerializable { + /* + * State of Private Link Connection. + */ + private PrivateLinkConnectionStatus status; + + /* + * Human-friendly description. + */ + private String description; + + /* + * Human-friendly description of required actions. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RemotePrivateLinkServiceConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RemotePrivateLinkServiceConnectionState if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the RemotePrivateLinkServiceConnectionState. + */ + public static RemotePrivateLinkServiceConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RemotePrivateLinkServiceConnectionState deserializedRemotePrivateLinkServiceConnectionState + = new RemotePrivateLinkServiceConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedRemotePrivateLinkServiceConnectionState.status + = PrivateLinkConnectionStatus.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedRemotePrivateLinkServiceConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedRemotePrivateLinkServiceConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRemotePrivateLinkServiceConnectionState; + }); + } +} 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..63e9bbd97e16 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ReplicationRegion.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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 aaf504af1a0f..1e4f3ebab20d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -11,35 +11,36 @@ */ 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. */ 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..e3e7f135eddf --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ServiceSpecification.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Optional service specification used in Operations API. + */ +@Immutable +public final class ServiceSpecification implements JsonSerializable { + /* + * Log specifications. + */ + private List logSpecifications; + + /* + * Metric specification. + */ + private List metricSpecifications; + + /** + * Creates an instance of ServiceSpecification class. + */ + private 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceSpecification from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceSpecification if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceSpecification. + */ + public static ServiceSpecification fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceSpecification deserializedServiceSpecification = new ServiceSpecification(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("logSpecifications".equals(fieldName)) { + List logSpecifications + = reader.readArray(reader1 -> LogSpecification.fromJson(reader1)); + deserializedServiceSpecification.logSpecifications = logSpecifications; + } else if ("metricSpecifications".equals(fieldName)) { + List metricSpecifications + = reader.readArray(reader1 -> MetricSpecification.fromJson(reader1)); + deserializedServiceSpecification.metricSpecifications = metricSpecifications; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceSpecification; + }); + } +} 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 556b81b6df7f..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleCreateOrUpdateParameters.java +++ /dev/null @@ -1,111 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; -import java.io.IOException; - -/** - * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. - */ -@Fluent -public final class SharedAccessAuthorizationRuleCreateOrUpdateParameters - implements JsonSerializable { - /* - * Properties of the Namespace AuthorizationRules. - */ - private SharedAccessAuthorizationRuleProperties properties; - - /** - * Creates an instance of SharedAccessAuthorizationRuleCreateOrUpdateParameters class. - */ - public SharedAccessAuthorizationRuleCreateOrUpdateParameters() { - } - - /** - * 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.atError() - .log(new IllegalArgumentException( - "Missing required property properties in model SharedAccessAuthorizationRuleCreateOrUpdateParameters")); - } else { - properties().validate(); - } - } - - private static final ClientLogger LOGGER - = new ClientLogger(SharedAccessAuthorizationRuleCreateOrUpdateParameters.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SharedAccessAuthorizationRuleCreateOrUpdateParameters from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SharedAccessAuthorizationRuleCreateOrUpdateParameters if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SharedAccessAuthorizationRuleCreateOrUpdateParameters. - */ - public static SharedAccessAuthorizationRuleCreateOrUpdateParameters fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - SharedAccessAuthorizationRuleCreateOrUpdateParameters deserializedSharedAccessAuthorizationRuleCreateOrUpdateParameters - = new SharedAccessAuthorizationRuleCreateOrUpdateParameters(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("properties".equals(fieldName)) { - deserializedSharedAccessAuthorizationRuleCreateOrUpdateParameters.properties - = SharedAccessAuthorizationRuleProperties.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedSharedAccessAuthorizationRuleCreateOrUpdateParameters; - }); - } -} 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 34d0d7d4fa92..23afaefb73b0 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 @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.SharedAccessAuthorizationRuleProperties; import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -38,84 +39,86 @@ public interface SharedAccessAuthorizationRuleResource { String type(); /** - * Gets the location property: The geo-location where the resource lives. + * Gets the location property: The location property. * * @return the location value. */ String location(); /** - * Gets the tags property: Resource tags. + * Gets the tags property: The tags property. * * @return the tags value. */ Map tags(); /** - * Gets the sku property: The sku of the created namespace. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the sku value. + * @return the systemData value. */ - Sku sku(); + SystemData systemData(); /** - * Gets the rights property: The rights associated with the rule. + * Gets the rights property: Gets or sets 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. + * Gets the primaryKey property: Gets 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. + * Gets the secondaryKey property: Gets 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. + * Gets the keyName property: Gets a string that describes the authorization rule. * * @return the keyName value. */ String keyName(); /** - * Gets the claimType property: A string that describes the claim type. + * Gets the modifiedTime property: Gets the last modified time for this rule. * - * @return the claimType value. + * @return the modifiedTime value. */ - String claimType(); + OffsetDateTime modifiedTime(); /** - * Gets the claimValue property: A string that describes the claim value. + * Gets the createdTime property: Gets the created time for this rule. * - * @return the claimValue value. + * @return the createdTime value. */ - String claimValue(); + OffsetDateTime createdTime(); /** - * Gets the modifiedTime property: The last modified time for this rule. + * Gets the claimType property: Gets a string that describes the claim type. * - * @return the modifiedTime value. + * @return the claimType value. */ - String modifiedTime(); + String claimType(); /** - * Gets the createdTime property: The created time for this rule. + * Gets the claimValue property: Gets a string that describes the claim value. * - * @return the createdTime value. + * @return the claimValue value. */ - String createdTime(); + String claimValue(); /** - * Gets the revision property: The revision number for the rule. + * Gets the revision property: Gets the revision number for the rule. * * @return the revision value. */ @@ -153,8 +156,8 @@ public interface SharedAccessAuthorizationRuleResource { /** * The entirety of the SharedAccessAuthorizationRuleResource definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, - DefinitionStages.WithProperties, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { } /** @@ -174,31 +177,19 @@ 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. */ - 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 withExistingNamespace(String resourceGroupName, String namespaceName); } /** * 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.WithRights, DefinitionStages.WithPrimaryKey, DefinitionStages.WithSecondaryKey { /** * Executes the create request. * @@ -214,6 +205,83 @@ interface WithCreate { */ SharedAccessAuthorizationRuleResource create(Context context); } + + /** + * The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The location property. + * @return the next definition stage. + */ + WithCreate withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The location property. + * @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: The tags property.. + * + * @param tags The tags property. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify rights. + */ + interface WithRights { + /** + * Specifies the rights property: Gets or sets the rights associated with the rule.. + * + * @param rights Gets or sets the rights associated with the rule. + * @return the next definition stage. + */ + WithCreate withRights(List rights); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify primaryKey. + */ + interface WithPrimaryKey { + /** + * Specifies the primaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token.. + * + * @param primaryKey Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + * @return the next definition stage. + */ + WithCreate withPrimaryKey(String primaryKey); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource definition allowing to specify secondaryKey. + */ + interface WithSecondaryKey { + /** + * Specifies the secondaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token.. + * + * @param secondaryKey Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + * @return the next definition stage. + */ + WithCreate withSecondaryKey(String secondaryKey); + } } /** @@ -226,7 +294,8 @@ interface WithCreate { /** * The template for SharedAccessAuthorizationRuleResource update. */ - interface Update extends UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithRights, UpdateStages.WithPrimaryKey, + UpdateStages.WithSecondaryKey { /** * Executes the update request. * @@ -248,16 +317,59 @@ interface Update extends UpdateStages.WithProperties { */ 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: The tags property.. + * + * @param tags The tags property. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource update allowing to specify rights. + */ + interface WithRights { + /** + * Specifies the rights property: Gets or sets the rights associated with the rule.. + * + * @param rights Gets or sets the rights associated with the rule. + * @return the next definition stage. + */ + Update withRights(List rights); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource update allowing to specify primaryKey. + */ + interface WithPrimaryKey { + /** + * Specifies the primaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token.. + * + * @param primaryKey Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. + * @return the next definition stage. + */ + Update withPrimaryKey(String primaryKey); + } + + /** + * The stage of the SharedAccessAuthorizationRuleResource update allowing to specify secondaryKey. */ - interface WithProperties { + interface WithSecondaryKey { /** - * Specifies the properties property: Properties of the Namespace AuthorizationRules.. + * Specifies the secondaryKey property: Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token.. * - * @param properties Properties of the Namespace AuthorizationRules. + * @param secondaryKey Gets a base64-encoded 256-bit primary key for signing and + * validating the SAS token. * @return the next definition stage. */ - Update withProperties(SharedAccessAuthorizationRuleProperties properties); + Update withSecondaryKey(String secondaryKey); } } @@ -299,23 +411,24 @@ interface WithProperties { /** * Regenerates the Primary/Secondary Keys to the Namespace Authorization Rule. * - * @param parameters Parameters supplied to regenerate the Namespace Authorization Rule Key. + * @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 along with {@link Response}. + * @return response for the POST request that returns Namespace or NotificationHub access keys (connection strings) + * along with {@link Response}. */ - Response regenerateKeysWithResponse(PolicykeyResource parameters, Context context); + 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 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). */ - ResourceListKeys regenerateKeys(PolicykeyResource parameters); + 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 bdec774e9217..b16b554c55e8 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -18,27 +17,27 @@ @Fluent public final class Sku implements JsonSerializable { /* - * Name of the notification hub sku + * Namespace SKU name. */ private SkuName name; /* - * The tier of particular sku + * Gets or sets the tier of particular sku */ private String tier; /* - * The Sku size + * Gets or sets the Sku size */ private String size; /* - * The Sku Family + * Gets or sets the Sku Family */ private String family; /* - * The capacity of the resource + * Gets or sets the capacity of the resource */ private Integer capacity; @@ -49,7 +48,7 @@ public Sku() { } /** - * Get the name property: Name of the notification hub sku. + * Get the name property: Namespace SKU name. * * @return the name value. */ @@ -58,7 +57,7 @@ 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. @@ -69,7 +68,7 @@ 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. */ @@ -78,7 +77,7 @@ 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. @@ -89,7 +88,7 @@ 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. */ @@ -98,7 +97,7 @@ 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. @@ -109,7 +108,7 @@ 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. */ @@ -118,7 +117,7 @@ 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. @@ -129,7 +128,7 @@ 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. */ @@ -138,7 +137,7 @@ 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. @@ -148,19 +147,6 @@ public Sku withCapacity(Integer capacity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError().log(new IllegalArgumentException("Missing required property name in model Sku")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Sku.class); - /** * {@inheritDoc} */ 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 434a76e4811c..04c0487a59f1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -8,7 +8,7 @@ import java.util.Collection; /** - * Name of the notification hub sku. + * Namespace SKU name. */ public final class SkuName extends ExpandableStringEnum { /** 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 4042f87d1915..b1a8e1cd8d31 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.models; @@ -18,9 +18,9 @@ @Fluent public final class WnsCredential implements JsonSerializable { /* - * Properties of NotificationHub WnsCredential. + * Description of a NotificationHub WnsCredential. */ - private WnsCredentialProperties innerProperties; + private WnsCredentialProperties innerProperties = new WnsCredentialProperties(); /** * Creates an instance of WnsCredential class. @@ -29,7 +29,7 @@ public WnsCredential() { } /** - * Get the innerProperties property: Properties of NotificationHub WnsCredential. + * Get the innerProperties property: Description of a NotificationHub WnsCredential. * * @return the innerProperties value. */ @@ -38,7 +38,7 @@ private WnsCredentialProperties innerProperties() { } /** - * Get the packageSid property: The package ID for this credential. + * Get the packageSid property: Gets or sets the package ID for this credential. * * @return the packageSid value. */ @@ -47,7 +47,7 @@ public String packageSid() { } /** - * Set the packageSid property: The package ID for this credential. + * Set the packageSid property: Gets or sets the package ID for this credential. * * @param packageSid the packageSid value to set. * @return the WnsCredential object itself. @@ -61,7 +61,7 @@ public WnsCredential withPackageSid(String packageSid) { } /** - * Get the secretKey property: The secret key. + * Get the secretKey property: Gets or sets the secret key. * * @return the secretKey value. */ @@ -70,7 +70,7 @@ public String secretKey() { } /** - * Set the secretKey property: The secret key. + * Set the secretKey property: Gets or sets the secret key. * * @param secretKey the secretKey value to set. * @return the WnsCredential object itself. @@ -84,7 +84,7 @@ public WnsCredential withSecretKey(String secretKey) { } /** - * Get the windowsLiveEndpoint property: The Windows Live endpoint. + * Get the windowsLiveEndpoint property: Gets or sets the Windows Live endpoint. * * @return the windowsLiveEndpoint value. */ @@ -93,7 +93,7 @@ public String windowsLiveEndpoint() { } /** - * Set the windowsLiveEndpoint property: The Windows Live endpoint. + * Set the windowsLiveEndpoint property: Gets or sets the Windows Live endpoint. * * @param windowsLiveEndpoint the windowsLiveEndpoint value to set. * @return the WnsCredential object itself. @@ -107,14 +107,49 @@ public WnsCredential withWindowsLiveEndpoint(String windowsLiveEndpoint) { } /** - * Validates the instance. + * Get the certificateKey property: Ges or sets the WNS Certificate Key. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the certificateKey value. */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + public String certificateKey() { + return this.innerProperties() == null ? null : this.innerProperties().certificateKey(); + } + + /** + * Set the certificateKey property: Ges or sets the WNS Certificate Key. + * + * @param certificateKey the certificateKey value to set. + * @return the WnsCredential object itself. + */ + public WnsCredential withCertificateKey(String certificateKey) { + if (this.innerProperties() == null) { + this.innerProperties = new WnsCredentialProperties(); + } + this.innerProperties().withCertificateKey(certificateKey); + return this; + } + + /** + * Get the wnsCertificate property: Gets or sets the WNS Certificate. + * + * @return the wnsCertificate value. + */ + public String wnsCertificate() { + return this.innerProperties() == null ? null : this.innerProperties().wnsCertificate(); + } + + /** + * Set the wnsCertificate property: Gets or sets the WNS Certificate. + * + * @param wnsCertificate the wnsCertificate value to set. + * @return the WnsCredential object itself. + */ + public WnsCredential withWnsCertificate(String wnsCertificate) { + if (this.innerProperties() == null) { + this.innerProperties = new WnsCredentialProperties(); } + this.innerProperties().withWnsCertificate(wnsCertificate); + return this; } /** @@ -133,6 +168,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of WnsCredential if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the WnsCredential. */ public static WnsCredential fromJson(JsonReader jsonReader) throws IOException { 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..eca30ae70647 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredential.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.notificationhubs.fluent.models.XiaomiCredentialProperties; +import java.io.IOException; + +/** + * Description of a NotificationHub XiaomiCredential. + */ +@Fluent +public final class XiaomiCredential implements JsonSerializable { + /* + * Description of a NotificationHub XiaomiCredentialProperties. + */ + private XiaomiCredentialProperties innerProperties = new XiaomiCredentialProperties(); + + /** + * Creates an instance of XiaomiCredential class. + */ + public XiaomiCredential() { + } + + /** + * Get the innerProperties property: Description of a NotificationHub XiaomiCredentialProperties. + * + * @return the innerProperties value. + */ + private XiaomiCredentialProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the appSecret property: Gets or sets app secret. + * + * @return the appSecret value. + */ + public String appSecret() { + return this.innerProperties() == null ? null : this.innerProperties().appSecret(); + } + + /** + * Set the appSecret property: Gets or sets app secret. + * + * @param appSecret the appSecret value to set. + * @return the XiaomiCredential object itself. + */ + public XiaomiCredential withAppSecret(String appSecret) { + if (this.innerProperties() == null) { + this.innerProperties = new XiaomiCredentialProperties(); + } + this.innerProperties().withAppSecret(appSecret); + return this; + } + + /** + * Get the endpoint property: Gets or sets xiaomi service endpoint. + * + * @return the endpoint value. + */ + public String endpoint() { + return this.innerProperties() == null ? null : this.innerProperties().endpoint(); + } + + /** + * Set the endpoint property: Gets or sets xiaomi service endpoint. + * + * @param endpoint the endpoint value to set. + * @return the XiaomiCredential object itself. + */ + public XiaomiCredential withEndpoint(String endpoint) { + if (this.innerProperties() == null) { + this.innerProperties = new XiaomiCredentialProperties(); + } + this.innerProperties().withEndpoint(endpoint); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of XiaomiCredential from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of XiaomiCredential if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the XiaomiCredential. + */ + public static XiaomiCredential fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + XiaomiCredential deserializedXiaomiCredential = new XiaomiCredential(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedXiaomiCredential.innerProperties = XiaomiCredentialProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedXiaomiCredential; + }); + } +} 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..a9b275beac67 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/java/com/azure/resourcemanager/notificationhubs/models/ZoneRedundancyPreference.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.models; + +import com.azure.core.util.ExpandableStringEnum; +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. + */ + 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 b03d3def3d54..8b15408633bf 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the data models for NotificationHubsManagementClient. - * Azure NotificationHub client. + * 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 97642cf41862..15f0ff9fc3bf 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 @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** * Package containing the classes for NotificationHubsManagementClient. - * Azure NotificationHub client. + * 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 69564d4da16f..655b18add909 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.notificationhubs { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.notificationhubs.fluent.models to com.azure.core; opens com.azure.resourcemanager.notificationhubs.models to com.azure.core; + opens com.azure.resourcemanager.notificationhubs.implementation.models to com.azure.core; } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/azure-resourcemanager-notificationhubs_metadata.json b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/azure-resourcemanager-notificationhubs_metadata.json new file mode 100644 index 000000000000..4e35f4eaa370 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/META-INF/azure-resourcemanager-notificationhubs_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.NotificationHubs":"2023-10-01-preview"},"crossLanguageDefinitions":{"com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient":"Microsoft.NotificationHubs.Namespaces","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.beginCreateOrUpdate":"Microsoft.NotificationHubs.NamespaceResources.createOrUpdate","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.checkAvailability":"Microsoft.NotificationHubs.NamespacesOperationGroup.checkAvailability","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.checkAvailabilityWithResponse":"Microsoft.NotificationHubs.NamespacesOperationGroup.checkAvailability","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.createOrUpdate":"Microsoft.NotificationHubs.NamespaceResources.createOrUpdate","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.createOrUpdateAuthorizationRule":"Microsoft.NotificationHubs.Namespaces.createOrUpdateAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.createOrUpdateAuthorizationRuleWithResponse":"Microsoft.NotificationHubs.Namespaces.createOrUpdateAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.delete":"Microsoft.NotificationHubs.NamespaceResources.delete","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.deleteAuthorizationRule":"Microsoft.NotificationHubs.Namespaces.deleteAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.deleteAuthorizationRuleWithResponse":"Microsoft.NotificationHubs.Namespaces.deleteAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.deleteWithResponse":"Microsoft.NotificationHubs.NamespaceResources.delete","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.getAuthorizationRule":"Microsoft.NotificationHubs.Namespaces.getAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.getAuthorizationRuleWithResponse":"Microsoft.NotificationHubs.Namespaces.getAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.getByResourceGroup":"Microsoft.NotificationHubs.NamespaceResources.get","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.getByResourceGroupWithResponse":"Microsoft.NotificationHubs.NamespaceResources.get","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.getPnsCredentials":"Microsoft.NotificationHubs.NamespaceResources.getPnsCredentials","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.getPnsCredentialsWithResponse":"Microsoft.NotificationHubs.NamespaceResources.getPnsCredentials","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.list":"Microsoft.NotificationHubs.NamespaceResources.listAll","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.listAuthorizationRules":"Microsoft.NotificationHubs.Namespaces.listAuthorizationRules","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.listByResourceGroup":"Microsoft.NotificationHubs.NamespaceResources.list","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.listKeys":"Microsoft.NotificationHubs.Namespaces.listKeys","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.listKeysWithResponse":"Microsoft.NotificationHubs.Namespaces.listKeys","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.regenerateKeys":"Microsoft.NotificationHubs.Namespaces.regenerateKeys","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.regenerateKeysWithResponse":"Microsoft.NotificationHubs.Namespaces.regenerateKeys","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.update":"Microsoft.NotificationHubs.NamespaceResources.update","com.azure.resourcemanager.notificationhubs.fluent.NamespacesClient.updateWithResponse":"Microsoft.NotificationHubs.NamespaceResources.update","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient":"Microsoft.NotificationHubs","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.checkNotificationHubAvailability":"Microsoft.NotificationHubs.NamespaceResources.checkNotificationHubAvailability","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.checkNotificationHubAvailabilityWithResponse":"Microsoft.NotificationHubs.NamespaceResources.checkNotificationHubAvailability","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.createOrUpdate":"Microsoft.NotificationHubs.NotificationHubResources.createOrUpdate","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.createOrUpdateAuthorizationRule":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.createOrUpdateAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.createOrUpdateAuthorizationRuleWithResponse":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.createOrUpdateAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.createOrUpdateWithResponse":"Microsoft.NotificationHubs.NotificationHubResources.createOrUpdate","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.debugSend":"Microsoft.NotificationHubs.NotificationHubResources.debugSend","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.debugSendWithResponse":"Microsoft.NotificationHubs.NotificationHubResources.debugSend","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.delete":"Microsoft.NotificationHubs.NotificationHubResources.delete","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.deleteAuthorizationRule":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.deleteAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.deleteAuthorizationRuleWithResponse":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.deleteAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.deleteWithResponse":"Microsoft.NotificationHubs.NotificationHubResources.delete","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.get":"Microsoft.NotificationHubs.NotificationHubResources.get","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.getAuthorizationRule":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.getAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.getAuthorizationRuleWithResponse":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.getAuthorizationRule","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.getPnsCredentials":"Microsoft.NotificationHubs.NotificationHubResources.getPnsCredentials","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.getPnsCredentialsWithResponse":"Microsoft.NotificationHubs.NotificationHubResources.getPnsCredentials","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.getWithResponse":"Microsoft.NotificationHubs.NotificationHubResources.get","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.list":"Microsoft.NotificationHubs.NotificationHubResources.list","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.listAuthorizationRules":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.listAuthorizationRules","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.listKeys":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.listKeys","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.listKeysWithResponse":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.listKeys","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.regenerateKeys":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.regenerateKeys","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.regenerateKeysWithResponse":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResources.regenerateKeys","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.update":"Microsoft.NotificationHubs.NotificationHubResources.update","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsClient.updateWithResponse":"Microsoft.NotificationHubs.NotificationHubResources.update","com.azure.resourcemanager.notificationhubs.fluent.NotificationHubsManagementClient":"Microsoft.NotificationHubs","com.azure.resourcemanager.notificationhubs.fluent.OperationsClient":"Microsoft.NotificationHubs.Operations","com.azure.resourcemanager.notificationhubs.fluent.OperationsClient.list":"Azure.ResourceManager.Legacy.Operations.list","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient":"Microsoft.NotificationHubs","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.beginDelete":"Microsoft.NotificationHubs.PrivateEndpointConnectionResources.delete","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.beginUpdate":"Microsoft.NotificationHubs.PrivateEndpointConnectionResources.update","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.delete":"Microsoft.NotificationHubs.PrivateEndpointConnectionResources.delete","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.get":"Microsoft.NotificationHubs.PrivateEndpointConnectionResources.get","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.getGroupId":"Microsoft.NotificationHubs.PrivateLinkResources.getGroupId","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.getGroupIdWithResponse":"Microsoft.NotificationHubs.PrivateLinkResources.getGroupId","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.getWithResponse":"Microsoft.NotificationHubs.PrivateEndpointConnectionResources.get","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.list":"Microsoft.NotificationHubs.PrivateEndpointConnectionResources.list","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.listGroupIds":"Microsoft.NotificationHubs.PrivateLinkResources.listGroupIds","com.azure.resourcemanager.notificationhubs.fluent.PrivateEndpointConnectionsClient.update":"Microsoft.NotificationHubs.PrivateEndpointConnectionResources.update","com.azure.resourcemanager.notificationhubs.fluent.models.AdmCredentialProperties":"Microsoft.NotificationHubs.AdmCredentialProperties","com.azure.resourcemanager.notificationhubs.fluent.models.ApnsCredentialProperties":"Microsoft.NotificationHubs.ApnsCredentialProperties","com.azure.resourcemanager.notificationhubs.fluent.models.BaiduCredentialProperties":"Microsoft.NotificationHubs.BaiduCredentialProperties","com.azure.resourcemanager.notificationhubs.fluent.models.BrowserCredentialProperties":"Microsoft.NotificationHubs.BrowserCredentialProperties","com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner":"Microsoft.NotificationHubs.CheckAvailabilityResult","com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner":"Microsoft.NotificationHubs.DebugSendResponse","com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResult":"Microsoft.NotificationHubs.DebugSendResult","com.azure.resourcemanager.notificationhubs.fluent.models.FcmV1CredentialProperties":"Microsoft.NotificationHubs.FcmV1CredentialProperties","com.azure.resourcemanager.notificationhubs.fluent.models.GcmCredentialProperties":"Microsoft.NotificationHubs.GcmCredentialProperties","com.azure.resourcemanager.notificationhubs.fluent.models.MpnsCredentialProperties":"Microsoft.NotificationHubs.MpnsCredentialProperties","com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceProperties":"Microsoft.NotificationHubs.NamespaceProperties","com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner":"Microsoft.NotificationHubs.NamespaceResource","com.azure.resourcemanager.notificationhubs.fluent.models.NotificationHubProperties":"Microsoft.NotificationHubs.NotificationHubProperties","com.azure.resourcemanager.notificationhubs.fluent.models.NotificationHubResourceInner":"Microsoft.NotificationHubs.NotificationHubResource","com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner":"Microsoft.NotificationHubs.Operation","com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentials":"Microsoft.NotificationHubs.PnsCredentials","com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentialsResourceInner":"Microsoft.NotificationHubs.PnsCredentialsResource","com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner":"Microsoft.NotificationHubs.PrivateEndpointConnectionResource","com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner":"Microsoft.NotificationHubs.PrivateLinkResource","com.azure.resourcemanager.notificationhubs.fluent.models.ResourceListKeysInner":"Microsoft.NotificationHubs.ResourceListKeys","com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleProperties","com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleResourceInner":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleResource","com.azure.resourcemanager.notificationhubs.fluent.models.WnsCredentialProperties":"Microsoft.NotificationHubs.WnsCredentialProperties","com.azure.resourcemanager.notificationhubs.fluent.models.XiaomiCredentialProperties":"Microsoft.NotificationHubs.XiaomiCredentialProperties","com.azure.resourcemanager.notificationhubs.implementation.NotificationHubsManagementClientBuilder":"Microsoft.NotificationHubs","com.azure.resourcemanager.notificationhubs.implementation.models.NamespaceListResult":"Microsoft.NotificationHubs.NamespaceListResult","com.azure.resourcemanager.notificationhubs.implementation.models.NotificationHubListResult":"Microsoft.NotificationHubs.NotificationHubListResult","com.azure.resourcemanager.notificationhubs.implementation.models.OperationListResult":"Microsoft.NotificationHubs.OperationListResult","com.azure.resourcemanager.notificationhubs.implementation.models.PrivateEndpointConnectionResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.notificationhubs.implementation.models.PrivateLinkResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.notificationhubs.implementation.models.SharedAccessAuthorizationRuleListResult":"Microsoft.NotificationHubs.SharedAccessAuthorizationRuleListResult","com.azure.resourcemanager.notificationhubs.models.AccessRights":"Microsoft.NotificationHubs.AccessRights","com.azure.resourcemanager.notificationhubs.models.AdmCredential":"Microsoft.NotificationHubs.AdmCredential","com.azure.resourcemanager.notificationhubs.models.ApnsCredential":"Microsoft.NotificationHubs.ApnsCredential","com.azure.resourcemanager.notificationhubs.models.Availability":"Microsoft.NotificationHubs.Availability","com.azure.resourcemanager.notificationhubs.models.BaiduCredential":"Microsoft.NotificationHubs.BaiduCredential","com.azure.resourcemanager.notificationhubs.models.BrowserCredential":"Microsoft.NotificationHubs.BrowserCredential","com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters":"Microsoft.NotificationHubs.CheckAvailabilityParameters","com.azure.resourcemanager.notificationhubs.models.FcmV1Credential":"Microsoft.NotificationHubs.FcmV1Credential","com.azure.resourcemanager.notificationhubs.models.GcmCredential":"Microsoft.NotificationHubs.GcmCredential","com.azure.resourcemanager.notificationhubs.models.IpRule":"Microsoft.NotificationHubs.IpRule","com.azure.resourcemanager.notificationhubs.models.LogSpecification":"Microsoft.NotificationHubs.LogSpecification","com.azure.resourcemanager.notificationhubs.models.MetricSpecification":"Microsoft.NotificationHubs.MetricSpecification","com.azure.resourcemanager.notificationhubs.models.MpnsCredential":"Microsoft.NotificationHubs.MpnsCredential","com.azure.resourcemanager.notificationhubs.models.NamespacePatchParameters":"Microsoft.NotificationHubs.NamespacePatchParameters","com.azure.resourcemanager.notificationhubs.models.NamespaceStatus":"Microsoft.NotificationHubs.NamespaceStatus","com.azure.resourcemanager.notificationhubs.models.NamespaceType":"Microsoft.NotificationHubs.NamespaceType","com.azure.resourcemanager.notificationhubs.models.NetworkAcls":"Microsoft.NotificationHubs.NetworkAcls","com.azure.resourcemanager.notificationhubs.models.NotificationHubPatchParameters":"Microsoft.NotificationHubs.NotificationHubPatchParameters","com.azure.resourcemanager.notificationhubs.models.OperationDisplay":"Microsoft.NotificationHubs.OperationDisplay","com.azure.resourcemanager.notificationhubs.models.OperationProperties":"Microsoft.NotificationHubs.OperationProperties","com.azure.resourcemanager.notificationhubs.models.OperationProvisioningState":"Microsoft.NotificationHubs.OperationProvisioningState","com.azure.resourcemanager.notificationhubs.models.PolicyKeyResource":"Microsoft.NotificationHubs.PolicyKeyResource","com.azure.resourcemanager.notificationhubs.models.PolicyKeyType":"Microsoft.NotificationHubs.PolicyKeyType","com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties":"Microsoft.NotificationHubs.PrivateEndpointConnectionProperties","com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProvisioningState":"Microsoft.NotificationHubs.PrivateEndpointConnectionProvisioningState","com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus":"Microsoft.NotificationHubs.PrivateLinkConnectionStatus","com.azure.resourcemanager.notificationhubs.models.PrivateLinkResourceProperties":"Microsoft.NotificationHubs.PrivateLinkResourceProperties","com.azure.resourcemanager.notificationhubs.models.PublicInternetAuthorizationRule":"Microsoft.NotificationHubs.PublicInternetAuthorizationRule","com.azure.resourcemanager.notificationhubs.models.PublicNetworkAccess":"Microsoft.NotificationHubs.PublicNetworkAccess","com.azure.resourcemanager.notificationhubs.models.RegistrationResult":"Microsoft.NotificationHubs.RegistrationResult","com.azure.resourcemanager.notificationhubs.models.RemotePrivateEndpointConnection":"Microsoft.NotificationHubs.RemotePrivateEndpointConnection","com.azure.resourcemanager.notificationhubs.models.RemotePrivateLinkServiceConnectionState":"Microsoft.NotificationHubs.RemotePrivateLinkServiceConnectionState","com.azure.resourcemanager.notificationhubs.models.ReplicationRegion":"Microsoft.NotificationHubs.ReplicationRegion","com.azure.resourcemanager.notificationhubs.models.ServiceSpecification":"Microsoft.NotificationHubs.ServiceSpecification","com.azure.resourcemanager.notificationhubs.models.Sku":"Microsoft.NotificationHubs.Sku","com.azure.resourcemanager.notificationhubs.models.SkuName":"Microsoft.NotificationHubs.SkuName","com.azure.resourcemanager.notificationhubs.models.WnsCredential":"Microsoft.NotificationHubs.WnsCredential","com.azure.resourcemanager.notificationhubs.models.XiaomiCredential":"Microsoft.NotificationHubs.XiaomiCredential","com.azure.resourcemanager.notificationhubs.models.ZoneRedundancyPreference":"Microsoft.NotificationHubs.ZoneRedundancyPreference"},"generatedFiles":["src/main/java/com/azure/resourcemanager/notificationhubs/NotificationHubsManager.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NamespacesClient.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsClient.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/NotificationHubsManagementClient.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/AdmCredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ApnsCredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BaiduCredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/BrowserCredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/CheckAvailabilityResultInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResponseInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/DebugSendResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/FcmV1CredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/GcmCredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/MpnsCredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NamespaceResourceInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/NotificationHubResourceInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentials.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PnsCredentialsResourceInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateEndpointConnectionResourceInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/ResourceListKeysInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/SharedAccessAuthorizationRuleResourceInner.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/WnsCredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/XiaomiCredentialProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/notificationhubs/fluent/package-info.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/CheckAvailabilityResultImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/DebugSendResponseImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespaceResourceImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesClientImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NamespacesImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubResourceImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsClientImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/NotificationHubsManagementClientImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PnsCredentialsResourceImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionResourceImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateEndpointConnectionsImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/PrivateLinkResourceImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceListKeysImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/SharedAccessAuthorizationRuleResourceImpl.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/NamespaceListResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/NotificationHubListResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateEndpointConnectionResourceListResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/models/SharedAccessAuthorizationRuleListResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/implementation/package-info.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/AccessRights.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/AdmCredential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/ApnsCredential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/Availability.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/BaiduCredential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/BrowserCredential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityParameters.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/CheckAvailabilityResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/DebugSendResponse.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/FcmV1Credential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/GcmCredential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/IpRule.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/LogSpecification.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/MetricSpecification.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/MpnsCredential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespacePatchParameters.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceResource.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceStatus.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/NamespaceType.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/Namespaces.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/NetworkAcls.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubPatchParameters.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubResource.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/NotificationHubs.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/Operation.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/OperationProvisioningState.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/Operations.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PnsCredentialsResource.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyResource.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PolicyKeyType.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionProvisioningState.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnectionResource.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateEndpointConnections.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkConnectionStatus.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResource.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicInternetAuthorizationRule.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/RegistrationResult.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateEndpointConnection.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/RemotePrivateLinkServiceConnectionState.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/ReplicationRegion.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/ResourceListKeys.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/ServiceSpecification.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/SharedAccessAuthorizationRuleResource.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/Sku.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/SkuName.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/WnsCredential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/XiaomiCredential.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/ZoneRedundancyPreference.java","src/main/java/com/azure/resourcemanager/notificationhubs/models/package-info.java","src/main/java/com/azure/resourcemanager/notificationhubs/package-info.java","src/main/java/module-info.java"]} \ 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/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 index 27840204c426..e2b95b4b5594 100644 --- 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 @@ -1 +1 @@ -[["com.azure.resourcemanager.notificationhubs.implementation.NamespacesClientImpl$NamespacesService"],["com.azure.resourcemanager.notificationhubs.implementation.NotificationHubsClientImpl$NotificationHubsService"],["com.azure.resourcemanager.notificationhubs.implementation.OperationsClientImpl$OperationsService"]] \ No newline at end of file +[["com.azure.resourcemanager.notificationhubs.implementation.NamespacesClientImpl$NamespacesService"],["com.azure.resourcemanager.notificationhubs.implementation.NotificationHubsClientImpl$NotificationHubsService"],["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/azure-resourcemanager-notificationhubs.properties b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/azure-resourcemanager-notificationhubs.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/main/resources/azure-resourcemanager-notificationhubs.properties @@ -0,0 +1 @@ +version=${project.version} 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 4e4ed03fd38b..c0a685a2b579 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -11,17 +11,15 @@ */ 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: 2023-10-01-preview/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) { + 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 d75ed5bf1bb9..f287fc6847b9 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 @@ -1,10 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.resourcemanager.notificationhubs.fluent.models.SharedAccessAuthorizationRuleProperties; import com.azure.resourcemanager.notificationhubs.models.AccessRights; import java.util.Arrays; @@ -13,22 +12,19 @@ */ 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: 2023-10-01-preview/Namespaces/AuthorizationRuleCreateOrUpdate.json */ /** - * Sample code: NameSpaceAuthorizationRuleCreate. + * Sample code: Namespaces_CreateOrUpdateAuthorizationRule. * * @param manager Entry point to NotificationHubsManager. */ - public static void - nameSpaceAuthorizationRuleCreate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { + 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))) + .withRights(Arrays.asList(AccessRights.LISTEN, AccessRights.SEND)) .create(); } } 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 18538588a146..7ecacd53a535 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 @@ -1,11 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.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; @@ -14,22 +20,27 @@ */ 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: 2023-10-01-preview/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) { + public static void + namespacesCreateOrUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces() .define("nh-sdk-ns") - .withLocation("South Central US") + .withRegion("South Central US") .withExistingResourceGroup("5ktrial") - .withTags(mapOf("tag1", "value1", "tag2", "value2")) .withSku(new Sku().withName(SkuName.STANDARD).withTier("Standard")) + .withTags(mapOf("tag1", "value1", "tag2", "value2")) + .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(); } 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 4c32eca91511..8f332809eef0 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,15 @@ */ 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: 2023-10-01-preview/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) { + 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 0492ce8e917e..b873a3f32ce1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,16 +9,15 @@ */ 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: 2023-10-01-preview/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", com.azure.core.util.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 bcf13f6389a6..c6c756439006 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,15 @@ */ 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: 2023-10-01-preview/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) { + 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 1f90d2124a62..c5f596f68b1c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,16 +9,14 @@ */ 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: 2023-10-01-preview/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) { + 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..ee0582cde41f --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetPnsCredentialsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +/** + * Samples for Namespaces GetPnsCredentials. + */ +public final class NamespacesGetPnsCredentialsSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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 cae7aba8455a..cea1bb59dd35 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,15 @@ */ 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: 2023-10-01-preview/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) { + 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 b1f1f075ed9b..86e4b8bf672f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,14 @@ */ 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: 2023-10-01-preview/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", com.azure.core.util.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 5d61dc035ddc..87e55bbe2684 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,14 @@ */ 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: 2023-10-01-preview/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) { + 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 b10554c7860f..e9ff26525627 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,16 +9,14 @@ */ 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: 2023-10-01-preview/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(com.azure.core.util.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/NamespacesRegenerateKeysSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesRegenerateKeysSamples.java index 61f58f615218..167f6c336b03 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 @@ -1,29 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; -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. */ 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: 2023-10-01-preview/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) { + public static void + namespacesRegenerateKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.namespaces() .regenerateKeysWithResponse("5ktrial", "nh-sdk-ns", "RootManageSharedAccessKey", - new PolicykeyResource().withPolicyKey("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + 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/NamespacesPatchSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesUpdateSamples.java similarity index 54% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesPatchSamples.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesUpdateSamples.java index 84c9b6b84cce..edc713ce4b74 100644 --- 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/NamespacesUpdateSamples.java @@ -1,9 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; +import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceProperties; +import com.azure.resourcemanager.notificationhubs.fluent.models.PnsCredentials; +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; import com.azure.resourcemanager.notificationhubs.models.Sku; import com.azure.resourcemanager.notificationhubs.models.SkuName; @@ -11,26 +14,27 @@ import java.util.Map; /** - * Samples for Namespaces Patch. + * Samples for Namespaces Update. */ -public final class NamespacesPatchSamples { +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: 2023-10-01-preview/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) { + 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", "value1", "tag2", "value2")) - .withSku(new Sku().withName(SkuName.STANDARD).withTier("Standard")) + .withTags(mapOf("tag1", "value3")) + .withSku(new Sku().withName(SkuName.FREE)) + .withProperties(new NamespaceProperties().withPnsCredentials(new PnsCredentials() + .withGcmCredential(new GcmCredential().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/NotificationHubsCheckNotificationHubAvailabilitySamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilitySamples.java index 70de37304883..b65af068d94b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -11,16 +11,14 @@ */ 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: 2023-10-01-preview/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", 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 f4dbdaeb75fa..ee3e7489263a 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. 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.SharedAccessAuthorizationRuleCreateOrUpdateParameters; import java.util.Arrays; /** @@ -14,23 +13,19 @@ */ 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: 2023-10-01-preview/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))), + "MyManageSharedAccessKey", new SharedAccessAuthorizationRuleResourceInner().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/NotificationHubsCreateOrUpdateSamples.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCreateOrUpdateSamples.java index 64efdd2eb529..ea42e4b97e9a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,15 @@ */ 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: 2023-10-01-preview/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) { + notificationHubsCreateOrUpdate(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.notificationHubs() .define("nh-sdk-hub") .withRegion("eastus") 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 51f7eb76529c..c6c3e6b8cffc 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 @@ -1,33 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import java.io.IOException; - /** * 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: 2023-10-01-preview/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 { + public static void + notificationHubsDebugSend(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.notificationHubs() - .debugSendWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("{\"data\":{\"message\":\"Hello\"}}", Object.class, SerializerEncoding.JSON), - com.azure.core.util.Context.NONE); + .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 bd15371f0a1b..609000faedfc 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,16 +9,14 @@ */ 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: 2023-10-01-preview/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", 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 5d4a9929581f..ff13155e15f5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,15 @@ */ 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: 2023-10-01-preview/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) { + 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 1a835af81a46..13bd07c48aee 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,16 +9,14 @@ */ 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: 2023-10-01-preview/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", 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 cd2629ada3ce..16fca8037d66 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,15 @@ */ 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: 2023-10-01-preview/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) { + 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 17ee83fcabdf..bdc0675e71e4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,16 +9,14 @@ */ 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: 2023-10-01-preview/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) { + 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 b0f1c25057ce..457cb579c5b3 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,16 +9,14 @@ */ 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: 2023-10-01-preview/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", 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 710e571fe1cf..7b0d588556e4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,15 @@ */ 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: 2023-10-01-preview/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) { + 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 1a3b57df718e..8c7ae395d3f4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,17 +9,15 @@ */ 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: 2023-10-01-preview/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", com.azure.core.util.Context.NONE); + 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 4ce8b17e69d5..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsPatchSamples.java +++ /dev/null @@ -1,31 +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.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", - com.azure.core.util.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 f573c74abdfb..4c87ee6c6947 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 @@ -1,29 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; -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. */ 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: 2023-10-01-preview/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) { + public static void + notificationHubsRegenerateKeys(com.azure.resourcemanager.notificationhubs.NotificationHubsManager manager) { manager.notificationHubs() .regenerateKeysWithResponse("5ktrial", "nh-sdk-ns", "nh-sdk-hub", "DefaultListenSharedAccessSignature", - new PolicykeyResource().withPolicyKey("fakeTokenPlaceholder"), com.azure.core.util.Context.NONE); + 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..a933c998231d --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsUpdateSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.resourcemanager.notificationhubs.models.GcmCredential; +import com.azure.resourcemanager.notificationhubs.models.NotificationHubResource; + +/** + * Samples for NotificationHubs Update. + */ +public final class NotificationHubsUpdateSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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() + .withRegistrationTtl("10675199.02:48:05.4775807") + .withGcmCredential(new GcmCredential().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 a24a4fea4d76..a1212136e8ae 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -9,12 +9,10 @@ */ 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: 2023-10-01-preview/NHOperationsList.json */ /** - * Sample code: OperationsList. + * Sample code: Operations_List. * * @param manager Entry point to NotificationHubsManager. */ 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..f2bcc8614161 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections Delete. + */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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..d537f7a6dd81 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections GetGroupId. + */ +public final class PrivateEndpointConnectionsGetGroupIdSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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..0a6544bd1bee --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections Get. + */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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..1f24dd5a8ae2 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections ListGroupIds. + */ +public final class PrivateEndpointConnectionsListGroupIdsSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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..01e31674da4a --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +/** + * Samples for PrivateEndpointConnections List. + */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: 2023-10-01-preview/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..26a18a5b6342 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/samples/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateSamples.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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: 2023-10-01-preview/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/src/test/java/com/azure/resourcemanager/notificationhubs/generated/AvailabilityTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/AvailabilityTests.java new file mode 100644 index 000000000000..090ab0ae6a36 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/AvailabilityTests.java @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.Availability; + +public final class AvailabilityTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + Availability model = BinaryData.fromString("{\"timeGrain\":\"nfnbacfionlebxe\",\"blobDuration\":\"gtzxdpn\"}") + .toObject(Availability.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/CheckAvailabilityParametersTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/CheckAvailabilityParametersTests.java index b531a30dfcea..5f4d5c1af5bb 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/CheckAvailabilityParametersTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/CheckAvailabilityParametersTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -16,40 +16,40 @@ public final class CheckAvailabilityParametersTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckAvailabilityParameters model = BinaryData.fromString( - "{\"id\":\"pewnw\",\"name\":\"eitjz\",\"type\":\"lusarh\",\"location\":\"fcqhsmyurkd\",\"tags\":{\"arcryuanzwuxzdxt\":\"xhekuksjtxukcdm\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"hmwhfpmrqo\",\"size\":\"tu\",\"family\":\"nryrtihf\",\"capacity\":1773018691},\"isAvailiable\":false}") + "{\"id\":\"bzpfzab\",\"name\":\"lcuhxwtctyqiklb\",\"type\":\"vplwzbhv\",\"location\":\"u\",\"tags\":{\"fpl\":\"svmkfssxquk\",\"xnkjzkdesl\":\"mg\"},\"isAvailiable\":false,\"sku\":{\"name\":\"Standard\",\"tier\":\"i\",\"size\":\"ghxpkdw\",\"family\":\"aiuebbaumnyqu\",\"capacity\":865900212}}") .toObject(CheckAvailabilityParameters.class); - Assertions.assertEquals("eitjz", model.name()); - Assertions.assertEquals("fcqhsmyurkd", model.location()); - Assertions.assertEquals("xhekuksjtxukcdm", model.tags().get("arcryuanzwuxzdxt")); + Assertions.assertEquals("lcuhxwtctyqiklb", model.name()); + Assertions.assertEquals("u", model.location()); + Assertions.assertEquals("svmkfssxquk", model.tags().get("fpl")); + Assertions.assertFalse(model.isAvailiable()); Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); - Assertions.assertEquals("hmwhfpmrqo", model.sku().tier()); - Assertions.assertEquals("tu", model.sku().size()); - Assertions.assertEquals("nryrtihf", model.sku().family()); - Assertions.assertEquals(1773018691, model.sku().capacity()); - Assertions.assertEquals(false, model.isAvailiable()); + Assertions.assertEquals("i", model.sku().tier()); + Assertions.assertEquals("ghxpkdw", model.sku().size()); + Assertions.assertEquals("aiuebbaumnyqu", model.sku().family()); + Assertions.assertEquals(865900212, model.sku().capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CheckAvailabilityParameters model = new CheckAvailabilityParameters().withName("eitjz") - .withLocation("fcqhsmyurkd") - .withTags(mapOf("arcryuanzwuxzdxt", "xhekuksjtxukcdm")) + CheckAvailabilityParameters model = new CheckAvailabilityParameters().withName("lcuhxwtctyqiklb") + .withLocation("u") + .withTags(mapOf("fpl", "svmkfssxquk", "xnkjzkdesl", "mg")) + .withIsAvailiable(false) .withSku(new Sku().withName(SkuName.STANDARD) - .withTier("hmwhfpmrqo") - .withSize("tu") - .withFamily("nryrtihf") - .withCapacity(1773018691)) - .withIsAvailiable(false); + .withTier("i") + .withSize("ghxpkdw") + .withFamily("aiuebbaumnyqu") + .withCapacity(865900212)); model = BinaryData.fromObject(model).toObject(CheckAvailabilityParameters.class); - Assertions.assertEquals("eitjz", model.name()); - Assertions.assertEquals("fcqhsmyurkd", model.location()); - Assertions.assertEquals("xhekuksjtxukcdm", model.tags().get("arcryuanzwuxzdxt")); + Assertions.assertEquals("lcuhxwtctyqiklb", model.name()); + Assertions.assertEquals("u", model.location()); + Assertions.assertEquals("svmkfssxquk", model.tags().get("fpl")); + Assertions.assertFalse(model.isAvailiable()); Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); - Assertions.assertEquals("hmwhfpmrqo", model.sku().tier()); - Assertions.assertEquals("tu", model.sku().size()); - Assertions.assertEquals("nryrtihf", model.sku().family()); - Assertions.assertEquals(1773018691, model.sku().capacity()); - Assertions.assertEquals(false, model.isAvailiable()); + Assertions.assertEquals("i", model.sku().tier()); + Assertions.assertEquals("ghxpkdw", model.sku().size()); + Assertions.assertEquals("aiuebbaumnyqu", model.sku().family()); + Assertions.assertEquals(865900212, model.sku().capacity()); } // Use "Map.of" if available diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/CheckAvailabilityResultInnerTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/CheckAvailabilityResultInnerTests.java index 3cd395d372fd..6b59092b25f1 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/CheckAvailabilityResultInnerTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/CheckAvailabilityResultInnerTests.java @@ -1,63 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.notificationhubs.fluent.models.CheckAvailabilityResultInner; -import com.azure.resourcemanager.notificationhubs.models.Sku; import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class CheckAvailabilityResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckAvailabilityResultInner model = BinaryData.fromString( - "{\"isAvailiable\":false,\"sku\":{\"name\":\"Standard\",\"tier\":\"fpikxwczb\",\"size\":\"cnpqxuhivyqniwby\",\"family\":\"k\",\"capacity\":827133079},\"location\":\"umjgrtfwvuk\",\"tags\":{\"yejhk\":\"udccsnhsjc\",\"kkvnipjox\":\"yhtnapczwlokjye\",\"podmailzydehojwy\":\"jnchgej\"},\"id\":\"huxinpmqnj\",\"name\":\"qwixjspro\",\"type\":\"vcputegj\"}") + "{\"isAvailiable\":true,\"location\":\"nabckhsmtx\",\"tags\":{\"krdqmh\":\"ebtfhvpesap\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"tldwkyzxuutk\",\"size\":\"ws\",\"family\":\"svlxotogtwrup\",\"capacity\":1278272073},\"id\":\"nmic\",\"name\":\"kvceoveilovnotyf\",\"type\":\"fcnj\"}") .toObject(CheckAvailabilityResultInner.class); - Assertions.assertEquals("umjgrtfwvuk", model.location()); - Assertions.assertEquals("udccsnhsjc", model.tags().get("yejhk")); - Assertions.assertEquals(false, model.isAvailiable()); + Assertions.assertTrue(model.isAvailiable()); + Assertions.assertEquals("nabckhsmtx", model.location()); + Assertions.assertEquals("ebtfhvpesap", model.tags().get("krdqmh")); Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); - Assertions.assertEquals("fpikxwczb", model.sku().tier()); - Assertions.assertEquals("cnpqxuhivyqniwby", model.sku().size()); - Assertions.assertEquals("k", model.sku().family()); - Assertions.assertEquals(827133079, model.sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckAvailabilityResultInner model = new CheckAvailabilityResultInner().withLocation("umjgrtfwvuk") - .withTags(mapOf("yejhk", "udccsnhsjc", "kkvnipjox", "yhtnapczwlokjye", "podmailzydehojwy", "jnchgej")) - .withIsAvailiable(false) - .withSku(new Sku().withName(SkuName.STANDARD) - .withTier("fpikxwczb") - .withSize("cnpqxuhivyqniwby") - .withFamily("k") - .withCapacity(827133079)); - model = BinaryData.fromObject(model).toObject(CheckAvailabilityResultInner.class); - Assertions.assertEquals("umjgrtfwvuk", model.location()); - Assertions.assertEquals("udccsnhsjc", model.tags().get("yejhk")); - Assertions.assertEquals(false, model.isAvailiable()); - Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); - Assertions.assertEquals("fpikxwczb", model.sku().tier()); - Assertions.assertEquals("cnpqxuhivyqniwby", model.sku().size()); - Assertions.assertEquals("k", model.sku().family()); - Assertions.assertEquals(827133079, model.sku().capacity()); - } - - // 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; + Assertions.assertEquals("tldwkyzxuutk", model.sku().tier()); + Assertions.assertEquals("ws", model.sku().size()); + Assertions.assertEquals("svlxotogtwrup", model.sku().family()); + Assertions.assertEquals(1278272073, model.sku().capacity()); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/DebugSendResponseInnerTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/DebugSendResponseInnerTests.java index 819093cc7fff..6ac3258ff5cc 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/DebugSendResponseInnerTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/DebugSendResponseInnerTests.java @@ -1,68 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResponseInner; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.util.HashMap; -import java.util.Map; import org.junit.jupiter.api.Assertions; public final class DebugSendResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DebugSendResponseInner model = BinaryData.fromString( - "{\"properties\":{\"success\":62.422825,\"failure\":22.030466,\"results\":\"datasxlzevgbmqj\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"y\",\"size\":\"ivkwlzuvccfwnfnb\",\"family\":\"fionl\",\"capacity\":10134075},\"location\":\"etqgtzxdpnq\",\"tags\":{\"snjampmng\":\"wxrjfeallnwsub\",\"chcbonqvpkvlrxnj\":\"zscxaqwo\",\"pheoflokeyy\":\"ase\"},\"id\":\"enjbdlwtgrhp\",\"name\":\"jp\",\"type\":\"umasxazjpq\"}") + "{\"properties\":{\"success\":7879286382759919069,\"failure\":3739612014503644987,\"results\":[{\"applicationPlatform\":\"ehhseyvjusrts\",\"pnsHandle\":\"spkdee\",\"registrationId\":\"ofmxagkvtmelmqkr\",\"outcome\":\"hvljuahaquh\"},{\"applicationPlatform\":\"hmdua\",\"pnsHandle\":\"exq\",\"registrationId\":\"fadmws\",\"outcome\":\"r\"}]},\"location\":\"xpvgo\",\"tags\":{\"bnbbeldawkz\":\"fmisg\"},\"id\":\"liourqhak\",\"name\":\"uhashsfwx\",\"type\":\"sowzxcugi\"}") .toObject(DebugSendResponseInner.class); - Assertions.assertEquals("etqgtzxdpnq", model.location()); - Assertions.assertEquals("wxrjfeallnwsub", model.tags().get("snjampmng")); - Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); - Assertions.assertEquals("y", model.sku().tier()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.sku().size()); - Assertions.assertEquals("fionl", model.sku().family()); - Assertions.assertEquals(10134075, model.sku().capacity()); - Assertions.assertEquals(62.422825F, model.success()); - Assertions.assertEquals(22.030466F, model.failure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DebugSendResponseInner model = new DebugSendResponseInner().withLocation("etqgtzxdpnq") - .withTags(mapOf("snjampmng", "wxrjfeallnwsub", "chcbonqvpkvlrxnj", "zscxaqwo", "pheoflokeyy", - "fakeTokenPlaceholder")) - .withSku(new Sku().withName(SkuName.STANDARD) - .withTier("y") - .withSize("ivkwlzuvccfwnfnb") - .withFamily("fionl") - .withCapacity(10134075)) - .withSuccess(62.422825F) - .withFailure(22.030466F) - .withResults("datasxlzevgbmqj"); - model = BinaryData.fromObject(model).toObject(DebugSendResponseInner.class); - Assertions.assertEquals("etqgtzxdpnq", model.location()); - Assertions.assertEquals("wxrjfeallnwsub", model.tags().get("snjampmng")); - Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); - Assertions.assertEquals("y", model.sku().tier()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", model.sku().size()); - Assertions.assertEquals("fionl", model.sku().family()); - Assertions.assertEquals(10134075, model.sku().capacity()); - Assertions.assertEquals(62.422825F, model.success()); - Assertions.assertEquals(22.030466F, model.failure()); - } - - // 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; + Assertions.assertEquals("xpvgo", model.location()); + Assertions.assertEquals("fmisg", model.tags().get("bnbbeldawkz")); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/DebugSendResultTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/DebugSendResultTests.java index 544944ae313f..c59fab1c4121 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/DebugSendResultTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/DebugSendResultTests.java @@ -1,29 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.notificationhubs.fluent.models.DebugSendResult; -import org.junit.jupiter.api.Assertions; public final class DebugSendResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - DebugSendResult model - = BinaryData.fromString("{\"success\":22.663057,\"failure\":29.506851,\"results\":\"datahb\"}") - .toObject(DebugSendResult.class); - Assertions.assertEquals(22.663057F, model.success()); - Assertions.assertEquals(29.506851F, model.failure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DebugSendResult model - = new DebugSendResult().withSuccess(22.663057F).withFailure(29.506851F).withResults("datahb"); - model = BinaryData.fromObject(model).toObject(DebugSendResult.class); - Assertions.assertEquals(22.663057F, model.success()); - Assertions.assertEquals(29.506851F, model.failure()); + DebugSendResult model = BinaryData.fromString( + "{\"success\":2404142074196330261,\"failure\":3584275720404474135,\"results\":[{\"applicationPlatform\":\"pucwwfvovbvme\",\"pnsHandle\":\"civyhzceuo\",\"registrationId\":\"jrwjueiotwm\",\"outcome\":\"ytdxwit\"},{\"applicationPlatform\":\"rjaw\",\"pnsHandle\":\"wgxhn\",\"registrationId\":\"kxfbkpycgklwndn\",\"outcome\":\"dauwhvylwzbtd\"},{\"applicationPlatform\":\"ujznb\",\"pnsHandle\":\"ow\",\"registrationId\":\"przqlveu\",\"outcome\":\"upjm\"},{\"applicationPlatform\":\"fxobbcsws\",\"pnsHandle\":\"jriplrbpbewtghf\",\"registrationId\":\"lcgwxzvlvqh\",\"outcome\":\"begibtnmxiebwwa\"}]}") + .toObject(DebugSendResult.class); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/IpRuleTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/IpRuleTests.java new file mode 100644 index 000000000000..e917bfc40476 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/IpRuleTests.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.AccessRights; +import com.azure.resourcemanager.notificationhubs.models.IpRule; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class IpRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + IpRule model + = BinaryData.fromString("{\"ipMask\":\"jmcmatuokthfu\",\"rights\":[\"Manage\",\"Listen\",\"Manage\"]}") + .toObject(IpRule.class); + Assertions.assertEquals("jmcmatuokthfu", model.ipMask()); + Assertions.assertEquals(AccessRights.MANAGE, model.rights().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + IpRule model = new IpRule().withIpMask("jmcmatuokthfu") + .withRights(Arrays.asList(AccessRights.MANAGE, AccessRights.LISTEN, AccessRights.MANAGE)); + model = BinaryData.fromObject(model).toObject(IpRule.class); + Assertions.assertEquals("jmcmatuokthfu", model.ipMask()); + Assertions.assertEquals(AccessRights.MANAGE, model.rights().get(0)); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/LogSpecificationTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/LogSpecificationTests.java new file mode 100644 index 000000000000..1b4d2f37db01 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/LogSpecificationTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.LogSpecification; +import org.junit.jupiter.api.Assertions; + +public final class LogSpecificationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + LogSpecification model = BinaryData.fromString( + "{\"name\":\"qvuhrhcffcyddglm\",\"displayName\":\"hjq\",\"blobDuration\":\"pyeicxm\",\"categoryGroups\":[\"wqvhkhixuigdt\",\"pbobjo\"]}") + .toObject(LogSpecification.class); + Assertions.assertEquals("wqvhkhixuigdt", model.categoryGroups().get(0)); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/MetricSpecificationTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/MetricSpecificationTests.java new file mode 100644 index 000000000000..2a80e0124926 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/MetricSpecificationTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.MetricSpecification; + +public final class MetricSpecificationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + MetricSpecification model = BinaryData.fromString( + "{\"name\":\"m\",\"displayName\":\"u\",\"displayDescription\":\"a\",\"unit\":\"rzayv\",\"aggregationType\":\"pgvdf\",\"availabilities\":[{\"timeGrain\":\"kftutqxlngxlefg\",\"blobDuration\":\"nxkrx\"},{\"timeGrain\":\"mi\",\"blobDuration\":\"thz\"},{\"timeGrain\":\"qdrabhjybigehoqf\",\"blobDuration\":\"wska\"},{\"timeGrain\":\"ktzlcuiywg\",\"blobDuration\":\"wgndrvynhzgpp\"}],\"supportedTimeGrainTypes\":[\"gyncocpecfvmmc\",\"ofsx\",\"zevgb\"],\"metricFilterPattern\":\"jqabcypmivkwlzuv\",\"fillGapWithZero\":false}") + .toObject(MetricSpecification.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceCreateOrUpdateParametersTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceCreateOrUpdateParametersTests.java deleted file mode 100644 index e86ef5fbd653..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceCreateOrUpdateParametersTests.java +++ /dev/null @@ -1,101 +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.BinaryData; -import com.azure.resourcemanager.notificationhubs.models.NamespaceCreateOrUpdateParameters; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceCreateOrUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceCreateOrUpdateParameters model = BinaryData.fromString( - "{\"properties\":{\"name\":\"fdatsc\",\"provisioningState\":\"vpjhulsuuv\",\"region\":\"jozkrwfndiod\",\"metricId\":\"slwejdpvw\",\"status\":\"oqpsoa\",\"createdAt\":\"2021-07-20T12:53:26Z\",\"updatedAt\":\"2021-10-30T16:42:46Z\",\"serviceBusEndpoint\":\"kljla\",\"subscriptionId\":\"cr\",\"scaleUnit\":\"fdfdosygexpa\",\"enabled\":true,\"critical\":true,\"dataCenter\":\"sbzjhcr\",\"namespaceType\":\"NotificationHub\"},\"sku\":{\"name\":\"Free\",\"tier\":\"lxaolthqtrgqjbp\",\"size\":\"fsinzgvfcjrwzoxx\",\"family\":\"felluwfzitonpe\",\"capacity\":794210755},\"location\":\"jkjlxofpdvhpfx\",\"tags\":{\"uybbkpodep\":\"ininmay\"},\"id\":\"oginuvamiheognar\",\"name\":\"zxtheotusivyevcc\",\"type\":\"qi\"}") - .toObject(NamespaceCreateOrUpdateParameters.class); - Assertions.assertEquals("jkjlxofpdvhpfx", model.location()); - Assertions.assertEquals("ininmay", model.tags().get("uybbkpodep")); - Assertions.assertEquals(SkuName.FREE, model.sku().name()); - Assertions.assertEquals("lxaolthqtrgqjbp", model.sku().tier()); - Assertions.assertEquals("fsinzgvfcjrwzoxx", model.sku().size()); - Assertions.assertEquals("felluwfzitonpe", model.sku().family()); - Assertions.assertEquals(794210755, model.sku().capacity()); - Assertions.assertEquals("fdatsc", model.namePropertiesName()); - Assertions.assertEquals("vpjhulsuuv", model.provisioningState()); - Assertions.assertEquals("jozkrwfndiod", model.region()); - Assertions.assertEquals("oqpsoa", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T12:53:26Z"), model.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T16:42:46Z"), model.updatedAt()); - Assertions.assertEquals("kljla", model.serviceBusEndpoint()); - Assertions.assertEquals("cr", model.subscriptionId()); - Assertions.assertEquals("fdfdosygexpa", model.scaleUnit()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(true, model.critical()); - Assertions.assertEquals("sbzjhcr", model.dataCenter()); - Assertions.assertEquals(NamespaceType.NOTIFICATION_HUB, model.namespaceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceCreateOrUpdateParameters model = new NamespaceCreateOrUpdateParameters().withLocation("jkjlxofpdvhpfx") - .withTags(mapOf("uybbkpodep", "ininmay")) - .withSku(new Sku().withName(SkuName.FREE) - .withTier("lxaolthqtrgqjbp") - .withSize("fsinzgvfcjrwzoxx") - .withFamily("felluwfzitonpe") - .withCapacity(794210755)) - .withNamePropertiesName("fdatsc") - .withProvisioningState("vpjhulsuuv") - .withRegion("jozkrwfndiod") - .withStatus("oqpsoa") - .withCreatedAt(OffsetDateTime.parse("2021-07-20T12:53:26Z")) - .withUpdatedAt(OffsetDateTime.parse("2021-10-30T16:42:46Z")) - .withServiceBusEndpoint("kljla") - .withSubscriptionId("cr") - .withScaleUnit("fdfdosygexpa") - .withEnabled(true) - .withCritical(true) - .withDataCenter("sbzjhcr") - .withNamespaceType(NamespaceType.NOTIFICATION_HUB); - model = BinaryData.fromObject(model).toObject(NamespaceCreateOrUpdateParameters.class); - Assertions.assertEquals("jkjlxofpdvhpfx", model.location()); - Assertions.assertEquals("ininmay", model.tags().get("uybbkpodep")); - Assertions.assertEquals(SkuName.FREE, model.sku().name()); - Assertions.assertEquals("lxaolthqtrgqjbp", model.sku().tier()); - Assertions.assertEquals("fsinzgvfcjrwzoxx", model.sku().size()); - Assertions.assertEquals("felluwfzitonpe", model.sku().family()); - Assertions.assertEquals(794210755, model.sku().capacity()); - Assertions.assertEquals("fdatsc", model.namePropertiesName()); - Assertions.assertEquals("vpjhulsuuv", model.provisioningState()); - Assertions.assertEquals("jozkrwfndiod", model.region()); - Assertions.assertEquals("oqpsoa", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T12:53:26Z"), model.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T16:42:46Z"), model.updatedAt()); - Assertions.assertEquals("kljla", model.serviceBusEndpoint()); - Assertions.assertEquals("cr", model.subscriptionId()); - Assertions.assertEquals("fdfdosygexpa", model.scaleUnit()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(true, model.critical()); - Assertions.assertEquals("sbzjhcr", model.dataCenter()); - Assertions.assertEquals(NamespaceType.NOTIFICATION_HUB, model.namespaceType()); - } - - // 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/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceListResultTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceListResultTests.java deleted file mode 100644 index d188f707868d..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceListResultTests.java +++ /dev/null @@ -1,106 +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.BinaryData; -import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner; -import com.azure.resourcemanager.notificationhubs.models.NamespaceListResult; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"name\":\"fqawrlyxw\",\"provisioningState\":\"cpr\",\"region\":\"wbxgjvt\",\"metricId\":\"p\",\"status\":\"szdnr\",\"createdAt\":\"2021-06-20T01:52:55Z\",\"updatedAt\":\"2021-10-21T17:39:02Z\",\"serviceBusEndpoint\":\"muouqfp\",\"subscriptionId\":\"zw\",\"scaleUnit\":\"g\",\"enabled\":false,\"critical\":false,\"dataCenter\":\"izgazxu\",\"namespaceType\":\"Messaging\"},\"sku\":{\"name\":\"Free\",\"tier\":\"y\",\"size\":\"hr\",\"family\":\"dfvzwdzuhty\",\"capacity\":1847084741},\"location\":\"sdkf\",\"tags\":{\"km\":\"xmnteiwaop\",\"mzidnsezcxtb\":\"jcmmxdcufufsrp\",\"dwzjeiach\":\"sgfyccsnew\"},\"id\":\"oosflnr\",\"name\":\"sfqpteehz\",\"type\":\"vypyqrimzinpv\"}],\"nextLink\":\"jdkirsoodqx\"}") - .toObject(NamespaceListResult.class); - Assertions.assertEquals("sdkf", model.value().get(0).location()); - Assertions.assertEquals("xmnteiwaop", model.value().get(0).tags().get("km")); - Assertions.assertEquals(SkuName.FREE, model.value().get(0).sku().name()); - Assertions.assertEquals("y", model.value().get(0).sku().tier()); - Assertions.assertEquals("hr", model.value().get(0).sku().size()); - Assertions.assertEquals("dfvzwdzuhty", model.value().get(0).sku().family()); - Assertions.assertEquals(1847084741, model.value().get(0).sku().capacity()); - Assertions.assertEquals("fqawrlyxw", model.value().get(0).namePropertiesName()); - Assertions.assertEquals("cpr", model.value().get(0).provisioningState()); - Assertions.assertEquals("wbxgjvt", model.value().get(0).region()); - Assertions.assertEquals("szdnr", model.value().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-20T01:52:55Z"), model.value().get(0).createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T17:39:02Z"), model.value().get(0).updatedAt()); - Assertions.assertEquals("muouqfp", model.value().get(0).serviceBusEndpoint()); - Assertions.assertEquals("zw", model.value().get(0).subscriptionId()); - Assertions.assertEquals("g", model.value().get(0).scaleUnit()); - Assertions.assertEquals(false, model.value().get(0).enabled()); - Assertions.assertEquals(false, model.value().get(0).critical()); - Assertions.assertEquals("izgazxu", model.value().get(0).dataCenter()); - Assertions.assertEquals(NamespaceType.MESSAGING, model.value().get(0).namespaceType()); - Assertions.assertEquals("jdkirsoodqx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceListResult model - = new NamespaceListResult().withValue(Arrays.asList(new NamespaceResourceInner().withLocation("sdkf") - .withTags(mapOf("km", "xmnteiwaop", "mzidnsezcxtb", "jcmmxdcufufsrp", "dwzjeiach", "sgfyccsnew")) - .withSku(new Sku().withName(SkuName.FREE) - .withTier("y") - .withSize("hr") - .withFamily("dfvzwdzuhty") - .withCapacity(1847084741)) - .withNamePropertiesName("fqawrlyxw") - .withProvisioningState("cpr") - .withRegion("wbxgjvt") - .withStatus("szdnr") - .withCreatedAt(OffsetDateTime.parse("2021-06-20T01:52:55Z")) - .withUpdatedAt(OffsetDateTime.parse("2021-10-21T17:39:02Z")) - .withServiceBusEndpoint("muouqfp") - .withSubscriptionId("zw") - .withScaleUnit("g") - .withEnabled(false) - .withCritical(false) - .withDataCenter("izgazxu") - .withNamespaceType(NamespaceType.MESSAGING))).withNextLink("jdkirsoodqx"); - model = BinaryData.fromObject(model).toObject(NamespaceListResult.class); - Assertions.assertEquals("sdkf", model.value().get(0).location()); - Assertions.assertEquals("xmnteiwaop", model.value().get(0).tags().get("km")); - Assertions.assertEquals(SkuName.FREE, model.value().get(0).sku().name()); - Assertions.assertEquals("y", model.value().get(0).sku().tier()); - Assertions.assertEquals("hr", model.value().get(0).sku().size()); - Assertions.assertEquals("dfvzwdzuhty", model.value().get(0).sku().family()); - Assertions.assertEquals(1847084741, model.value().get(0).sku().capacity()); - Assertions.assertEquals("fqawrlyxw", model.value().get(0).namePropertiesName()); - Assertions.assertEquals("cpr", model.value().get(0).provisioningState()); - Assertions.assertEquals("wbxgjvt", model.value().get(0).region()); - Assertions.assertEquals("szdnr", model.value().get(0).status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-20T01:52:55Z"), model.value().get(0).createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-21T17:39:02Z"), model.value().get(0).updatedAt()); - Assertions.assertEquals("muouqfp", model.value().get(0).serviceBusEndpoint()); - Assertions.assertEquals("zw", model.value().get(0).subscriptionId()); - Assertions.assertEquals("g", model.value().get(0).scaleUnit()); - Assertions.assertEquals(false, model.value().get(0).enabled()); - Assertions.assertEquals(false, model.value().get(0).critical()); - Assertions.assertEquals("izgazxu", model.value().get(0).dataCenter()); - Assertions.assertEquals(NamespaceType.MESSAGING, model.value().get(0).namespaceType()); - Assertions.assertEquals("jdkirsoodqx", model.nextLink()); - } - - // 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/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacePatchParametersTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacePatchParametersTests.java deleted file mode 100644 index cc43a77c05cd..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacePatchParametersTests.java +++ /dev/null @@ -1,58 +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.BinaryData; -import com.azure.resourcemanager.notificationhubs.models.NamespacePatchParameters; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NamespacePatchParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespacePatchParameters model = BinaryData.fromString( - "{\"tags\":{\"xybz\":\"akeqs\",\"mnkzsmod\":\"qedqytbciqfoufl\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"ugpbkw\",\"size\":\"utduqktapspwgcu\",\"family\":\"tumkdosvqwhbm\",\"capacity\":1497620633}}") - .toObject(NamespacePatchParameters.class); - Assertions.assertEquals("akeqs", model.tags().get("xybz")); - Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); - Assertions.assertEquals("ugpbkw", model.sku().tier()); - Assertions.assertEquals("utduqktapspwgcu", model.sku().size()); - Assertions.assertEquals("tumkdosvqwhbm", model.sku().family()); - Assertions.assertEquals(1497620633, model.sku().capacity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespacePatchParameters model - = new NamespacePatchParameters().withTags(mapOf("xybz", "akeqs", "mnkzsmod", "qedqytbciqfoufl")) - .withSku(new Sku().withName(SkuName.STANDARD) - .withTier("ugpbkw") - .withSize("utduqktapspwgcu") - .withFamily("tumkdosvqwhbm") - .withCapacity(1497620633)); - model = BinaryData.fromObject(model).toObject(NamespacePatchParameters.class); - Assertions.assertEquals("akeqs", model.tags().get("xybz")); - Assertions.assertEquals(SkuName.STANDARD, model.sku().name()); - Assertions.assertEquals("ugpbkw", model.sku().tier()); - Assertions.assertEquals("utduqktapspwgcu", model.sku().size()); - Assertions.assertEquals("tumkdosvqwhbm", model.sku().family()); - Assertions.assertEquals(1497620633, model.sku().capacity()); - } - - // 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/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacePropertiesTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacePropertiesTests.java deleted file mode 100644 index c2b05c1805f8..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacePropertiesTests.java +++ /dev/null @@ -1,64 +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.BinaryData; -import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceProperties; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class NamespacePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceProperties model = BinaryData.fromString( - "{\"name\":\"hungbwjzrnf\",\"provisioningState\":\"xgispemvtzfkufu\",\"region\":\"jofxqe\",\"metricId\":\"jaeq\",\"status\":\"qjbasvms\",\"createdAt\":\"2021-08-09T10:57:51Z\",\"updatedAt\":\"2021-09-27T07:52:20Z\",\"serviceBusEndpoint\":\"gsntnbybkzgcwr\",\"subscriptionId\":\"lxxwrljdouskc\",\"scaleUnit\":\"kocrcjdkwtnhx\",\"enabled\":true,\"critical\":false,\"dataCenter\":\"sqrglssainq\",\"namespaceType\":\"NotificationHub\"}") - .toObject(NamespaceProperties.class); - Assertions.assertEquals("hungbwjzrnf", model.name()); - Assertions.assertEquals("xgispemvtzfkufu", model.provisioningState()); - Assertions.assertEquals("jofxqe", model.region()); - Assertions.assertEquals("qjbasvms", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T10:57:51Z"), model.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T07:52:20Z"), model.updatedAt()); - Assertions.assertEquals("gsntnbybkzgcwr", model.serviceBusEndpoint()); - Assertions.assertEquals("lxxwrljdouskc", model.subscriptionId()); - Assertions.assertEquals("kocrcjdkwtnhx", model.scaleUnit()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(false, model.critical()); - Assertions.assertEquals("sqrglssainq", model.dataCenter()); - Assertions.assertEquals(NamespaceType.NOTIFICATION_HUB, model.namespaceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceProperties model = new NamespaceProperties().withName("hungbwjzrnf") - .withProvisioningState("xgispemvtzfkufu") - .withRegion("jofxqe") - .withStatus("qjbasvms") - .withCreatedAt(OffsetDateTime.parse("2021-08-09T10:57:51Z")) - .withUpdatedAt(OffsetDateTime.parse("2021-09-27T07:52:20Z")) - .withServiceBusEndpoint("gsntnbybkzgcwr") - .withSubscriptionId("lxxwrljdouskc") - .withScaleUnit("kocrcjdkwtnhx") - .withEnabled(true) - .withCritical(false) - .withDataCenter("sqrglssainq") - .withNamespaceType(NamespaceType.NOTIFICATION_HUB); - model = BinaryData.fromObject(model).toObject(NamespaceProperties.class); - Assertions.assertEquals("hungbwjzrnf", model.name()); - Assertions.assertEquals("xgispemvtzfkufu", model.provisioningState()); - Assertions.assertEquals("jofxqe", model.region()); - Assertions.assertEquals("qjbasvms", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T10:57:51Z"), model.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T07:52:20Z"), model.updatedAt()); - Assertions.assertEquals("gsntnbybkzgcwr", model.serviceBusEndpoint()); - Assertions.assertEquals("lxxwrljdouskc", model.subscriptionId()); - Assertions.assertEquals("kocrcjdkwtnhx", model.scaleUnit()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(false, model.critical()); - Assertions.assertEquals("sqrglssainq", model.dataCenter()); - Assertions.assertEquals(NamespaceType.NOTIFICATION_HUB, model.namespaceType()); - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceResourceInnerTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceResourceInnerTests.java deleted file mode 100644 index 9eeb2bd7ac11..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespaceResourceInnerTests.java +++ /dev/null @@ -1,101 +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.BinaryData; -import com.azure.resourcemanager.notificationhubs.fluent.models.NamespaceResourceInner; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class NamespaceResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - NamespaceResourceInner model = BinaryData.fromString( - "{\"properties\":{\"name\":\"lljfmppeeb\",\"provisioningState\":\"gxsabkyq\",\"region\":\"ujitcjcz\",\"metricId\":\"evndh\",\"status\":\"wpdappdsbdkv\",\"createdAt\":\"2021-04-24T00:01:09Z\",\"updatedAt\":\"2021-01-30T07:52:01Z\",\"serviceBusEndpoint\":\"usnhutje\",\"subscriptionId\":\"mrldhu\",\"scaleUnit\":\"zzd\",\"enabled\":true,\"critical\":false,\"dataCenter\":\"cdgea\",\"namespaceType\":\"NotificationHub\"},\"sku\":{\"name\":\"Free\",\"tier\":\"ti\",\"size\":\"dvkaozw\",\"family\":\"ftyhxhurokf\",\"capacity\":1369496360},\"location\":\"olniwpwcukjf\",\"tags\":{\"plwckbas\":\"awxklr\",\"cph\":\"ypnddhsgcb\"},\"id\":\"jkot\",\"name\":\"nqgoulzndli\",\"type\":\"wyqkgfgibm\"}") - .toObject(NamespaceResourceInner.class); - Assertions.assertEquals("olniwpwcukjf", model.location()); - Assertions.assertEquals("awxklr", model.tags().get("plwckbas")); - Assertions.assertEquals(SkuName.FREE, model.sku().name()); - Assertions.assertEquals("ti", model.sku().tier()); - Assertions.assertEquals("dvkaozw", model.sku().size()); - Assertions.assertEquals("ftyhxhurokf", model.sku().family()); - Assertions.assertEquals(1369496360, model.sku().capacity()); - Assertions.assertEquals("lljfmppeeb", model.namePropertiesName()); - Assertions.assertEquals("gxsabkyq", model.provisioningState()); - Assertions.assertEquals("ujitcjcz", model.region()); - Assertions.assertEquals("wpdappdsbdkv", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T00:01:09Z"), model.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-30T07:52:01Z"), model.updatedAt()); - Assertions.assertEquals("usnhutje", model.serviceBusEndpoint()); - Assertions.assertEquals("mrldhu", model.subscriptionId()); - Assertions.assertEquals("zzd", model.scaleUnit()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(false, model.critical()); - Assertions.assertEquals("cdgea", model.dataCenter()); - Assertions.assertEquals(NamespaceType.NOTIFICATION_HUB, model.namespaceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - NamespaceResourceInner model = new NamespaceResourceInner().withLocation("olniwpwcukjf") - .withTags(mapOf("plwckbas", "awxklr", "cph", "ypnddhsgcb")) - .withSku(new Sku().withName(SkuName.FREE) - .withTier("ti") - .withSize("dvkaozw") - .withFamily("ftyhxhurokf") - .withCapacity(1369496360)) - .withNamePropertiesName("lljfmppeeb") - .withProvisioningState("gxsabkyq") - .withRegion("ujitcjcz") - .withStatus("wpdappdsbdkv") - .withCreatedAt(OffsetDateTime.parse("2021-04-24T00:01:09Z")) - .withUpdatedAt(OffsetDateTime.parse("2021-01-30T07:52:01Z")) - .withServiceBusEndpoint("usnhutje") - .withSubscriptionId("mrldhu") - .withScaleUnit("zzd") - .withEnabled(true) - .withCritical(false) - .withDataCenter("cdgea") - .withNamespaceType(NamespaceType.NOTIFICATION_HUB); - model = BinaryData.fromObject(model).toObject(NamespaceResourceInner.class); - Assertions.assertEquals("olniwpwcukjf", model.location()); - Assertions.assertEquals("awxklr", model.tags().get("plwckbas")); - Assertions.assertEquals(SkuName.FREE, model.sku().name()); - Assertions.assertEquals("ti", model.sku().tier()); - Assertions.assertEquals("dvkaozw", model.sku().size()); - Assertions.assertEquals("ftyhxhurokf", model.sku().family()); - Assertions.assertEquals(1369496360, model.sku().capacity()); - Assertions.assertEquals("lljfmppeeb", model.namePropertiesName()); - Assertions.assertEquals("gxsabkyq", model.provisioningState()); - Assertions.assertEquals("ujitcjcz", model.region()); - Assertions.assertEquals("wpdappdsbdkv", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T00:01:09Z"), model.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-30T07:52:01Z"), model.updatedAt()); - Assertions.assertEquals("usnhutje", model.serviceBusEndpoint()); - Assertions.assertEquals("mrldhu", model.subscriptionId()); - Assertions.assertEquals("zzd", model.scaleUnit()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(false, model.critical()); - Assertions.assertEquals("cdgea", model.dataCenter()); - Assertions.assertEquals(NamespaceType.NOTIFICATION_HUB, model.namespaceType()); - } - - // 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/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCheckAvailabilityWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCheckAvailabilityWithResponseMockTests.java index d615bd514f21..114315bf4512 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCheckAvailabilityWithResponseMockTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCheckAvailabilityWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; @@ -26,35 +26,36 @@ public final class NamespacesCheckAvailabilityWithResponseMockTests { @Test public void testCheckAvailabilityWithResponse() throws Exception { String responseStr - = "{\"isAvailiable\":true,\"sku\":{\"name\":\"Free\",\"tier\":\"pfhyhl\",\"size\":\"pmopjmc\",\"family\":\"tuo\",\"capacity\":607140678},\"location\":\"fu\",\"tags\":{\"zydagfuaxbezyiuo\":\"odsfcpkvxodpuozm\",\"dxwzywqsmbsurexi\":\"ktwh\",\"yocf\":\"o\"},\"id\":\"fksymddystki\",\"name\":\"uxh\",\"type\":\"yudxorrqnbp\"}"; + = "{\"isAvailiable\":true,\"location\":\"aytdwkqbrq\",\"tags\":{\"tiirqtdqoa\":\"axhexiilivp\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"zfgs\",\"size\":\"yfxrx\",\"family\":\"eptra\",\"capacity\":1921470091},\"id\":\"zwl\",\"name\":\"nwxuqlcvydyp\",\"type\":\"tdooaoj\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NotificationHubsManager manager = NotificationHubsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckAvailabilityResult response = manager.namespaces() - .checkAvailabilityWithResponse(new CheckAvailabilityParameters().withName("amdecte") - .withLocation("zrkgqhcjrefovg") - .withTags(mapOf("yvxyqjp", "sle")) + .checkAvailabilityWithResponse(new CheckAvailabilityParameters().withName("jhhyxxrwlycoduhp") + .withLocation("ky") + .withTags(mapOf("mzqa", "eddgssofw", "nbyxbaaabjyv", "krmnjijpxacqqud", "xnevfdnwn", "yffimrzrtuzqogs")) + .withIsAvailiable(true) .withSku(new Sku().withName(SkuName.FREE) - .withTier("tpngjcrcczsqpjh") - .withSize("daj") - .withFamily("ysou") - .withCapacity(104525492)) - .withIsAvailiable(false), com.azure.core.util.Context.NONE) + .withTier("yyceuzsoi") + .withSize("ud") + .withFamily("rx") + .withCapacity(1839855586)), + com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("fu", response.location()); - Assertions.assertEquals("odsfcpkvxodpuozm", response.tags().get("zydagfuaxbezyiuo")); - Assertions.assertEquals(true, response.isAvailiable()); - Assertions.assertEquals(SkuName.FREE, response.sku().name()); - Assertions.assertEquals("pfhyhl", response.sku().tier()); - Assertions.assertEquals("pmopjmc", response.sku().size()); - Assertions.assertEquals("tuo", response.sku().family()); - Assertions.assertEquals(607140678, response.sku().capacity()); + Assertions.assertTrue(response.isAvailiable()); + Assertions.assertEquals("aytdwkqbrq", response.location()); + Assertions.assertEquals("axhexiilivp", response.tags().get("tiirqtdqoa")); + Assertions.assertEquals(SkuName.STANDARD, response.sku().name()); + Assertions.assertEquals("zfgs", response.sku().tier()); + Assertions.assertEquals("yfxrx", response.sku().size()); + Assertions.assertEquals("eptra", response.sku().family()); + Assertions.assertEquals(1921470091, response.sku().capacity()); } // Use "Map.of" if available diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 56530904317d..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,96 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; -import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import com.azure.resourcemanager.notificationhubs.models.Sku; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"name\":\"kfrlhrxsbky\",\"provisioningState\":\"ycanuzbpzkafku\",\"region\":\"crnwbmeh\",\"metricId\":\"eyvjusrtslhspkde\",\"status\":\"aofmxagkvtme\",\"createdAt\":\"2020-12-28T20:08:12Z\",\"updatedAt\":\"2021-06-04T11:35:51Z\",\"serviceBusEndpoint\":\"hvljuahaquh\",\"subscriptionId\":\"hmdua\",\"scaleUnit\":\"exq\",\"enabled\":false,\"critical\":true,\"dataCenter\":\"ws\",\"namespaceType\":\"Messaging\"},\"sku\":{\"name\":\"Free\",\"tier\":\"pv\",\"size\":\"mzlfmisgwb\",\"family\":\"beldawkzbaliourq\",\"capacity\":997736872},\"location\":\"auhashsfwx\",\"tags\":{\"xcug\":\"w\",\"ovbvmeueciv\":\"cjooxdjebwpucwwf\"},\"id\":\"hzceuojgjrwjue\",\"name\":\"otwmcdyt\",\"type\":\"x\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NotificationHubsManager manager = NotificationHubsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NamespaceResource response = manager.namespaces() - .define("yqupedeojnabckh") - .withLocation("uyonobglaoc") - .withExistingResourceGroup("m") - .withTags(mapOf("yudxytlmoy", "ccm")) - .withSku(new Sku().withName(SkuName.FREE) - .withTier("uscrpabgyepsb") - .withSize("azqugxywpmueefj") - .withFamily("fqkquj") - .withCapacity(1148622887)) - .withNamePropertiesName("xpsiebtfhvpes") - .withProvisioningState("skrdqmhjj") - .withRegion("tldwkyzxuutk") - .withStatus("svlxotogtwrup") - .withCreatedAt(OffsetDateTime.parse("2021-08-21T23:24:20Z")) - .withUpdatedAt(OffsetDateTime.parse("2021-05-04T00:58:15Z")) - .withServiceBusEndpoint("i") - .withSubscriptionId("kvceoveilovnotyf") - .withScaleUnit("cnjbkcnxdhbt") - .withEnabled(false) - .withCritical(false) - .withDataCenter("pnvjtoqnermclf") - .withNamespaceType(NamespaceType.MESSAGING) - .create(); - - Assertions.assertEquals("auhashsfwx", response.location()); - Assertions.assertEquals("w", response.tags().get("xcug")); - Assertions.assertEquals(SkuName.FREE, response.sku().name()); - Assertions.assertEquals("pv", response.sku().tier()); - Assertions.assertEquals("mzlfmisgwb", response.sku().size()); - Assertions.assertEquals("beldawkzbaliourq", response.sku().family()); - Assertions.assertEquals(997736872, response.sku().capacity()); - Assertions.assertEquals("kfrlhrxsbky", response.namePropertiesName()); - Assertions.assertEquals("ycanuzbpzkafku", response.provisioningState()); - Assertions.assertEquals("crnwbmeh", response.region()); - Assertions.assertEquals("aofmxagkvtme", response.status()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T20:08:12Z"), response.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-04T11:35:51Z"), response.updatedAt()); - Assertions.assertEquals("hvljuahaquh", response.serviceBusEndpoint()); - Assertions.assertEquals("hmdua", response.subscriptionId()); - Assertions.assertEquals("exq", response.scaleUnit()); - Assertions.assertEquals(false, response.enabled()); - Assertions.assertEquals(true, response.critical()); - Assertions.assertEquals("ws", response.dataCenter()); - Assertions.assertEquals(NamespaceType.MESSAGING, response.namespaceType()); - } - - // 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/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteAuthorizationRuleWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteAuthorizationRuleWithResponseMockTests.java index af8c5ce2cdc3..3ec2482005a7 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteAuthorizationRuleWithResponseMockTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; import java.nio.charset.StandardCharsets; @@ -25,11 +25,10 @@ public void testDeleteAuthorizationRuleWithResponse() throws Exception { NotificationHubsManager manager = NotificationHubsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.namespaces() - .deleteAuthorizationRuleWithResponse("yxoegukgjnp", "ucgygevqz", "typmrbpizcdrqjsd", - com.azure.core.util.Context.NONE); + .deleteAuthorizationRuleWithResponse("tkuwhhmhykojo", "afnn", "lpichk", com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteByResourceGroupWithResponseMockTests.java similarity index 69% rename from sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteMockTests.java rename to sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteByResourceGroupWithResponseMockTests.java index a36570815241..1fea2ad34fbb 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteMockTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesDeleteByResourceGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; import java.nio.charset.StandardCharsets; @@ -15,9 +15,9 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class NamespacesDeleteMockTests { +public final class NamespacesDeleteByResourceGroupWithResponseMockTests { @Test - public void testDelete() throws Exception { + public void testDeleteWithResponse() throws Exception { String responseStr = "{}"; HttpClient httpClient @@ -25,9 +25,10 @@ public void testDelete() throws Exception { NotificationHubsManager manager = NotificationHubsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.namespaces().delete("czvyifq", "vkd", com.azure.core.util.Context.NONE); + manager.namespaces() + .deleteByResourceGroupWithResponse("h", "syocogjltdtbnnha", com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetByResourceGroupWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index ec05078870d2..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,60 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; -import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"name\":\"t\",\"provisioningState\":\"n\",\"region\":\"lexxbczwtru\",\"metricId\":\"qzbqjvsov\",\"status\":\"okacspk\",\"createdAt\":\"2021-04-15T03:02:29Z\",\"updatedAt\":\"2021-04-27T23:18:31Z\",\"serviceBusEndpoint\":\"bpxjmfl\",\"subscriptionId\":\"vnchrkcci\",\"scaleUnit\":\"zjuqkhrsaj\",\"enabled\":false,\"critical\":false,\"dataCenter\":\"oskg\",\"namespaceType\":\"Messaging\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"mjmvxieduugidyjr\",\"size\":\"byao\",\"family\":\"e\",\"capacity\":981492544},\"location\":\"onpc\",\"tags\":{\"eggzfb\":\"cohslkev\",\"ithlvmezyvshxm\":\"hfmvfaxkffe\",\"gigr\":\"sbbzo\"},\"id\":\"wburvjxxjnspydpt\",\"name\":\"oenkouknvudwti\",\"type\":\"kbldngkpocipa\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NotificationHubsManager manager = NotificationHubsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - NamespaceResource response = manager.namespaces() - .getByResourceGroupWithResponse("jsllrmv", "d", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("onpc", response.location()); - Assertions.assertEquals("cohslkev", response.tags().get("eggzfb")); - Assertions.assertEquals(SkuName.STANDARD, response.sku().name()); - Assertions.assertEquals("mjmvxieduugidyjr", response.sku().tier()); - Assertions.assertEquals("byao", response.sku().size()); - Assertions.assertEquals("e", response.sku().family()); - Assertions.assertEquals(981492544, response.sku().capacity()); - Assertions.assertEquals("t", response.namePropertiesName()); - Assertions.assertEquals("n", response.provisioningState()); - Assertions.assertEquals("lexxbczwtru", response.region()); - Assertions.assertEquals("okacspk", response.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-15T03:02:29Z"), response.createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T23:18:31Z"), response.updatedAt()); - Assertions.assertEquals("bpxjmfl", response.serviceBusEndpoint()); - Assertions.assertEquals("vnchrkcci", response.subscriptionId()); - Assertions.assertEquals("zjuqkhrsaj", response.scaleUnit()); - Assertions.assertEquals(false, response.enabled()); - Assertions.assertEquals(false, response.critical()); - Assertions.assertEquals("oskg", response.dataCenter()); - Assertions.assertEquals(NamespaceType.MESSAGING, response.namespaceType()); - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListByResourceGroupMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListByResourceGroupMockTests.java deleted file mode 100644 index 498bdfd17b0f..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListByResourceGroupMockTests.java +++ /dev/null @@ -1,60 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; -import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"name\":\"gshwankixz\",\"provisioningState\":\"njeputtmrywn\",\"region\":\"oqftiyqzrnkcq\",\"metricId\":\"xlwhzlsicoh\",\"status\":\"qnwvlrya\",\"createdAt\":\"2021-12-07T06:57Z\",\"updatedAt\":\"2021-11-18T07:56:25Z\",\"serviceBusEndpoint\":\"nmmqhgyxzkon\",\"subscriptionId\":\"uko\",\"scaleUnit\":\"yaxuconuqszfkb\",\"enabled\":false,\"critical\":true,\"dataCenter\":\"mjmwvvjektcx\",\"namespaceType\":\"NotificationHub\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"rsffrzpwvlqdqgbi\",\"size\":\"lihkaetcktvfc\",\"family\":\"fsnkymuctq\",\"capacity\":361988947},\"location\":\"bebrjcxerfuwuttt\",\"tags\":{\"hfnljkyq\":\"jrbirphxepcyv\",\"uujqgidokgjljyo\":\"j\",\"bgsncghkjeszzhb\":\"gvcl\",\"mpvecxgodebfqk\":\"jhtxfvgxbfsmxne\"},\"id\":\"rbmpukgri\",\"name\":\"flz\",\"type\":\"fbxzpuzycisp\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NotificationHubsManager manager = NotificationHubsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.namespaces().listByResourceGroup("pbuxwgipwhon", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("bebrjcxerfuwuttt", response.iterator().next().location()); - Assertions.assertEquals("jrbirphxepcyv", response.iterator().next().tags().get("hfnljkyq")); - Assertions.assertEquals(SkuName.STANDARD, response.iterator().next().sku().name()); - Assertions.assertEquals("rsffrzpwvlqdqgbi", response.iterator().next().sku().tier()); - Assertions.assertEquals("lihkaetcktvfc", response.iterator().next().sku().size()); - Assertions.assertEquals("fsnkymuctq", response.iterator().next().sku().family()); - Assertions.assertEquals(361988947, response.iterator().next().sku().capacity()); - Assertions.assertEquals("gshwankixz", response.iterator().next().namePropertiesName()); - Assertions.assertEquals("njeputtmrywn", response.iterator().next().provisioningState()); - Assertions.assertEquals("oqftiyqzrnkcq", response.iterator().next().region()); - Assertions.assertEquals("qnwvlrya", response.iterator().next().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T06:57Z"), response.iterator().next().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-18T07:56:25Z"), response.iterator().next().updatedAt()); - Assertions.assertEquals("nmmqhgyxzkon", response.iterator().next().serviceBusEndpoint()); - Assertions.assertEquals("uko", response.iterator().next().subscriptionId()); - Assertions.assertEquals("yaxuconuqszfkb", response.iterator().next().scaleUnit()); - Assertions.assertEquals(false, response.iterator().next().enabled()); - Assertions.assertEquals(true, response.iterator().next().critical()); - Assertions.assertEquals("mjmwvvjektcx", response.iterator().next().dataCenter()); - Assertions.assertEquals(NamespaceType.NOTIFICATION_HUB, response.iterator().next().namespaceType()); - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListMockTests.java deleted file mode 100644 index 27fbbe801727..000000000000 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NamespacesListMockTests.java +++ /dev/null @@ -1,59 +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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; -import com.azure.resourcemanager.notificationhubs.models.NamespaceResource; -import com.azure.resourcemanager.notificationhubs.models.NamespaceType; -import com.azure.resourcemanager.notificationhubs.models.SkuName; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class NamespacesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"name\":\"ahmgkbrp\",\"provisioningState\":\"dhibnuq\",\"region\":\"pikad\",\"metricId\":\"vtq\",\"status\":\"n\",\"createdAt\":\"2021-11-05T12:10:44Z\",\"updatedAt\":\"2021-04-18T08:45:47Z\",\"serviceBusEndpoint\":\"jggmebfsiarbu\",\"subscriptionId\":\"cvpnazzmhjrunmpx\",\"scaleUnit\":\"dbhrbnlankxm\",\"enabled\":false,\"critical\":true,\"dataCenter\":\"enbtkcxywny\",\"namespaceType\":\"Messaging\"},\"sku\":{\"name\":\"Basic\",\"tier\":\"lqidyby\",\"size\":\"zfcl\",\"family\":\"axdbabph\",\"capacity\":2118768153},\"location\":\"qlfktsths\",\"tags\":{\"wwrq\":\"cmnyyazttb\",\"ywbiexzfeyueax\":\"uedck\",\"wbhqwal\":\"bxu\",\"kzjancuxrhdwbav\":\"uzyoxaep\"},\"id\":\"bniwdj\",\"name\":\"wz\",\"type\":\"s\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - NotificationHubsManager manager = NotificationHubsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.namespaces().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qlfktsths", response.iterator().next().location()); - Assertions.assertEquals("cmnyyazttb", response.iterator().next().tags().get("wwrq")); - Assertions.assertEquals(SkuName.BASIC, response.iterator().next().sku().name()); - Assertions.assertEquals("lqidyby", response.iterator().next().sku().tier()); - Assertions.assertEquals("zfcl", response.iterator().next().sku().size()); - Assertions.assertEquals("axdbabph", response.iterator().next().sku().family()); - Assertions.assertEquals(2118768153, response.iterator().next().sku().capacity()); - Assertions.assertEquals("ahmgkbrp", response.iterator().next().namePropertiesName()); - Assertions.assertEquals("dhibnuq", response.iterator().next().provisioningState()); - Assertions.assertEquals("pikad", response.iterator().next().region()); - Assertions.assertEquals("n", response.iterator().next().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T12:10:44Z"), response.iterator().next().createdAt()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T08:45:47Z"), response.iterator().next().updatedAt()); - Assertions.assertEquals("jggmebfsiarbu", response.iterator().next().serviceBusEndpoint()); - Assertions.assertEquals("cvpnazzmhjrunmpx", response.iterator().next().subscriptionId()); - Assertions.assertEquals("dbhrbnlankxm", response.iterator().next().scaleUnit()); - Assertions.assertEquals(false, response.iterator().next().enabled()); - Assertions.assertEquals(true, response.iterator().next().critical()); - Assertions.assertEquals("enbtkcxywny", response.iterator().next().dataCenter()); - Assertions.assertEquals(NamespaceType.MESSAGING, response.iterator().next().namespaceType()); - } -} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NetworkAclsTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NetworkAclsTests.java new file mode 100644 index 000000000000..741ecf7a687d --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NetworkAclsTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.AccessRights; +import com.azure.resourcemanager.notificationhubs.models.IpRule; +import com.azure.resourcemanager.notificationhubs.models.NetworkAcls; +import com.azure.resourcemanager.notificationhubs.models.PublicInternetAuthorizationRule; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class NetworkAclsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkAcls model = BinaryData.fromString( + "{\"ipRules\":[{\"ipMask\":\"ysou\",\"rights\":[\"Send\"]},{\"ipMask\":\"canoaeupf\",\"rights\":[\"Send\",\"Listen\",\"Manage\",\"Manage\"]}],\"publicNetworkRule\":{\"rights\":[\"Send\",\"Manage\"]}}") + .toObject(NetworkAcls.class); + Assertions.assertEquals("ysou", model.ipRules().get(0).ipMask()); + Assertions.assertEquals(AccessRights.SEND, model.ipRules().get(0).rights().get(0)); + Assertions.assertEquals(AccessRights.SEND, model.publicNetworkRule().rights().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkAcls model = new NetworkAcls() + .withIpRules(Arrays.asList(new IpRule().withIpMask("ysou").withRights(Arrays.asList(AccessRights.SEND)), + new IpRule().withIpMask("canoaeupf") + .withRights(Arrays.asList(AccessRights.SEND, AccessRights.LISTEN, AccessRights.MANAGE, + AccessRights.MANAGE)))) + .withPublicNetworkRule(new PublicInternetAuthorizationRule() + .withRights(Arrays.asList(AccessRights.SEND, AccessRights.MANAGE))); + model = BinaryData.fromObject(model).toObject(NetworkAcls.class); + Assertions.assertEquals("ysou", model.ipRules().get(0).ipMask()); + Assertions.assertEquals(AccessRights.SEND, model.ipRules().get(0).rights().get(0)); + Assertions.assertEquals(AccessRights.SEND, model.publicNetworkRule().rights().get(0)); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilityWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilityWithResponseMockTests.java index 6a0e06efa301..eef62f598b54 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilityWithResponseMockTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsCheckNotificationHubAvailabilityWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; import com.azure.resourcemanager.notificationhubs.models.CheckAvailabilityParameters; @@ -26,37 +26,37 @@ public final class NotificationHubsCheckNotificationHubAvailabilityWithResponseM @Test public void testCheckNotificationHubAvailabilityWithResponse() throws Exception { String responseStr - = "{\"isAvailiable\":false,\"sku\":{\"name\":\"Standard\",\"tier\":\"bexrmcq\",\"size\":\"ycnojvknmefqsg\",\"family\":\"ah\",\"capacity\":2048055130},\"location\":\"y\",\"tags\":{\"zlmwlxkvugfhz\":\"vgqzcjrvxd\",\"hnnpr\":\"vawjvzunlu\",\"ultskzbbtdz\":\"xipeilpjzuaejx\",\"ekg\":\"mv\"},\"id\":\"wozuhkf\",\"name\":\"bsjyofdx\",\"type\":\"uusdttouwa\"}"; + = "{\"isAvailiable\":true,\"location\":\"shfwpracstwity\",\"tags\":{\"md\":\"vxccedcp\",\"zxltjcvn\":\"odn\",\"xqi\":\"ltiugcxnavv\"},\"sku\":{\"name\":\"Standard\",\"tier\":\"nyowxwlmdjrkvfg\",\"size\":\"fvpdbo\",\"family\":\"cizsjqlhkrribdei\",\"capacity\":1262026177},\"id\":\"qkgh\",\"name\":\"xndzwm\",\"type\":\"refajpjorwkqnyh\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NotificationHubsManager manager = NotificationHubsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckAvailabilityResult response = manager.notificationHubs() - .checkNotificationHubAvailabilityWithResponse("btdhxujznbm", "ow", - new CheckAvailabilityParameters().withName("lupj") - .withLocation("plrbpbewtghf") - .withTags(mapOf("wxzvlvqhjkb", "c", "iebwwaloayqcgwrt", "gibtnm", "zg", "j")) + .checkNotificationHubAvailabilityWithResponse("xggicccnxqhuexmk", "tlstvlzywem", + new CheckAvailabilityParameters().withName("iypbsfgytgusl") + .withLocation("ukyhejhzis") + .withTags(mapOf("pv", "pelol")) + .withIsAvailiable(false) .withSku(new Sku().withName(SkuName.BASIC) - .withTier("htxongmtsavjc") - .withSize("wxqpsrknftguvri") - .withFamily("prwmdyvxqt") - .withCapacity(1831574988)) - .withIsAvailiable(false), + .withTier("ujzra") + .withSize("twdw") + .withFamily("tswiby") + .withCapacity(403427600)), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("y", response.location()); - Assertions.assertEquals("vgqzcjrvxd", response.tags().get("zlmwlxkvugfhz")); - Assertions.assertEquals(false, response.isAvailiable()); + Assertions.assertTrue(response.isAvailiable()); + Assertions.assertEquals("shfwpracstwity", response.location()); + Assertions.assertEquals("vxccedcp", response.tags().get("md")); Assertions.assertEquals(SkuName.STANDARD, response.sku().name()); - Assertions.assertEquals("bexrmcq", response.sku().tier()); - Assertions.assertEquals("ycnojvknmefqsg", response.sku().size()); - Assertions.assertEquals("ah", response.sku().family()); - Assertions.assertEquals(2048055130, response.sku().capacity()); + Assertions.assertEquals("nyowxwlmdjrkvfg", response.sku().tier()); + Assertions.assertEquals("fvpdbo", response.sku().size()); + Assertions.assertEquals("cizsjqlhkrribdei", response.sku().family()); + Assertions.assertEquals(1262026177, response.sku().capacity()); } // Use "Map.of" if available diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDebugSendWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDebugSendWithResponseMockTests.java index b2ea20801691..5dfbf912296a 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDebugSendWithResponseMockTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDebugSendWithResponseMockTests.java @@ -1,17 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; import com.azure.resourcemanager.notificationhubs.models.DebugSendResponse; -import com.azure.resourcemanager.notificationhubs.models.SkuName; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,28 +21,20 @@ public final class NotificationHubsDebugSendWithResponseMockTests { @Test public void testDebugSendWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"success\":45.423527,\"failure\":32.826424,\"results\":\"datatfdygpfqb\"},\"sku\":{\"name\":\"Basic\",\"tier\":\"op\",\"size\":\"qrhhu\",\"family\":\"pppcqeqxo\",\"capacity\":280761286},\"location\":\"ahzxctobgbk\",\"tags\":{\"grcfb\":\"izpost\",\"bpvjymjhx\":\"nrmfqjhhk\",\"n\":\"j\",\"ivkrtsw\":\"u\"},\"id\":\"xqzvszjfa\",\"name\":\"vjfdx\",\"type\":\"ivetvtcq\"}"; + = "{\"properties\":{\"success\":3190948346133126702,\"failure\":7790831784605788648,\"results\":[{\"applicationPlatform\":\"opidoamciodh\",\"pnsHandle\":\"azxkhnzbonlwnto\",\"registrationId\":\"okdwb\",\"outcome\":\"kszzcmrvexztv\"},{\"applicationPlatform\":\"qgsfraoyzkoow\",\"pnsHandle\":\"mnguxawqaldsyu\",\"registrationId\":\"imerqfobwyznk\",\"outcome\":\"kutwpf\"},{\"applicationPlatform\":\"a\",\"pnsHandle\":\"hrskdsnfd\",\"registrationId\":\"oakgtdlmkkzev\",\"outcome\":\"hewpusdsttwv\"},{\"applicationPlatform\":\"vbbejdcng\",\"pnsHandle\":\"m\",\"registrationId\":\"kufgmj\",\"outcome\":\"wr\"}]},\"location\":\"rtwaenuuzko\",\"tags\":{\"hziuiefozbhdms\":\"inrfdwoyu\",\"zqhof\":\"l\"},\"id\":\"maequiahxicslfa\",\"name\":\"qzpiyyl\",\"type\":\"alnswhccsphk\"}"; HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 201, responseStr.getBytes(StandardCharsets.UTF_8))); + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NotificationHubsManager manager = NotificationHubsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DebugSendResponse response = manager.notificationHubs() - .debugSendWithResponse("gylgqgitxmedjvcs", "ynqwwncwzzhxgk", "rmgucnap", "datat", - com.azure.core.util.Context.NONE) + .debugSendWithResponse("tcje", "ftwwaezkojvdc", "zfoqouicybxar", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("ahzxctobgbk", response.location()); - Assertions.assertEquals("izpost", response.tags().get("grcfb")); - Assertions.assertEquals(SkuName.BASIC, response.sku().name()); - Assertions.assertEquals("op", response.sku().tier()); - Assertions.assertEquals("qrhhu", response.sku().size()); - Assertions.assertEquals("pppcqeqxo", response.sku().family()); - Assertions.assertEquals(280761286, response.sku().capacity()); - Assertions.assertEquals(45.423527F, response.success()); - Assertions.assertEquals(32.826424F, response.failure()); + Assertions.assertEquals("rtwaenuuzko", response.location()); + Assertions.assertEquals("inrfdwoyu", response.tags().get("hziuiefozbhdms")); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteAuthorizationRuleWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteAuthorizationRuleWithResponseMockTests.java index 2b19c64c6fcc..5c5035cf640d 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteAuthorizationRuleWithResponseMockTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteAuthorizationRuleWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteAuthorizationRuleWithResponse() throws Exception { NotificationHubsManager manager = NotificationHubsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.notificationHubs() - .deleteAuthorizationRuleWithResponse("vshqjohxcr", "bfovasrruvwbhsq", "sub", "gjb", + .deleteAuthorizationRuleWithResponse("fp", "vm", "ipaslthaqfxssmwu", "wbdsr", com.azure.core.util.Context.NONE); } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteWithResponseMockTests.java index 454db3e7e7e2..544c405d100a 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteWithResponseMockTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/NotificationHubsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { NotificationHubsManager manager = NotificationHubsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.notificationHubs().deleteWithResponse("oekqvk", "lns", "vbxwyjsflhh", com.azure.core.util.Context.NONE); + manager.notificationHubs().deleteWithResponse("hmk", "c", "rauwjuetaebu", com.azure.core.util.Context.NONE); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationDisplayTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationDisplayTests.java index fcb7d0c122f7..74da6d86e9e9 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationDisplayTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -10,14 +10,8 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData - .fromString("{\"provider\":\"psqucmpoyf\",\"resource\":\"fogknygjofjdde\",\"operation\":\"rd\"}") + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"osygex\",\"resource\":\"ojakhmsbzjhcrze\",\"operation\":\"phlxa\",\"description\":\"thqt\"}") .toObject(OperationDisplay.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationInnerTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationInnerTests.java index 32833a63b929..fbca37f31c4d 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationInnerTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.notificationhubs.fluent.models.OperationInner; -import com.azure.resourcemanager.notificationhubs.models.OperationDisplay; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"esaagdfm\",\"display\":{\"provider\":\"lhjxr\",\"resource\":\"kwm\",\"operation\":\"ktsizntocipaou\"}}") + "{\"name\":\"qucmpo\",\"display\":{\"provider\":\"kfo\",\"resource\":\"nygj\",\"operation\":\"jddeqsrdeupewnw\",\"description\":\"itjz\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"mofcq\",\"displayName\":\"my\",\"blobDuration\":\"kdtmlxhekuk\",\"categoryGroups\":[\"xukcdmpar\",\"ryuanzwuxzdxtay\"]}],\"metricSpecifications\":[{\"name\":\"whfpmrqobmtu\",\"displayName\":\"nryrtihf\",\"displayDescription\":\"ijbpzvgnwzsymgl\",\"unit\":\"fcyzkohdbihanufh\",\"aggregationType\":\"bj\",\"availabilities\":[{}],\"supportedTimeGrainTypes\":[\"th\",\"qhabifpikxwcz\",\"yscnpqxu\"],\"metricFilterPattern\":\"vyq\",\"fillGapWithZero\":false},{\"name\":\"ybrk\",\"displayName\":\"dumjgrtfwvuk\",\"displayDescription\":\"audccsnhs\",\"unit\":\"nyejhkryhtnap\",\"aggregationType\":\"wlokjyem\",\"availabilities\":[{},{}],\"supportedTimeGrainTypes\":[\"pjoxzjnch\",\"ejspodmail\",\"ydehoj\",\"yahux\"],\"metricFilterPattern\":\"pmqnja\",\"fillGapWithZero\":true},{\"name\":\"jsprozvcpute\",\"displayName\":\"vwmf\",\"displayDescription\":\"t\",\"unit\":\"mdvpjhulsu\",\"aggregationType\":\"mkjozkrwf\",\"availabilities\":[{},{}],\"supportedTimeGrainTypes\":[\"jpslwejd\",\"vwryoqpso\"],\"metricFilterPattern\":\"ctazakljlahbcryf\",\"fillGapWithZero\":false}]}}}") .toObject(OperationInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationListResultTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationListResultTests.java index aa96dcfb52a6..622f647a9d34 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationListResultTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.notificationhubs.models.OperationListResult; +import com.azure.resourcemanager.notificationhubs.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"provider\":\"zopbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\"}},{\"name\":\"zehtbmu\",\"display\":{\"provider\":\"wnoi\",\"resource\":\"wlrxyb\",\"operation\":\"oqijgkdmbpaz\"}},{\"name\":\"bc\",\"display\":{\"provider\":\"dznrbtcqq\",\"resource\":\"qglhq\",\"operation\":\"ufo\"}}],\"nextLink\":\"jywif\"}") + "{\"value\":[{\"name\":\"hq\",\"display\":{\"provider\":\"jxpybczmeh\",\"resource\":\"zopbsphrupidgs\",\"operation\":\"bejhphoycmsxa\",\"description\":\"hdxbmtqio\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}],\"metricSpecifications\":[{}]}}},{\"name\":\"p\",\"display\":{\"provider\":\"oizh\",\"resource\":\"rxybqsoq\",\"operation\":\"gkdmb\",\"description\":\"zlobcufpd\"},\"isDataAction\":false,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{}],\"metricSpecifications\":[{},{},{}]}}},{\"name\":\"qglhq\",\"display\":{\"provider\":\"foooj\",\"resource\":\"ifsqesaagdfmg\",\"operation\":\"lhjxr\",\"description\":\"kwm\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{},{},{},{}],\"metricSpecifications\":[{}]}}}],\"nextLink\":\"cipaouaj\"}") .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); + Assertions.assertEquals("cipaouaj", model.nextLink()); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationPropertiesTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationPropertiesTests.java new file mode 100644 index 000000000000..c1975b5d2fc4 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationPropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.OperationProperties; + +public final class OperationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationProperties model = BinaryData.fromString( + "{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"pfzfsinzgvfc\",\"displayName\":\"wzo\",\"blobDuration\":\"j\",\"categoryGroups\":[\"lluwfzitonpeq\",\"pjkjlxofpdv\",\"pfxxy\"]}],\"metricSpecifications\":[{\"name\":\"nmayhuybb\",\"displayName\":\"odepoogin\",\"displayDescription\":\"amiheognarxz\",\"unit\":\"heotusiv\",\"aggregationType\":\"v\",\"availabilities\":[{\"timeGrain\":\"ihnhun\",\"blobDuration\":\"wjzrnfygxgisp\"},{\"timeGrain\":\"vtz\",\"blobDuration\":\"ufubl\"}],\"supportedTimeGrainTypes\":[\"xqeofjaeqjhqjba\",\"v\"],\"metricFilterPattern\":\"mjqulngsn\",\"fillGapWithZero\":true},{\"name\":\"bkzgcwrwclx\",\"displayName\":\"rljdouskcqv\",\"displayDescription\":\"cr\",\"unit\":\"dkwt\",\"aggregationType\":\"xbnjbiksq\",\"availabilities\":[{\"timeGrain\":\"sainqpjwnzl\",\"blobDuration\":\"fmppe\"},{\"timeGrain\":\"vmgxsab\",\"blobDuration\":\"qduujitcjczdz\"}],\"supportedTimeGrainTypes\":[\"dhkrwpdappdsbdk\",\"wrwjfeu\"],\"metricFilterPattern\":\"hutje\",\"fillGapWithZero\":false},{\"name\":\"ldhugjzzdatqxh\",\"displayName\":\"dgeablgphu\",\"displayDescription\":\"cndvkaozwyiftyhx\",\"unit\":\"rokft\",\"aggregationType\":\"olniwpwcukjf\",\"availabilities\":[{\"timeGrain\":\"w\",\"blobDuration\":\"lryplwckbasyy\"},{\"timeGrain\":\"ddhsgcbacphe\",\"blobDuration\":\"ot\"}],\"supportedTimeGrainTypes\":[\"gou\",\"zndlikwy\"],\"metricFilterPattern\":\"gfgibm\",\"fillGapWithZero\":false}]}}") + .toObject(OperationProperties.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationsListMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationsListMockTests.java index d3c2c03dc252..3aa8abb3b98e 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationsListMockTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; import com.azure.resourcemanager.notificationhubs.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"jjugwdkcglhslaz\",\"display\":{\"provider\":\"ggd\",\"resource\":\"ixhbkuofqweykhm\",\"operation\":\"evfyexfwhybcib\"}}]}"; + = "{\"value\":[{\"name\":\"podxunkb\",\"display\":{\"provider\":\"mubyynt\",\"resource\":\"rbqtkoie\",\"operation\":\"eotg\",\"description\":\"l\"},\"isDataAction\":true,\"properties\":{\"serviceSpecification\":{\"logSpecifications\":[{\"name\":\"wzizxbmpgcjefuzm\",\"displayName\":\"pbttdum\",\"blobDuration\":\"p\",\"categoryGroups\":[\"bmnzbtbhjpgl\",\"fgohdneuelfphs\",\"yhtozfikdowwqu\",\"v\"]},{\"name\":\"xclvit\",\"displayName\":\"qzonosggbhcohf\",\"blobDuration\":\"sjnkal\",\"categoryGroups\":[\"iiswacffgdkzze\",\"kfvhqcrailvpn\",\"pfuflrw\"]},{\"name\":\"hdlxyjrxsagafcn\",\"displayName\":\"gwq\",\"blobDuration\":\"nedgfbc\",\"categoryGroups\":[\"vq\",\"pkeqdcvdrhvoo\",\"sotbob\"]}],\"metricSpecifications\":[{\"name\":\"cjwvn\",\"displayName\":\"ld\",\"displayDescription\":\"gx\",\"unit\":\"rslpmutwuoeg\",\"aggregationType\":\"khjwn\",\"availabilities\":[{},{}],\"supportedTimeGrainTypes\":[\"uicpd\",\"gk\",\"zl\",\"mbmpaxmodfvuefy\"],\"metricFilterPattern\":\"bpfvm\",\"fillGapWithZero\":false},{\"name\":\"fouyf\",\"displayName\":\"akcp\",\"displayDescription\":\"yzvqt\",\"unit\":\"ubex\",\"aggregationType\":\"zksmondj\",\"availabilities\":[{},{},{},{}],\"supportedTimeGrainTypes\":[\"ypomgkopkwho\",\"v\",\"ajqgxy\",\"mocmbqfqvmk\"],\"metricFilterPattern\":\"oz\",\"fillGapWithZero\":true},{\"name\":\"elxprglyatddck\",\"displayName\":\"cuejrjxgci\",\"displayDescription\":\"brh\",\"unit\":\"xsdqrhzoymibmrqy\",\"aggregationType\":\"ahwfluszdtmhrk\",\"availabilities\":[{},{}],\"supportedTimeGrainTypes\":[\"voqacpiexpbt\",\"iwbwoenwashrtdtk\"],\"metricFilterPattern\":\"qxwbpokulpiu\",\"fillGapWithZero\":false}]}}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); NotificationHubsManager manager = NotificationHubsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionPropertiesTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionPropertiesTests.java new file mode 100644 index 000000000000..6ca727dc67e9 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionPropertiesTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateEndpointConnection; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionProperties model = BinaryData.fromString( + "{\"provisioningState\":\"UpdatingByProxy\",\"privateEndpoint\":{\"id\":\"koklya\"},\"groupIds\":[\"onuq\",\"zf\",\"beypewrmjmw\",\"vjektcxsenh\"],\"privateLinkServiceConnectionState\":{\"status\":\"Disconnected\",\"description\":\"frzpwvlqdqgb\",\"actionsRequired\":\"ylihkaetckt\"}}") + .toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals(PrivateEndpointConnectionProvisioningState.UPDATING_BY_PROXY, + model.provisioningState()); + Assertions.assertEquals(PrivateLinkConnectionStatus.DISCONNECTED, + model.privateLinkServiceConnectionState().status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionProperties model = new PrivateEndpointConnectionProperties() + .withProvisioningState(PrivateEndpointConnectionProvisioningState.UPDATING_BY_PROXY) + .withPrivateEndpoint(new RemotePrivateEndpointConnection()) + .withPrivateLinkServiceConnectionState( + new RemotePrivateLinkServiceConnectionState().withStatus(PrivateLinkConnectionStatus.DISCONNECTED)); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionProperties.class); + Assertions.assertEquals(PrivateEndpointConnectionProvisioningState.UPDATING_BY_PROXY, + model.provisioningState()); + Assertions.assertEquals(PrivateLinkConnectionStatus.DISCONNECTED, + model.privateLinkServiceConnectionState().status()); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionResourceInnerTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionResourceInnerTests.java new file mode 100644 index 000000000000..fc5ececfd1c4 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionResourceInnerTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateEndpointConnection; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionResourceInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"zfbishcbkhaj\"},\"groupIds\":[\"eamdp\",\"agalpbuxwgipwhon\",\"wkgshwa\",\"kix\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"eputtmrywnuzoqf\",\"actionsRequired\":\"yqzrnkcqvyxlw\"}},\"id\":\"lsicohoqqnwv\",\"name\":\"ryavwhheunmmqh\",\"type\":\"yxzk\"}") + .toObject(PrivateEndpointConnectionResourceInner.class); + Assertions.assertEquals(PrivateEndpointConnectionProvisioningState.UPDATING, + model.properties().provisioningState()); + Assertions.assertEquals(PrivateLinkConnectionStatus.APPROVED, + model.properties().privateLinkServiceConnectionState().status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PrivateEndpointConnectionResourceInner model + = new PrivateEndpointConnectionResourceInner().withProperties(new PrivateEndpointConnectionProperties() + .withProvisioningState(PrivateEndpointConnectionProvisioningState.UPDATING) + .withPrivateEndpoint(new RemotePrivateEndpointConnection()) + .withPrivateLinkServiceConnectionState( + new RemotePrivateLinkServiceConnectionState().withStatus(PrivateLinkConnectionStatus.APPROVED))); + model = BinaryData.fromObject(model).toObject(PrivateEndpointConnectionResourceInner.class); + Assertions.assertEquals(PrivateEndpointConnectionProvisioningState.UPDATING, + model.properties().provisioningState()); + Assertions.assertEquals(PrivateLinkConnectionStatus.APPROVED, + model.properties().privateLinkServiceConnectionState().status()); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionResourceListResultTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionResourceListResultTests.java new file mode 100644 index 000000000000..053ca7e08c23 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionResourceListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.implementation.models.PrivateEndpointConnectionResourceListResult; +import org.junit.jupiter.api.Assertions; + +public final class PrivateEndpointConnectionResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateEndpointConnectionResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Unknown\",\"privateEndpoint\":{\"id\":\"xqpsrknftguv\"},\"groupIds\":[\"hprwmdyv\",\"qtayri\",\"wroyqbexrmcq\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"ojvknmefqsgzvaha\",\"actionsRequired\":\"y\"}},\"id\":\"pvgqzcjrvxdjzlm\",\"name\":\"lxkvu\",\"type\":\"fhzovawjvzunluth\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"i\"},\"groupIds\":[\"lpjzuaejxdu\",\"tskzbbtdzumveek\",\"pwo\",\"uh\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"jyofdxluusdtto\",\"actionsRequired\":\"aboekqv\"}},\"id\":\"lns\",\"name\":\"vbxwyjsflhh\",\"type\":\"aalnjixi\"},{\"properties\":{\"provisioningState\":\"DeletingByProxy\",\"privateEndpoint\":{\"id\":\"oyaqcslyjpkiid\"},\"groupIds\":[\"xznelixhnrztf\",\"lhbnxkna\",\"aulppggd\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"nyiropuhpi\",\"actionsRequired\":\"pgylg\"}},\"id\":\"itxmedjvcslynqww\",\"name\":\"cwzzhxgktr\",\"type\":\"gucnapkte\"},{\"properties\":{\"provisioningState\":\"Updating\",\"privateEndpoint\":{\"id\":\"tfdygpfqb\"},\"groupIds\":[\"eopzfqrhhuaopp\",\"cq\",\"qxolzdahzx\",\"t\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"dmoizpostmg\",\"actionsRequired\":\"fbunrmfqjhhk\"}},\"id\":\"pvjymjhxxjyng\",\"name\":\"divkrt\",\"type\":\"wbxqzvszjfau\"}],\"nextLink\":\"fdxxivetvtcqaqtd\"}") + .toObject(PrivateEndpointConnectionResourceListResult.class); + Assertions.assertEquals("fdxxivetvtcqaqtd", model.nextLink()); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdWithResponseMockTests.java new file mode 100644 index 000000000000..cc21f9cf7684 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetGroupIdWithResponseMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsGetGroupIdWithResponseMockTests { + @Test + public void testGetGroupIdWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"groupId\":\"xnfaazpxdtnk\",\"requiredMembers\":[\"qjjlwuen\",\"rkpyouaibrebqaay\",\"j\",\"ixqtn\"],\"requiredZoneNames\":[\"ezl\",\"fffiak\"]},\"id\":\"pqqmted\",\"name\":\"tmmjihyeozph\",\"type\":\"wau\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NotificationHubsManager manager = NotificationHubsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateLinkResource response = manager.privateEndpointConnections() + .getGroupIdWithResponse("saz", "jjoqkagf", "sxtta", com.azure.core.util.Context.NONE) + .getValue(); + + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java new file mode 100644 index 000000000000..3a6ece2ba994 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsGetWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Creating\",\"privateEndpoint\":{\"id\":\"uq\"},\"groupIds\":[\"ygz\",\"vdnkfxusem\",\"wzrmuh\",\"pfcqdp\"],\"privateLinkServiceConnectionState\":{\"status\":\"Approved\",\"description\":\"psvuoymgc\",\"actionsRequired\":\"lvez\"}},\"id\":\"pqlmfe\",\"name\":\"kerqwkyh\",\"type\":\"ob\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NotificationHubsManager manager = NotificationHubsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnectionResource response = manager.privateEndpointConnections() + .getWithResponse("mtnvyq", "atkzwpcnpw", "cjaesgvvs", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(PrivateEndpointConnectionProvisioningState.CREATING, + response.properties().provisioningState()); + Assertions.assertEquals(PrivateLinkConnectionStatus.APPROVED, + response.properties().privateLinkServiceConnectionState().status()); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsMockTests.java new file mode 100644 index 000000000000..f5cf6e0ebca0 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListGroupIdsMockTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsListGroupIdsMockTests { + @Test + public void testListGroupIds() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"groupId\":\"stotxh\",\"requiredMembers\":[\"jbypel\",\"c\",\"vhixbjxy\",\"w\"],\"requiredZoneNames\":[\"r\",\"ool\",\"ttpkiwkkbnujrywv\"]},\"id\":\"lbfpncurd\",\"name\":\"iwii\",\"type\":\"htywubxcbihwq\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NotificationHubsManager manager = NotificationHubsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.privateEndpointConnections() + .listGroupIds("qncygupkvi", "mdscwxqupev", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListMockTests.java new file mode 100644 index 000000000000..25649afea163 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsListMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"privateEndpoint\":{\"id\":\"ipn\"},\"groupIds\":[\"mcwaekrrjr\",\"afxtsgum\",\"jglikkxwslolb\",\"pvuzlmv\"],\"privateLinkServiceConnectionState\":{\"status\":\"Pending\",\"description\":\"tgp\",\"actionsRequired\":\"rpw\"}},\"id\":\"eznoig\",\"name\":\"rnjwmw\",\"type\":\"pn\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NotificationHubsManager manager = NotificationHubsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.privateEndpointConnections().list("vrvmtgjqppyost", "on", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointConnectionProvisioningState.DELETING, + response.iterator().next().properties().provisioningState()); + Assertions.assertEquals(PrivateLinkConnectionStatus.PENDING, + response.iterator().next().properties().privateLinkServiceConnectionState().status()); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateMockTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateMockTests.java new file mode 100644 index 000000000000..27c0fd8bf094 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateEndpointConnectionsUpdateMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.notificationhubs.NotificationHubsManager; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateEndpointConnectionResourceInner; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProperties; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.notificationhubs.models.PrivateEndpointConnectionResource; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateEndpointConnection; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateLinkServiceConnectionState; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PrivateEndpointConnectionsUpdateMockTests { + @Test + public void testUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"privateEndpoint\":{\"id\":\"fegxuvwzfb\"},\"groupIds\":[\"mctlpdngitv\",\"bmhrixkwmyijejv\"],\"privateLinkServiceConnectionState\":{\"status\":\"Rejected\",\"description\":\"pna\",\"actionsRequired\":\"exccbdreaxhcexd\"}},\"id\":\"vqahqkghtpwi\",\"name\":\"nhyjsv\",\"type\":\"ycxzbfvoo\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + NotificationHubsManager manager = NotificationHubsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PrivateEndpointConnectionResource response + = manager.privateEndpointConnections() + .update("pg", "edkowepbqpcrfk", "wccsnjvcdwxlpqek", + new PrivateEndpointConnectionResourceInner() + .withProperties( + new PrivateEndpointConnectionProperties() + .withProvisioningState(PrivateEndpointConnectionProvisioningState.SUCCEEDED) + .withPrivateEndpoint(new RemotePrivateEndpointConnection()) + .withPrivateLinkServiceConnectionState(new RemotePrivateLinkServiceConnectionState() + .withStatus(PrivateLinkConnectionStatus.REJECTED))), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals(PrivateEndpointConnectionProvisioningState.SUCCEEDED, + response.properties().provisioningState()); + Assertions.assertEquals(PrivateLinkConnectionStatus.REJECTED, + response.properties().privateLinkServiceConnectionState().status()); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourceInnerTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourceInnerTests.java new file mode 100644 index 000000000000..cfe53bdc3f23 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourceInnerTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.fluent.models.PrivateLinkResourceInner; + +public final class PrivateLinkResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceInner model = BinaryData.fromString( + "{\"properties\":{\"groupId\":\"cbxvwvxyslqbh\",\"requiredMembers\":[\"obl\",\"tkblmpewww\",\"bkrvrnsvshqj\"],\"requiredZoneNames\":[\"crsbfovasr\"]},\"id\":\"v\",\"name\":\"bhsqfsubcgjbirxb\",\"type\":\"ybsrfbjfdtwss\"}") + .toObject(PrivateLinkResourceInner.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourceListResultTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourceListResultTests.java new file mode 100644 index 000000000000..a48d43b6e64a --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourceListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.implementation.models.PrivateLinkResourceListResult; +import org.junit.jupiter.api.Assertions; + +public final class PrivateLinkResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"groupId\":\"gdrjervnaenqpe\",\"requiredMembers\":[\"doy\",\"mifthnzdnd\",\"l\",\"nayqi\"],\"requiredZoneNames\":[\"duhavhqlkt\",\"umaq\",\"lbg\",\"cdui\"]},\"id\":\"tgccymvaolpss\",\"name\":\"qlfmmdnbb\",\"type\":\"lzpswiydm\"},{\"properties\":{\"groupId\":\"hzdxssadbzm\",\"requiredMembers\":[\"fznudaodvxzb\",\"cblylpstdbhhxsr\",\"dzu\"],\"requiredZoneNames\":[\"scdntnevf\"]},\"id\":\"jmygtdsslswtmwer\",\"name\":\"ofz\",\"type\":\"yqsemwa\"},{\"properties\":{\"groupId\":\"tshhszhedp\",\"requiredMembers\":[\"iwubmwmbesldnk\",\"wtppjflcxogaoko\"],\"requiredZoneNames\":[\"nsikvmkqzeqqkdl\"]},\"id\":\"zxmhhvhgu\",\"name\":\"eodkwobda\",\"type\":\"xtibqdxbxwakbog\"}],\"nextLink\":\"ndlkzgxhurip\"}") + .toObject(PrivateLinkResourceListResult.class); + Assertions.assertEquals("ndlkzgxhurip", model.nextLink()); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourcePropertiesTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourcePropertiesTests.java new file mode 100644 index 000000000000..2dd27cc48f76 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PrivateLinkResourcePropertiesTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkResourceProperties; + +public final class PrivateLinkResourcePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PrivateLinkResourceProperties model = BinaryData.fromString( + "{\"groupId\":\"ftpvjzbexil\",\"requiredMembers\":[\"fqqnvwpmqtaruo\",\"jmkcjhwqytj\"],\"requiredZoneNames\":[\"n\"]}") + .toObject(PrivateLinkResourceProperties.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PublicInternetAuthorizationRuleTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PublicInternetAuthorizationRuleTests.java new file mode 100644 index 000000000000..eea6278a6478 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/PublicInternetAuthorizationRuleTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.AccessRights; +import com.azure.resourcemanager.notificationhubs.models.PublicInternetAuthorizationRule; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PublicInternetAuthorizationRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PublicInternetAuthorizationRule model + = BinaryData.fromString("{\"rights\":[\"Listen\",\"Listen\",\"Manage\",\"Manage\"]}") + .toObject(PublicInternetAuthorizationRule.class); + Assertions.assertEquals(AccessRights.LISTEN, model.rights().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PublicInternetAuthorizationRule model = new PublicInternetAuthorizationRule().withRights( + Arrays.asList(AccessRights.LISTEN, AccessRights.LISTEN, AccessRights.MANAGE, AccessRights.MANAGE)); + model = BinaryData.fromObject(model).toObject(PublicInternetAuthorizationRule.class); + Assertions.assertEquals(AccessRights.LISTEN, model.rights().get(0)); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RegistrationResultTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RegistrationResultTests.java new file mode 100644 index 000000000000..f7a4f3ed42e0 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RegistrationResultTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.RegistrationResult; + +public final class RegistrationResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RegistrationResult model = BinaryData.fromString( + "{\"applicationPlatform\":\"ayqcgw\",\"pnsHandle\":\"zjuzgwyz\",\"registrationId\":\"txon\",\"outcome\":\"ts\"}") + .toObject(RegistrationResult.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RemotePrivateEndpointConnectionTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RemotePrivateEndpointConnectionTests.java new file mode 100644 index 000000000000..e85324b0d853 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RemotePrivateEndpointConnectionTests.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateEndpointConnection; + +public final class RemotePrivateEndpointConnectionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RemotePrivateEndpointConnection model + = BinaryData.fromString("{\"id\":\"civfsnkymuctq\"}").toObject(RemotePrivateEndpointConnection.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RemotePrivateEndpointConnection model = new RemotePrivateEndpointConnection(); + model = BinaryData.fromObject(model).toObject(RemotePrivateEndpointConnection.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RemotePrivateLinkServiceConnectionStateTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RemotePrivateLinkServiceConnectionStateTests.java new file mode 100644 index 000000000000..625d8da37eb0 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/RemotePrivateLinkServiceConnectionStateTests.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.PrivateLinkConnectionStatus; +import com.azure.resourcemanager.notificationhubs.models.RemotePrivateLinkServiceConnectionState; +import org.junit.jupiter.api.Assertions; + +public final class RemotePrivateLinkServiceConnectionStateTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RemotePrivateLinkServiceConnectionState model = BinaryData + .fromString("{\"status\":\"Approved\",\"description\":\"ebrjcxe\",\"actionsRequired\":\"uwutttxfvjrbi\"}") + .toObject(RemotePrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateLinkConnectionStatus.APPROVED, model.status()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RemotePrivateLinkServiceConnectionState model + = new RemotePrivateLinkServiceConnectionState().withStatus(PrivateLinkConnectionStatus.APPROVED); + model = BinaryData.fromObject(model).toObject(RemotePrivateLinkServiceConnectionState.class); + Assertions.assertEquals(PrivateLinkConnectionStatus.APPROVED, model.status()); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/ServiceSpecificationTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/ServiceSpecificationTests.java new file mode 100644 index 000000000000..2d1229563ea4 --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/ServiceSpecificationTests.java @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.notificationhubs.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.notificationhubs.models.ServiceSpecification; + +public final class ServiceSpecificationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServiceSpecification model = BinaryData.fromString( + "{\"logSpecifications\":[{\"name\":\"qsrxybzqqed\",\"displayName\":\"tbciqfouflmm\",\"blobDuration\":\"zsm\",\"categoryGroups\":[\"glougpbk\",\"tmut\",\"uqktap\"]},{\"name\":\"wgcu\",\"displayName\":\"tumkdosvqwhbm\",\"blobDuration\":\"bbjfddgmbmbexp\",\"categoryGroups\":[\"tq\",\"rolfpfp\",\"algbquxigjyjg\"]},{\"name\":\"aoyfhrtxilnerkuj\",\"displayName\":\"vlejuvfqa\",\"blobDuration\":\"lyxwjkcprbnwbx\",\"categoryGroups\":[\"tbvpysszdnru\"]},{\"name\":\"guhmuouqfpr\",\"displayName\":\"wbnguitnwui\",\"blobDuration\":\"a\",\"categoryGroups\":[\"fizuckyf\",\"hr\",\"idf\"]}],\"metricSpecifications\":[{\"name\":\"zuhtymwisdkfthwx\",\"displayName\":\"t\",\"displayDescription\":\"waopvkmijcmmxd\",\"unit\":\"fufsrpymzi\",\"aggregationType\":\"sezcxtb\",\"availabilities\":[{\"timeGrain\":\"yc\",\"blobDuration\":\"newmdwzjeiachbo\"},{\"timeGrain\":\"flnrosfqpteehzz\",\"blobDuration\":\"pyqr\"}],\"supportedTimeGrainTypes\":[\"inpvswjdkirsoodq\"],\"metricFilterPattern\":\"crmnohjtckwhds\",\"fillGapWithZero\":true},{\"name\":\"yip\",\"displayName\":\"sqwpgrjb\",\"displayDescription\":\"orcjxvsnby\",\"unit\":\"abnmocpcyshu\",\"aggregationType\":\"afbljjgpbtoqcjmk\",\"availabilities\":[{\"timeGrain\":\"bqidtqaj\",\"blobDuration\":\"ulpkudjkrl\"}],\"supportedTimeGrainTypes\":[\"z\",\"fepgzgq\",\"xzlocxscp\",\"ierhhbcsglummaj\"],\"metricFilterPattern\":\"aodxo\",\"fillGapWithZero\":true},{\"name\":\"xkqpxo\",\"displayName\":\"jionpimexgstxgc\",\"displayDescription\":\"dg\",\"unit\":\"ajrmvdjwzrlovmc\",\"aggregationType\":\"hijco\",\"availabilities\":[{\"timeGrain\":\"bzaqsqsycbkbfk\",\"blobDuration\":\"kdkexxp\"},{\"timeGrain\":\"fmxa\",\"blobDuration\":\"fjpgddtocjjxhvp\"}],\"supportedTimeGrainTypes\":[\"exhd\",\"xibqeojnx\"],\"metricFilterPattern\":\"zvddntwndeicbtwn\",\"fillGapWithZero\":false}]}") + .toObject(ServiceSpecification.class); + } +} diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/SkuTests.java b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/SkuTests.java index 3427188341c9..5e943975b478 100644 --- a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/SkuTests.java +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/src/test/java/com/azure/resourcemanager/notificationhubs/generated/SkuTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.notificationhubs.generated; @@ -13,27 +13,27 @@ public final class SkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Sku model = BinaryData.fromString( - "{\"name\":\"Standard\",\"tier\":\"vg\",\"size\":\"zsymglzufcyzkohd\",\"family\":\"hanufhfcbjysagi\",\"capacity\":1438180551}") + "{\"name\":\"Free\",\"tier\":\"xepcyvahfn\",\"size\":\"kyqxjvuujqgidokg\",\"family\":\"jyoxgvclt\",\"capacity\":794855452}") .toObject(Sku.class); - Assertions.assertEquals(SkuName.STANDARD, model.name()); - Assertions.assertEquals("vg", model.tier()); - Assertions.assertEquals("zsymglzufcyzkohd", model.size()); - Assertions.assertEquals("hanufhfcbjysagi", model.family()); - Assertions.assertEquals(1438180551, model.capacity()); + Assertions.assertEquals(SkuName.FREE, model.name()); + Assertions.assertEquals("xepcyvahfn", model.tier()); + Assertions.assertEquals("kyqxjvuujqgidokg", model.size()); + Assertions.assertEquals("jyoxgvclt", model.family()); + Assertions.assertEquals(794855452, model.capacity()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Sku model = new Sku().withName(SkuName.STANDARD) - .withTier("vg") - .withSize("zsymglzufcyzkohd") - .withFamily("hanufhfcbjysagi") - .withCapacity(1438180551); + Sku model = new Sku().withName(SkuName.FREE) + .withTier("xepcyvahfn") + .withSize("kyqxjvuujqgidokg") + .withFamily("jyoxgvclt") + .withCapacity(794855452); model = BinaryData.fromObject(model).toObject(Sku.class); - Assertions.assertEquals(SkuName.STANDARD, model.name()); - Assertions.assertEquals("vg", model.tier()); - Assertions.assertEquals("zsymglzufcyzkohd", model.size()); - Assertions.assertEquals("hanufhfcbjysagi", model.family()); - Assertions.assertEquals(1438180551, model.capacity()); + Assertions.assertEquals(SkuName.FREE, model.name()); + Assertions.assertEquals("xepcyvahfn", model.tier()); + Assertions.assertEquals("kyqxjvuujqgidokg", model.size()); + Assertions.assertEquals("jyoxgvclt", model.family()); + Assertions.assertEquals(794855452, model.capacity()); } } diff --git a/sdk/notificationhubs/azure-resourcemanager-notificationhubs/tsp-location.yaml b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/tsp-location.yaml new file mode 100644 index 000000000000..9b5f63a086ff --- /dev/null +++ b/sdk/notificationhubs/azure-resourcemanager-notificationhubs/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/notificationhubs/resource-manager/Microsoft.NotificationHubs/NotificationHubs +commit: 98a4db5d6c32ff5a3ad5780fce6c716cafdbbeec +repo: Azure/azure-rest-api-specs +additionalDirectories: