From 7ee489d81f62149fc53f3d05971d6663d0c380f4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 23 Dec 2020 05:54:19 +0000 Subject: [PATCH] CodeGen from PR 11892 in Azure/azure-rest-api-specs add signalr track2 config (#11892) --- eng/versioning/version_client.txt | 1 + pom.xml | 1 + .../CHANGELOG.md | 5 + .../azure-resourcemanager-signalr/README.md | 83 + .../azure-resourcemanager-signalr/pom.xml | 62 + .../signalr/SignalRManager.java | 250 ++ .../signalr/fluent/OperationsClient.java | 36 + .../fluent/SignalRManagementClient.java | 82 + ...gnalRPrivateEndpointConnectionsClient.java | 159 + .../SignalRPrivateLinkResourcesClient.java | 43 + .../signalr/fluent/SignalRsClient.java | 505 ++++ .../signalr/fluent/UsagesClient.java | 39 + .../fluent/models/NameAvailabilityInner.java | 102 + .../signalr/fluent/models/OperationInner.java | 165 ++ .../PrivateEndpointConnectionInner.java | 104 + .../models/PrivateLinkResourceInner.java | 106 + .../fluent/models/SignalRKeysInner.java | 128 + .../fluent/models/SignalRResourceInner.java | 416 +++ .../fluent/models/SignalRUsageInner.java | 164 ++ .../signalr/fluent/models/package-info.java | 6 + .../signalr/fluent/package-info.java | 6 + .../implementation/NameAvailabilityImpl.java | 40 + .../signalr/implementation/OperationImpl.java | 50 + .../implementation/OperationsClientImpl.java | 269 ++ .../implementation/OperationsImpl.java | 46 + .../PrivateEndpointConnectionImpl.java | 55 + .../PrivateLinkResourceImpl.java | 64 + .../implementation/SignalRKeysImpl.java | 44 + .../SignalRManagementClientBuilder.java | 149 + .../SignalRManagementClientImpl.java | 354 +++ ...RPrivateEndpointConnectionsClientImpl.java | 818 ++++++ ...SignalRPrivateEndpointConnectionsImpl.java | 108 + ...SignalRPrivateLinkResourcesClientImpl.java | 345 +++ .../SignalRPrivateLinkResourcesImpl.java | 48 + .../implementation/SignalRResourceImpl.java | 285 ++ .../implementation/SignalRUsageImpl.java | 49 + .../implementation/SignalRsClientImpl.java | 2570 +++++++++++++++++ .../signalr/implementation/SignalRsImpl.java | 262 ++ .../implementation/UsagesClientImpl.java | 311 ++ .../signalr/implementation/UsagesImpl.java | 46 + .../signalr/implementation/Utils.java | 67 + .../signalr/implementation/package-info.java | 6 + .../signalr/models/AclAction.java | 34 + .../signalr/models/Dimension.java | 131 + .../signalr/models/FeatureFlags.java | 37 + .../signalr/models/KeyType.java | 34 + .../signalr/models/LogSpecification.java | 76 + .../signalr/models/ManagedIdentity.java | 120 + .../models/ManagedIdentitySettings.java | 53 + .../signalr/models/ManagedIdentityType.java | 37 + .../signalr/models/MetricSpecification.java | 253 ++ .../signalr/models/NameAvailability.java | 38 + .../models/NameAvailabilityParameters.java | 86 + .../signalr/models/NetworkAcl.java | 83 + .../signalr/models/Operation.java | 53 + .../signalr/models/OperationDisplay.java | 128 + .../signalr/models/OperationList.java | 85 + .../signalr/models/OperationProperties.java | 53 + .../signalr/models/Operations.java | 31 + .../signalr/models/PrivateEndpoint.java | 50 + .../signalr/models/PrivateEndpointAcl.java | 72 + .../models/PrivateEndpointConnection.java | 59 + .../signalr/models/PrivateLinkResource.java | 60 + .../models/PrivateLinkResourceList.java | 88 + .../PrivateLinkServiceConnectionState.java | 108 + .../PrivateLinkServiceConnectionStatus.java | 40 + .../signalr/models/ProvisioningState.java | 55 + .../models/RegenerateKeyParameters.java | 51 + .../signalr/models/ResourceSku.java | 179 ++ .../models/ServerlessUpstreamSettings.java | 57 + .../signalr/models/ServiceKind.java | 34 + .../signalr/models/ServiceSpecification.java | 83 + .../signalr/models/SignalRCorsSettings.java | 55 + .../SignalRCreateOrUpdateProperties.java | 159 + .../signalr/models/SignalRFeature.java | 131 + .../signalr/models/SignalRKeys.java | 45 + .../signalr/models/SignalRNetworkACLs.java | 109 + .../SignalRPrivateEndpointConnections.java | 111 + .../models/SignalRPrivateLinkResources.java | 38 + .../signalr/models/SignalRProperties.java | 202 ++ .../signalr/models/SignalRRequestType.java | 37 + .../signalr/models/SignalRResource.java | 495 ++++ .../signalr/models/SignalRResourceList.java | 85 + .../signalr/models/SignalRSkuTier.java | 40 + .../signalr/models/SignalRTlsSettings.java | 50 + .../signalr/models/SignalRUsage.java | 54 + .../signalr/models/SignalRUsageList.java | 85 + .../signalr/models/SignalRUsageName.java | 76 + .../signalr/models/SignalRs.java | 282 ++ .../signalr/models/UpstreamAuthSettings.java | 82 + .../signalr/models/UpstreamAuthType.java | 34 + .../signalr/models/UpstreamTemplate.java | 216 ++ .../signalr/models/Usages.java | 34 + .../models/UserAssignedIdentityProperty.java | 54 + .../signalr/models/package-info.java | 6 + .../resourcemanager/signalr/package-info.java | 6 + .../src/main/java/module-info.java | 19 + sdk/signalr/ci.yml | 31 + sdk/signalr/pom.xml | 14 + 99 files changed, 13267 insertions(+) create mode 100644 sdk/signalr/azure-resourcemanager-signalr/CHANGELOG.md create mode 100644 sdk/signalr/azure-resourcemanager-signalr/README.md create mode 100644 sdk/signalr/azure-resourcemanager-signalr/pom.xml create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/SignalRManager.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/OperationsClient.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRManagementClient.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRPrivateEndpointConnectionsClient.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRPrivateLinkResourcesClient.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRsClient.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/UsagesClient.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/NameAvailabilityInner.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/OperationInner.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/PrivateEndpointConnectionInner.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/PrivateLinkResourceInner.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRKeysInner.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRResourceInner.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRUsageInner.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/package-info.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/package-info.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/NameAvailabilityImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsClientImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/PrivateEndpointConnectionImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/PrivateLinkResourceImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRKeysImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRManagementClientBuilder.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRManagementClientImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateEndpointConnectionsClientImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateEndpointConnectionsImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateLinkResourcesClientImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateLinkResourcesImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRResourceImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRUsageImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRsClientImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRsImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/UsagesClientImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/UsagesImpl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/Utils.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/package-info.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/AclAction.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Dimension.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/FeatureFlags.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/KeyType.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/LogSpecification.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentity.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentitySettings.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentityType.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/MetricSpecification.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NameAvailability.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NameAvailabilityParameters.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NetworkAcl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Operation.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationDisplay.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationList.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationProperties.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Operations.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpoint.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpointAcl.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpointConnection.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkResource.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkResourceList.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkServiceConnectionState.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkServiceConnectionStatus.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ProvisioningState.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/RegenerateKeyParameters.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ResourceSku.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServerlessUpstreamSettings.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServiceKind.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServiceSpecification.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRCorsSettings.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRCreateOrUpdateProperties.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRFeature.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRKeys.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRNetworkACLs.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRPrivateEndpointConnections.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRPrivateLinkResources.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRProperties.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRRequestType.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRResource.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRResourceList.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRSkuTier.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRTlsSettings.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsage.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsageList.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsageName.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRs.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamAuthSettings.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamAuthType.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamTemplate.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Usages.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UserAssignedIdentityProperty.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/package-info.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/package-info.java create mode 100644 sdk/signalr/azure-resourcemanager-signalr/src/main/java/module-info.java create mode 100644 sdk/signalr/ci.yml create mode 100644 sdk/signalr/pom.xml diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 90aecf6b32a62..984ed69904d24 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -185,6 +185,7 @@ com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.0.0-beta.1;1. com.azure.resourcemanager:azure-resourcemanager-kusto;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-signalr;1.0.0-beta.1;1.0.0-beta.1 com.microsoft:microsoft-opentelemetry-exporter-azuremonitor;1.0.0-beta.1;1.0.0-beta.2 diff --git a/pom.xml b/pom.xml index b80dac967d8f2..b4d985855eb2c 100644 --- a/pom.xml +++ b/pom.xml @@ -41,6 +41,7 @@ sdk/schemaregistry sdk/search sdk/servicebus + sdk/signalr sdk/spring sdk/sqlvirtualmachine sdk/storage diff --git a/sdk/signalr/azure-resourcemanager-signalr/CHANGELOG.md b/sdk/signalr/azure-resourcemanager-signalr/CHANGELOG.md new file mode 100644 index 0000000000000..2d26cd620b429 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2020-12-23) + +- Azure Resource Manager SignalR client library for Java. This package contains Microsoft Azure SDK for SignalR Management SDK. REST API for Azure SignalR Service. Package tag package-2020-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). \ No newline at end of file diff --git a/sdk/signalr/azure-resourcemanager-signalr/README.md b/sdk/signalr/azure-resourcemanager-signalr/README.md new file mode 100644 index 0000000000000..c650cb8434765 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/README.md @@ -0,0 +1,83 @@ +# Azure Resource Manager SignalR client library for Java + +Azure Resource Manager SignalR client library for Java. + +This package contains Microsoft Azure SDK for SignalR Management SDK. REST API for Azure SignalR Service. Package tag package-2020-07-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-signalr;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-signalr + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +SignalRManager manager = SignalRManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/signalr/azure-resourcemanager-signalr/pom.xml b/sdk/signalr/azure-resourcemanager-signalr/pom.xml new file mode 100644 index 0000000000000..6823e1bfa68b1 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-signalr + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for SignalR Management + This package contains Microsoft Azure SDK for SignalR Management SDK. REST API for Azure SignalR Service. Package tag package-2020-07-01-preview. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core-management + 1.0.0 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + + diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/SignalRManager.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/SignalRManager.java new file mode 100644 index 0000000000000..b7c1153c99658 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/SignalRManager.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.SignalRManagementClient; +import com.azure.resourcemanager.signalr.implementation.OperationsImpl; +import com.azure.resourcemanager.signalr.implementation.SignalRManagementClientBuilder; +import com.azure.resourcemanager.signalr.implementation.SignalRPrivateEndpointConnectionsImpl; +import com.azure.resourcemanager.signalr.implementation.SignalRPrivateLinkResourcesImpl; +import com.azure.resourcemanager.signalr.implementation.SignalRsImpl; +import com.azure.resourcemanager.signalr.implementation.UsagesImpl; +import com.azure.resourcemanager.signalr.models.Operations; +import com.azure.resourcemanager.signalr.models.SignalRPrivateEndpointConnections; +import com.azure.resourcemanager.signalr.models.SignalRPrivateLinkResources; +import com.azure.resourcemanager.signalr.models.SignalRs; +import com.azure.resourcemanager.signalr.models.Usages; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** Entry point to SignalRManager. REST API for Azure SignalR Service. */ +public final class SignalRManager { + private Operations operations; + + private SignalRs signalRs; + + private SignalRPrivateEndpointConnections signalRPrivateEndpointConnections; + + private SignalRPrivateLinkResources signalRPrivateLinkResources; + + private Usages usages; + + private final SignalRManagementClient clientObject; + + private SignalRManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new SignalRManagementClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of SignalR service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the SignalR service API instance. + */ + public static SignalRManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create SignalRManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new SignalRManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of SignalR service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the SignalR service API instance. + */ + public SignalRManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies + .add( + new UserAgentPolicy( + null, + "com.azure.resourcemanager.signalr", + "1.0.0-beta.1", + Configuration.getGlobalConfiguration())); + policies.add(new RequestIdPolicy()); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies + .add( + new BearerTokenAuthenticationPolicy( + credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new SignalRManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of SignalRs. */ + public SignalRs signalRs() { + if (this.signalRs == null) { + this.signalRs = new SignalRsImpl(clientObject.getSignalRs(), this); + } + return signalRs; + } + + /** @return Resource collection API of SignalRPrivateEndpointConnections. */ + public SignalRPrivateEndpointConnections signalRPrivateEndpointConnections() { + if (this.signalRPrivateEndpointConnections == null) { + this.signalRPrivateEndpointConnections = + new SignalRPrivateEndpointConnectionsImpl(clientObject.getSignalRPrivateEndpointConnections(), this); + } + return signalRPrivateEndpointConnections; + } + + /** @return Resource collection API of SignalRPrivateLinkResources. */ + public SignalRPrivateLinkResources signalRPrivateLinkResources() { + if (this.signalRPrivateLinkResources == null) { + this.signalRPrivateLinkResources = + new SignalRPrivateLinkResourcesImpl(clientObject.getSignalRPrivateLinkResources(), this); + } + return signalRPrivateLinkResources; + } + + /** @return Resource collection API of Usages. */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); + } + return usages; + } + + /** + * @return Wrapped service client SignalRManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public SignalRManagementClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/OperationsClient.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/OperationsClient.java new file mode 100644 index 0000000000000..a54c9407234de --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/OperationsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.signalr.fluent.models.OperationInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRManagementClient.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRManagementClient.java new file mode 100644 index 0000000000000..9fac500b9052f --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRManagementClient.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for SignalRManagementClient class. */ +public interface SignalRManagementClient { + /** + * Gets Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the SignalRsClient object to access its operations. + * + * @return the SignalRsClient object. + */ + SignalRsClient getSignalRs(); + + /** + * Gets the SignalRPrivateEndpointConnectionsClient object to access its operations. + * + * @return the SignalRPrivateEndpointConnectionsClient object. + */ + SignalRPrivateEndpointConnectionsClient getSignalRPrivateEndpointConnections(); + + /** + * Gets the SignalRPrivateLinkResourcesClient object to access its operations. + * + * @return the SignalRPrivateLinkResourcesClient object. + */ + SignalRPrivateLinkResourcesClient getSignalRPrivateLinkResources(); + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + UsagesClient getUsages(); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRPrivateEndpointConnectionsClient.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRPrivateEndpointConnectionsClient.java new file mode 100644 index 0000000000000..e543c698acd6d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRPrivateEndpointConnectionsClient.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.signalr.fluent.models.PrivateEndpointConnectionInner; + +/** + * An instance of this class provides access to all the operations defined in SignalRPrivateEndpointConnectionsClient. + */ +public interface SignalRPrivateEndpointConnectionsClient { + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner get( + String privateEndpointConnectionName, String resourceGroupName, String resourceName); + + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context); + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a private endpoint connection to SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PrivateEndpointConnectionInner update( + String privateEndpointConnectionName, String resourceGroupName, String resourceName); + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 endpoint connection to SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String privateEndpointConnectionName, + String resourceGroupName, + String resourceName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String privateEndpointConnectionName, String resourceGroupName, String resourceName); + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context); + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName); + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRPrivateLinkResourcesClient.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRPrivateLinkResourcesClient.java new file mode 100644 index 0000000000000..bc3daa885a646 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRPrivateLinkResourcesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.signalr.fluent.models.PrivateLinkResourceInner; + +/** An instance of this class provides access to all the operations defined in SignalRPrivateLinkResourcesClient. */ +public interface SignalRPrivateLinkResourcesClient { + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRsClient.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRsClient.java new file mode 100644 index 0000000000000..c95b47d10de93 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/SignalRsClient.java @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.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.signalr.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.signalr.fluent.models.SignalRKeysInner; +import com.azure.resourcemanager.signalr.fluent.models.SignalRResourceInner; +import com.azure.resourcemanager.signalr.models.NameAvailabilityParameters; +import com.azure.resourcemanager.signalr.models.RegenerateKeyParameters; + +/** An instance of this class provides access to all the operations defined in SignalRsClient. */ +public interface SignalRsClient { + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NameAvailabilityInner checkNameAvailability(String location); + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @param parameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters parameters, Context context); + + /** + * Handles requests to list all resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRKeysInner listKeys(String resourceGroupName, String resourceName); + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listKeysWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SignalRKeysInner> beginRegenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SignalRKeysInner> beginRegenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRKeysInner regenerateKey(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRKeysInner regenerateKey(String resourceGroupName, String resourceName); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRKeysInner regenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context); + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRResourceInner getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SignalRResourceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters); + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SignalRResourceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context); + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRResourceInner createOrUpdate(String resourceGroupName, String resourceName, SignalRResourceInner parameters); + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRResourceInner createOrUpdate(String resourceGroupName, String resourceName); + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRResourceInner createOrUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context); + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName); + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, Context context); + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SignalRResourceInner> beginUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters); + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, SignalRResourceInner> beginUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context); + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRResourceInner update(String resourceGroupName, String resourceName, SignalRResourceInner parameters); + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRResourceInner update(String resourceGroupName, String resourceName); + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SignalRResourceInner update( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context); + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName); + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName, Context context); + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String resourceName); + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void restart(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/UsagesClient.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/UsagesClient.java new file mode 100644 index 0000000000000..c71b9f67d8ecc --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/UsagesClient.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.signalr.fluent.models.SignalRUsageInner; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public interface UsagesClient { + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location); + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String location, Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/NameAvailabilityInner.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/NameAvailabilityInner.java new file mode 100644 index 0000000000000..9424a59deac5d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/NameAvailabilityInner.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Result of the request to check name availability. It contains a flag and possible reason of failure. */ +@Fluent +public final class NameAvailabilityInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityInner.class); + + /* + * Indicates whether the name is available or not. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The reason of the availability. Required if name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /* + * The message of the operation. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the nameAvailable property: Indicates whether the name is available or not. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Indicates whether the name is available or not. + * + * @param nameAvailable the nameAvailable value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: The reason of the availability. Required if name is not available. + * + * @return the reason value. + */ + public String reason() { + return this.reason; + } + + /** + * Set the reason property: The reason of the availability. Required if name is not available. + * + * @param reason the reason value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: The message of the operation. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: The message of the operation. + * + * @param message the message value to set. + * @return the NameAvailabilityInner object itself. + */ + public NameAvailabilityInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/OperationInner.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/OperationInner.java new file mode 100644 index 0000000000000..1c21edbad1e8d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/OperationInner.java @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.models.OperationDisplay; +import com.azure.resourcemanager.signalr.models.OperationProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** REST API operation supported by SignalR resource provider. */ +@Fluent +public final class OperationInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); + + /* + * Name of the operation with format: {provider}/{resource}/{operation} + */ + @JsonProperty(value = "name") + private String name; + + /* + * If the operation is a data action. (for data plane rbac) + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Optional. The intended executor of the operation; governs the display of + * the operation in the RBAC UX and the audit logs UX. + */ + @JsonProperty(value = "origin") + private String origin; + + /* + * Extra properties for the operation. + */ + @JsonProperty(value = "properties") + private OperationProperties properties; + + /** + * Get the name property: Name of the operation with format: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation with format: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: If the operation is a data action. (for data plane rbac). + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: If the operation is a data action. (for data plane rbac). + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: The object that describes the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that describes the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Optional. The intended executor of the operation; governs the display of the operation + * in the RBAC UX and the audit logs UX. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Optional. The intended executor of the operation; governs the display of the operation + * in the RBAC UX and the audit logs UX. + * + * @param origin the origin value to set. + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the properties property: Extra properties for the operation. + * + * @return the properties value. + */ + public OperationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Extra properties for the operation. + * + * @param properties the properties value to set. + * @return the OperationInner object itself. + */ + public OperationInner withProperties(OperationProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/PrivateEndpointConnectionInner.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/PrivateEndpointConnectionInner.java new file mode 100644 index 0000000000000..efe647147b04e --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/PrivateEndpointConnectionInner.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.models.PrivateEndpoint; +import com.azure.resourcemanager.signalr.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.signalr.models.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A private endpoint connection to SignalR resource. */ +@JsonFlatten +@Fluent +public class PrivateEndpointConnectionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); + + /* + * Provisioning state of the private endpoint connection + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * Private endpoint associated with the private endpoint connection + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * Connection state + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * Get the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the privateEndpoint property: Private endpoint associated with the private endpoint connection. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: Private endpoint associated with the private endpoint connection. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: Connection state. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: Connection state. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() != null) { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/PrivateLinkResourceInner.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/PrivateLinkResourceInner.java new file mode 100644 index 0000000000000..2308af107dd01 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/PrivateLinkResourceInner.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Private link resource. */ +@JsonFlatten +@Fluent +public class PrivateLinkResourceInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceInner.class); + + /* + * Group Id of the private link resource + */ + @JsonProperty(value = "properties.groupId") + private String groupId; + + /* + * Required members of the private link resource + */ + @JsonProperty(value = "properties.requiredMembers") + private List requiredMembers; + + /* + * Required private DNS zone names + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the groupId property: Group Id of the private link resource. + * + * @return the groupId value. + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the groupId property: Group Id of the private link resource. + * + * @param groupId the groupId value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the requiredMembers property: Required members of the private link resource. + * + * @return the requiredMembers value. + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the requiredMembers property: Required members of the private link resource. + * + * @param requiredMembers the requiredMembers value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the requiredZoneNames property: Required private DNS zone names. + * + * @return the requiredZoneNames value. + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the requiredZoneNames property: Required private DNS zone names. + * + * @param requiredZoneNames the requiredZoneNames value to set. + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRKeysInner.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRKeysInner.java new file mode 100644 index 0000000000000..5f4d063e5f4d8 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRKeysInner.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A class represents the access keys of SignalR service. */ +@Fluent +public final class SignalRKeysInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRKeysInner.class); + + /* + * The primary access key. + */ + @JsonProperty(value = "primaryKey") + private String primaryKey; + + /* + * The secondary access key. + */ + @JsonProperty(value = "secondaryKey") + private String secondaryKey; + + /* + * SignalR connection string constructed via the primaryKey + */ + @JsonProperty(value = "primaryConnectionString") + private String primaryConnectionString; + + /* + * SignalR connection string constructed via the secondaryKey + */ + @JsonProperty(value = "secondaryConnectionString") + private String secondaryConnectionString; + + /** + * Get the primaryKey property: The primary access key. + * + * @return the primaryKey value. + */ + public String primaryKey() { + return this.primaryKey; + } + + /** + * Set the primaryKey property: The primary access key. + * + * @param primaryKey the primaryKey value to set. + * @return the SignalRKeysInner object itself. + */ + public SignalRKeysInner withPrimaryKey(String primaryKey) { + this.primaryKey = primaryKey; + return this; + } + + /** + * Get the secondaryKey property: The secondary access key. + * + * @return the secondaryKey value. + */ + public String secondaryKey() { + return this.secondaryKey; + } + + /** + * Set the secondaryKey property: The secondary access key. + * + * @param secondaryKey the secondaryKey value to set. + * @return the SignalRKeysInner object itself. + */ + public SignalRKeysInner withSecondaryKey(String secondaryKey) { + this.secondaryKey = secondaryKey; + return this; + } + + /** + * Get the primaryConnectionString property: SignalR connection string constructed via the primaryKey. + * + * @return the primaryConnectionString value. + */ + public String primaryConnectionString() { + return this.primaryConnectionString; + } + + /** + * Set the primaryConnectionString property: SignalR connection string constructed via the primaryKey. + * + * @param primaryConnectionString the primaryConnectionString value to set. + * @return the SignalRKeysInner object itself. + */ + public SignalRKeysInner withPrimaryConnectionString(String primaryConnectionString) { + this.primaryConnectionString = primaryConnectionString; + return this; + } + + /** + * Get the secondaryConnectionString property: SignalR connection string constructed via the secondaryKey. + * + * @return the secondaryConnectionString value. + */ + public String secondaryConnectionString() { + return this.secondaryConnectionString; + } + + /** + * Set the secondaryConnectionString property: SignalR connection string constructed via the secondaryKey. + * + * @param secondaryConnectionString the secondaryConnectionString value to set. + * @return the SignalRKeysInner object itself. + */ + public SignalRKeysInner withSecondaryConnectionString(String secondaryConnectionString) { + this.secondaryConnectionString = secondaryConnectionString; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRResourceInner.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRResourceInner.java new file mode 100644 index 0000000000000..21c220fbc975d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRResourceInner.java @@ -0,0 +1,416 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.models.ManagedIdentity; +import com.azure.resourcemanager.signalr.models.ProvisioningState; +import com.azure.resourcemanager.signalr.models.ResourceSku; +import com.azure.resourcemanager.signalr.models.ServerlessUpstreamSettings; +import com.azure.resourcemanager.signalr.models.ServiceKind; +import com.azure.resourcemanager.signalr.models.SignalRCorsSettings; +import com.azure.resourcemanager.signalr.models.SignalRFeature; +import com.azure.resourcemanager.signalr.models.SignalRNetworkACLs; +import com.azure.resourcemanager.signalr.models.SignalRTlsSettings; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** A class represent a SignalR service resource. */ +@JsonFlatten +@Fluent +public class SignalRResourceInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRResourceInner.class); + + /* + * The billing information of the resource.(e.g. Free, Standard) + */ + @JsonProperty(value = "sku") + private ResourceSku sku; + + /* + * The kind of the service - e.g. "SignalR", or "RawWebSockets" for + * "Microsoft.SignalRService/SignalR" + */ + @JsonProperty(value = "kind") + private ServiceKind kind; + + /* + * The managed identity response + */ + @JsonProperty(value = "identity") + private ManagedIdentity identity; + + /* + * List of SignalR featureFlags. e.g. ServiceMode. + * + * FeatureFlags that are not included in the parameters for the update + * operation will not be modified. + * And the response will only include featureFlags that are explicitly set. + * When a featureFlag is not explicitly set, SignalR service will use its + * globally default value. + * But keep in mind, the default value doesn't mean "false". It varies in + * terms of different FeatureFlags. + */ + @JsonProperty(value = "properties.features") + private List features; + + /* + * Cross-Origin Resource Sharing (CORS) settings. + */ + @JsonProperty(value = "properties.cors") + private SignalRCorsSettings cors; + + /* + * Upstream settings when the Azure SignalR is in server-less mode. + */ + @JsonProperty(value = "properties.upstream") + private ServerlessUpstreamSettings upstream; + + /* + * Network ACLs + */ + @JsonProperty(value = "properties.networkACLs") + private SignalRNetworkACLs networkACLs; + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The publicly accessible IP of the SignalR service. + */ + @JsonProperty(value = "properties.externalIP", access = JsonProperty.Access.WRITE_ONLY) + private String externalIp; + + /* + * FQDN of the SignalR service instance. Format: xxx.service.signalr.net + */ + @JsonProperty(value = "properties.hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The publicly accessible port of the SignalR service which is designed + * for browser/client side usage. + */ + @JsonProperty(value = "properties.publicPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer publicPort; + + /* + * The publicly accessible port of the SignalR service which is designed + * for customer server side usage. + */ + @JsonProperty(value = "properties.serverPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer serverPort; + + /* + * Version of the SignalR resource. Probably you need the same or higher + * version of client SDKs. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Private endpoint connections to the SignalR resource. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * TLS settings. + */ + @JsonProperty(value = "properties.tls") + private SignalRTlsSettings tls; + + /** + * Get the sku property: The billing information of the resource.(e.g. Free, Standard). + * + * @return the sku value. + */ + public ResourceSku sku() { + return this.sku; + } + + /** + * Set the sku property: The billing information of the resource.(e.g. Free, Standard). + * + * @param sku the sku value to set. + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withSku(ResourceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the kind property: The kind of the service - e.g. "SignalR", or "RawWebSockets" for + * "Microsoft.SignalRService/SignalR". + * + * @return the kind value. + */ + public ServiceKind kind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the service - e.g. "SignalR", or "RawWebSockets" for + * "Microsoft.SignalRService/SignalR". + * + * @param kind the kind value to set. + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withKind(ServiceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the identity property: The managed identity response. + * + * @return the identity value. + */ + public ManagedIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: The managed identity response. + * + * @param identity the identity value to set. + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withIdentity(ManagedIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the features property: List of SignalR featureFlags. e.g. ServiceMode. + * + *

FeatureFlags that are not included in the parameters for the update operation will not be modified. And the + * response will only include featureFlags that are explicitly set. When a featureFlag is not explicitly set, + * SignalR service will use its globally default value. But keep in mind, the default value doesn't mean "false". It + * varies in terms of different FeatureFlags. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: List of SignalR featureFlags. e.g. ServiceMode. + * + *

FeatureFlags that are not included in the parameters for the update operation will not be modified. And the + * response will only include featureFlags that are explicitly set. When a featureFlag is not explicitly set, + * SignalR service will use its globally default value. But keep in mind, the default value doesn't mean "false". It + * varies in terms of different FeatureFlags. + * + * @param features the features value to set. + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the cors property: Cross-Origin Resource Sharing (CORS) settings. + * + * @return the cors value. + */ + public SignalRCorsSettings cors() { + return this.cors; + } + + /** + * Set the cors property: Cross-Origin Resource Sharing (CORS) settings. + * + * @param cors the cors value to set. + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withCors(SignalRCorsSettings cors) { + this.cors = cors; + return this; + } + + /** + * Get the upstream property: Upstream settings when the Azure SignalR is in server-less mode. + * + * @return the upstream value. + */ + public ServerlessUpstreamSettings upstream() { + return this.upstream; + } + + /** + * Set the upstream property: Upstream settings when the Azure SignalR is in server-less mode. + * + * @param upstream the upstream value to set. + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withUpstream(ServerlessUpstreamSettings upstream) { + this.upstream = upstream; + return this; + } + + /** + * Get the networkACLs property: Network ACLs. + * + * @return the networkACLs value. + */ + public SignalRNetworkACLs networkACLs() { + return this.networkACLs; + } + + /** + * Set the networkACLs property: Network ACLs. + * + * @param networkACLs the networkACLs value to set. + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withNetworkACLs(SignalRNetworkACLs networkACLs) { + this.networkACLs = networkACLs; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the externalIp property: The publicly accessible IP of the SignalR service. + * + * @return the externalIp value. + */ + public String externalIp() { + return this.externalIp; + } + + /** + * Get the hostname property: FQDN of the SignalR service instance. Format: xxx.service.signalr.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the publicPort property: The publicly accessible port of the SignalR service which is designed for + * browser/client side usage. + * + * @return the publicPort value. + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Get the serverPort property: The publicly accessible port of the SignalR service which is designed for customer + * server side usage. + * + * @return the serverPort value. + */ + public Integer serverPort() { + return this.serverPort; + } + + /** + * Get the version property: Version of the SignalR resource. Probably you need the same or higher version of client + * SDKs. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections to the SignalR resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the tls property: TLS settings. + * + * @return the tls value. + */ + public SignalRTlsSettings tls() { + return this.tls; + } + + /** + * Set the tls property: TLS settings. + * + * @param tls the tls value to set. + * @return the SignalRResourceInner object itself. + */ + public SignalRResourceInner withTls(SignalRTlsSettings tls) { + this.tls = tls; + return this; + } + + /** {@inheritDoc} */ + @Override + public SignalRResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public SignalRResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sku() != null) { + sku().validate(); + } + if (identity() != null) { + identity().validate(); + } + if (features() != null) { + features().forEach(e -> e.validate()); + } + if (cors() != null) { + cors().validate(); + } + if (upstream() != null) { + upstream().validate(); + } + if (networkACLs() != null) { + networkACLs().validate(); + } + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (tls() != null) { + tls().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRUsageInner.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRUsageInner.java new file mode 100644 index 0000000000000..e7bfe3012e057 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/SignalRUsageInner.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.models.SignalRUsageName; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Object that describes a specific usage of SignalR resources. */ +@Fluent +public final class SignalRUsageInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRUsageInner.class); + + /* + * Fully qualified ARM resource id + */ + @JsonProperty(value = "id") + private String id; + + /* + * Current value for the usage quota. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /* + * The maximum permitted value for the usage quota. If there is no limit, + * this value will be -1. + */ + @JsonProperty(value = "limit") + private Long limit; + + /* + * Localizable String object containing the name and a localized value. + */ + @JsonProperty(value = "name") + private SignalRUsageName name; + + /* + * Representing the units of the usage quota. Possible values are: Count, + * Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Get the id property: Fully qualified ARM resource id. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ARM resource id. + * + * @param id the id value to set. + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the currentValue property: Current value for the usage quota. + * + * @return the currentValue value. + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the currentValue property: Current value for the usage quota. + * + * @param currentValue the currentValue value to set. + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the limit property: The maximum permitted value for the usage quota. If there is no limit, this value will be + * -1. + * + * @return the limit value. + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit property: The maximum permitted value for the usage quota. If there is no limit, this value will be + * -1. + * + * @param limit the limit value to set. + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the name property: Localizable String object containing the name and a localized value. + * + * @return the name value. + */ + public SignalRUsageName name() { + return this.name; + } + + /** + * Set the name property: Localizable String object containing the name and a localized value. + * + * @param name the name value to set. + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withName(SignalRUsageName name) { + this.name = name; + return this; + } + + /** + * Get the unit property: Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, + * Percent, CountPerSecond, BytesPerSecond. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, + * Percent, CountPerSecond, BytesPerSecond. + * + * @param unit the unit value to set. + * @return the SignalRUsageInner object itself. + */ + public SignalRUsageInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() != null) { + name().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/package-info.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/package-info.java new file mode 100644 index 0000000000000..1e650ff3bebcc --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for SignalRManagementClient. REST API for Azure SignalR Service. */ +package com.azure.resourcemanager.signalr.fluent.models; diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/package-info.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/package-info.java new file mode 100644 index 0000000000000..88b5a7b7ecf0f --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for SignalRManagementClient. REST API for Azure SignalR Service. */ +package com.azure.resourcemanager.signalr.fluent; diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/NameAvailabilityImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/NameAvailabilityImpl.java new file mode 100644 index 0000000000000..a9d010a494123 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/NameAvailabilityImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.signalr.models.NameAvailability; + +public final class NameAvailabilityImpl implements NameAvailability { + private NameAvailabilityInner innerObject; + + private final SignalRManager serviceManager; + + NameAvailabilityImpl(NameAvailabilityInner innerObject, SignalRManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public String reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public NameAvailabilityInner innerModel() { + return this.innerObject; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationImpl.java new file mode 100644 index 0000000000000..48ccaf411dad9 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.models.OperationInner; +import com.azure.resourcemanager.signalr.models.Operation; +import com.azure.resourcemanager.signalr.models.OperationDisplay; +import com.azure.resourcemanager.signalr.models.OperationProperties; + +public final class OperationImpl implements Operation { + private OperationInner innerObject; + + private final SignalRManager serviceManager; + + OperationImpl(OperationInner innerObject, SignalRManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationProperties properties() { + return this.innerModel().properties(); + } + + public OperationInner innerModel() { + return this.innerObject; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsClientImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..ff9cdc2714846 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsClientImpl.java @@ -0,0 +1,269 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.OperationsClient; +import com.azure.resourcemanager.signalr.fluent.models.OperationInner; +import com.azure.resourcemanager.signalr.models.OperationList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final SignalRManagementClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(SignalRManagementClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SignalRManagementClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SignalRManagementCli") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.SignalRService/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of the request to list REST API operations. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..c0e279afd05d3 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.OperationsClient; +import com.azure.resourcemanager.signalr.fluent.models.OperationInner; +import com.azure.resourcemanager.signalr.models.Operation; +import com.azure.resourcemanager.signalr.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final SignalRManager serviceManager; + + public OperationsImpl(OperationsClient innerClient, SignalRManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new OperationImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/PrivateEndpointConnectionImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 0000000000000..5057eb43d15d2 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.signalr.models.PrivateEndpoint; +import com.azure.resourcemanager.signalr.models.PrivateEndpointConnection; +import com.azure.resourcemanager.signalr.models.PrivateLinkServiceConnectionState; +import com.azure.resourcemanager.signalr.models.ProvisioningState; + +public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { + private PrivateEndpointConnectionInner innerObject; + + private final SignalRManager serviceManager; + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, SignalRManager 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 ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public PrivateEndpoint privateEndpoint() { + return this.innerModel().privateEndpoint(); + } + + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.innerModel().privateLinkServiceConnectionState(); + } + + public PrivateEndpointConnectionInner innerModel() { + return this.innerObject; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/PrivateLinkResourceImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 0000000000000..e059d367e0160 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.signalr.models.PrivateLinkResource; +import java.util.Collections; +import java.util.List; + +public final class PrivateLinkResourceImpl implements PrivateLinkResource { + private PrivateLinkResourceInner innerObject; + + private final SignalRManager serviceManager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, SignalRManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String groupId() { + return this.innerModel().groupId(); + } + + public List requiredMembers() { + List inner = this.innerModel().requiredMembers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public List requiredZoneNames() { + List inner = this.innerModel().requiredZoneNames(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public PrivateLinkResourceInner innerModel() { + return this.innerObject; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRKeysImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRKeysImpl.java new file mode 100644 index 0000000000000..bd179437246d8 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRKeysImpl.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.models.SignalRKeysInner; +import com.azure.resourcemanager.signalr.models.SignalRKeys; + +public final class SignalRKeysImpl implements SignalRKeys { + private SignalRKeysInner innerObject; + + private final SignalRManager serviceManager; + + SignalRKeysImpl(SignalRKeysInner innerObject, SignalRManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String primaryKey() { + return this.innerModel().primaryKey(); + } + + public String secondaryKey() { + return this.innerModel().secondaryKey(); + } + + public String primaryConnectionString() { + return this.innerModel().primaryConnectionString(); + } + + public String secondaryConnectionString() { + return this.innerModel().secondaryConnectionString(); + } + + public SignalRKeysInner innerModel() { + return this.innerObject; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRManagementClientBuilder.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRManagementClientBuilder.java new file mode 100644 index 0000000000000..0b4dc0b02defd --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRManagementClientBuilder.java @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the SignalRManagementClientImpl type. */ +@ServiceClientBuilder(serviceClients = {SignalRManagementClientImpl.class}) +public final class SignalRManagementClientBuilder { + /* + * Gets subscription Id which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every + * service call. + */ + private String subscriptionId; + + /** + * Sets Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the SignalRManagementClientBuilder. + */ + public SignalRManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the SignalRManagementClientBuilder. + */ + public SignalRManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the SignalRManagementClientBuilder. + */ + public SignalRManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the SignalRManagementClientBuilder. + */ + public SignalRManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the SignalRManagementClientBuilder. + */ + public SignalRManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the SignalRManagementClientBuilder. + */ + public SignalRManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of SignalRManagementClientImpl with the provided parameters. + * + * @return an instance of SignalRManagementClientImpl. + */ + public SignalRManagementClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + SignalRManagementClientImpl client = + new SignalRManagementClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRManagementClientImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRManagementClientImpl.java new file mode 100644 index 0000000000000..d45d2c2af2a9e --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRManagementClientImpl.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.signalr.fluent.OperationsClient; +import com.azure.resourcemanager.signalr.fluent.SignalRManagementClient; +import com.azure.resourcemanager.signalr.fluent.SignalRPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.signalr.fluent.SignalRPrivateLinkResourcesClient; +import com.azure.resourcemanager.signalr.fluent.SignalRsClient; +import com.azure.resourcemanager.signalr.fluent.UsagesClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the SignalRManagementClientImpl type. */ +@ServiceClient(builder = SignalRManagementClientBuilder.class) +public final class SignalRManagementClientImpl implements SignalRManagementClient { + private final ClientLogger logger = new ClientLogger(SignalRManagementClientImpl.class); + + /** + * Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of + * the URI for every service call. + */ + private final String subscriptionId; + + /** + * Gets Gets subscription Id which uniquely identify the Microsoft Azure subscription. The subscription ID forms + * part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The SignalRsClient object to access its operations. */ + private final SignalRsClient signalRs; + + /** + * Gets the SignalRsClient object to access its operations. + * + * @return the SignalRsClient object. + */ + public SignalRsClient getSignalRs() { + return this.signalRs; + } + + /** The SignalRPrivateEndpointConnectionsClient object to access its operations. */ + private final SignalRPrivateEndpointConnectionsClient signalRPrivateEndpointConnections; + + /** + * Gets the SignalRPrivateEndpointConnectionsClient object to access its operations. + * + * @return the SignalRPrivateEndpointConnectionsClient object. + */ + public SignalRPrivateEndpointConnectionsClient getSignalRPrivateEndpointConnections() { + return this.signalRPrivateEndpointConnections; + } + + /** The SignalRPrivateLinkResourcesClient object to access its operations. */ + private final SignalRPrivateLinkResourcesClient signalRPrivateLinkResources; + + /** + * Gets the SignalRPrivateLinkResourcesClient object to access its operations. + * + * @return the SignalRPrivateLinkResourcesClient object. + */ + public SignalRPrivateLinkResourcesClient getSignalRPrivateLinkResources() { + return this.signalRPrivateLinkResources; + } + + /** The UsagesClient object to access its operations. */ + private final UsagesClient usages; + + /** + * Gets the UsagesClient object to access its operations. + * + * @return the UsagesClient object. + */ + public UsagesClient getUsages() { + return this.usages; + } + + /** + * Initializes an instance of SignalRManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId Gets subscription Id which uniquely identify the Microsoft Azure subscription. The + * subscription ID forms part of the URI for every service call. + * @param endpoint server parameter. + */ + SignalRManagementClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2020-07-01-preview"; + this.operations = new OperationsClientImpl(this); + this.signalRs = new SignalRsClientImpl(this); + this.signalRPrivateEndpointConnections = new SignalRPrivateEndpointConnectionsClientImpl(this); + this.signalRPrivateLinkResources = new SignalRPrivateLinkResourcesClientImpl(this); + this.usages = new UsagesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateEndpointConnectionsClientImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateEndpointConnectionsClientImpl.java new file mode 100644 index 0000000000000..b0dc12a0ade4e --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateEndpointConnectionsClientImpl.java @@ -0,0 +1,818 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.signalr.fluent.SignalRPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.signalr.fluent.models.PrivateEndpointConnectionInner; +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 SignalRPrivateEndpointConnectionsClient. + */ +public final class SignalRPrivateEndpointConnectionsClientImpl implements SignalRPrivateEndpointConnectionsClient { + private final ClientLogger logger = new ClientLogger(SignalRPrivateEndpointConnectionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SignalRPrivateEndpointConnectionsService service; + + /** The service client containing this operation class. */ + private final SignalRManagementClientImpl client; + + /** + * Initializes an instance of SignalRPrivateEndpointConnectionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SignalRPrivateEndpointConnectionsClientImpl(SignalRManagementClientImpl client) { + this.service = + RestProxy + .create( + SignalRPrivateEndpointConnectionsService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SignalRManagementClientSignalRPrivateEndpointConnections to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SignalRManagementCli") + private interface SignalRPrivateEndpointConnectionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .get( + this.client.getEndpoint(), + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + return getWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner get( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + return getAsync(privateEndpointConnectionName, resourceGroupName, resourceName).block(); + } + + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + return getWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context).block(); + } + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 endpoint connection to SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String privateEndpointConnectionName, + String resourceGroupName, + String resourceName, + PrivateEndpointConnectionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 endpoint connection to SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String privateEndpointConnectionName, + String resourceGroupName, + String resourceName, + PrivateEndpointConnectionInner parameters, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters The resource of private endpoint and its properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 endpoint connection to SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String privateEndpointConnectionName, + String resourceGroupName, + String resourceName, + PrivateEndpointConnectionInner parameters) { + return updateWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a private endpoint connection to SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + final PrivateEndpointConnectionInner parameters = null; + return updateWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a private endpoint connection to SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateEndpointConnectionInner update( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + final PrivateEndpointConnectionInner parameters = null; + return updateAsync(privateEndpointConnectionName, resourceGroupName, resourceName, parameters).block(); + } + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 endpoint connection to SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String privateEndpointConnectionName, + String resourceGroupName, + String resourceName, + PrivateEndpointConnectionInner parameters, + Context context) { + return updateWithResponseAsync( + privateEndpointConnectionName, resourceGroupName, resourceName, parameters, context) + .block(); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (privateEndpointConnectionName == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter privateEndpointConnectionName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + privateEndpointConnectionName, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + Mono>> mono = + deleteWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + return beginDeleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context) + .getSyncPoller(); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + return beginDeleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + deleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName).block(); + } + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + deleteAsync(privateEndpointConnectionName, resourceGroupName, resourceName, context).block(); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateEndpointConnectionsImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateEndpointConnectionsImpl.java new file mode 100644 index 0000000000000..869cf04944415 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateEndpointConnectionsImpl.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.SignalRPrivateEndpointConnectionsClient; +import com.azure.resourcemanager.signalr.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.signalr.models.PrivateEndpointConnection; +import com.azure.resourcemanager.signalr.models.SignalRPrivateEndpointConnections; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SignalRPrivateEndpointConnectionsImpl implements SignalRPrivateEndpointConnections { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRPrivateEndpointConnectionsImpl.class); + + private final SignalRPrivateEndpointConnectionsClient innerClient; + + private final SignalRManager serviceManager; + + public SignalRPrivateEndpointConnectionsImpl( + SignalRPrivateEndpointConnectionsClient innerClient, SignalRManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PrivateEndpointConnection get( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().get(privateEndpointConnectionName, resourceGroupName, resourceName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + Response inner = + this + .serviceClient() + .getWithResponse(privateEndpointConnectionName, resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PrivateEndpointConnection update( + String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + PrivateEndpointConnectionInner inner = + this.serviceClient().update(privateEndpointConnectionName, resourceGroupName, resourceName); + if (inner != null) { + return new PrivateEndpointConnectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response updateWithResponse( + String privateEndpointConnectionName, + String resourceGroupName, + String resourceName, + PrivateEndpointConnectionInner parameters, + Context context) { + Response inner = + this + .serviceClient() + .updateWithResponse( + privateEndpointConnectionName, resourceGroupName, resourceName, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new PrivateEndpointConnectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName) { + this.serviceClient().delete(privateEndpointConnectionName, resourceGroupName, resourceName); + } + + public void delete( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(privateEndpointConnectionName, resourceGroupName, resourceName, context); + } + + private SignalRPrivateEndpointConnectionsClient serviceClient() { + return this.innerClient; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateLinkResourcesClientImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateLinkResourcesClientImpl.java new file mode 100644 index 0000000000000..8e67072ea3016 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateLinkResourcesClientImpl.java @@ -0,0 +1,345 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.SignalRPrivateLinkResourcesClient; +import com.azure.resourcemanager.signalr.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.signalr.models.PrivateLinkResourceList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SignalRPrivateLinkResourcesClient. */ +public final class SignalRPrivateLinkResourcesClientImpl implements SignalRPrivateLinkResourcesClient { + private final ClientLogger logger = new ClientLogger(SignalRPrivateLinkResourcesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SignalRPrivateLinkResourcesService service; + + /** The service client containing this operation class. */ + private final SignalRManagementClientImpl client; + + /** + * Initializes an instance of SignalRPrivateLinkResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SignalRPrivateLinkResourcesClientImpl(SignalRManagementClientImpl client) { + this.service = + RestProxy + .create( + SignalRPrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SignalRManagementClientSignalRPrivateLinkResources to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SignalRManagementCli") + private interface SignalRPrivateLinkResourcesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}/privateLinkResources") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @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); + } + + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String resourceName) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, resourceName), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync( + String resourceGroupName, String resourceName, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceGroupName, resourceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String resourceName) { + return new PagedIterable<>(listAsync(resourceGroupName, resourceName)); + } + + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list( + String resourceGroupName, String resourceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, resourceName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of AzSignalR. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return contains a list of AzSignalR. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateLinkResourcesImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateLinkResourcesImpl.java new file mode 100644 index 0000000000000..9221ac152d884 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRPrivateLinkResourcesImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.SignalRPrivateLinkResourcesClient; +import com.azure.resourcemanager.signalr.fluent.models.PrivateLinkResourceInner; +import com.azure.resourcemanager.signalr.models.PrivateLinkResource; +import com.azure.resourcemanager.signalr.models.SignalRPrivateLinkResources; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SignalRPrivateLinkResourcesImpl implements SignalRPrivateLinkResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRPrivateLinkResourcesImpl.class); + + private final SignalRPrivateLinkResourcesClient innerClient; + + private final SignalRManager serviceManager; + + public SignalRPrivateLinkResourcesImpl( + SignalRPrivateLinkResourcesClient innerClient, SignalRManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String resourceGroupName, String resourceName) { + PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName); + return inner.mapPage(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String resourceName, Context context) { + PagedIterable inner = + this.serviceClient().list(resourceGroupName, resourceName, context); + return inner.mapPage(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager())); + } + + private SignalRPrivateLinkResourcesClient serviceClient() { + return this.innerClient; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRResourceImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRResourceImpl.java new file mode 100644 index 0000000000000..fea288bede095 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRResourceImpl.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.models.PrivateEndpointConnectionInner; +import com.azure.resourcemanager.signalr.fluent.models.SignalRResourceInner; +import com.azure.resourcemanager.signalr.models.ManagedIdentity; +import com.azure.resourcemanager.signalr.models.PrivateEndpointConnection; +import com.azure.resourcemanager.signalr.models.ProvisioningState; +import com.azure.resourcemanager.signalr.models.ResourceSku; +import com.azure.resourcemanager.signalr.models.ServerlessUpstreamSettings; +import com.azure.resourcemanager.signalr.models.ServiceKind; +import com.azure.resourcemanager.signalr.models.SignalRCorsSettings; +import com.azure.resourcemanager.signalr.models.SignalRFeature; +import com.azure.resourcemanager.signalr.models.SignalRNetworkACLs; +import com.azure.resourcemanager.signalr.models.SignalRResource; +import com.azure.resourcemanager.signalr.models.SignalRTlsSettings; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public final class SignalRResourceImpl implements SignalRResource, SignalRResource.Definition, SignalRResource.Update { + private SignalRResourceInner innerObject; + + private final SignalRManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public ResourceSku sku() { + return this.innerModel().sku(); + } + + public ServiceKind kind() { + return this.innerModel().kind(); + } + + public ManagedIdentity identity() { + return this.innerModel().identity(); + } + + public List features() { + List inner = this.innerModel().features(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public SignalRCorsSettings cors() { + return this.innerModel().cors(); + } + + public ServerlessUpstreamSettings upstream() { + return this.innerModel().upstream(); + } + + public SignalRNetworkACLs networkACLs() { + return this.innerModel().networkACLs(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String externalIp() { + return this.innerModel().externalIp(); + } + + public String hostname() { + return this.innerModel().hostname(); + } + + public Integer publicPort() { + return this.innerModel().publicPort(); + } + + public Integer serverPort() { + return this.innerModel().serverPort(); + } + + public String version() { + return this.innerModel().version(); + } + + public List privateEndpointConnections() { + List inner = this.innerModel().privateEndpointConnections(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public SignalRTlsSettings tls() { + return this.innerModel().tls(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public SignalRResourceInner innerModel() { + return this.innerObject; + } + + private SignalRManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String resourceName; + + public SignalRResourceImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public SignalRResource create() { + this.innerObject = + serviceManager + .serviceClient() + .getSignalRs() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public SignalRResource create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSignalRs() + .createOrUpdate(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + SignalRResourceImpl(String name, SignalRManager serviceManager) { + this.innerObject = new SignalRResourceInner(); + this.serviceManager = serviceManager; + this.resourceName = name; + } + + public SignalRResourceImpl update() { + return this; + } + + public SignalRResource apply() { + this.innerObject = + serviceManager + .serviceClient() + .getSignalRs() + .update(resourceGroupName, resourceName, this.innerModel(), Context.NONE); + return this; + } + + public SignalRResource apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSignalRs() + .update(resourceGroupName, resourceName, this.innerModel(), context); + return this; + } + + SignalRResourceImpl(SignalRResourceInner innerObject, SignalRManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.resourceName = Utils.getValueFromIdByName(innerObject.id(), "signalR"); + } + + public SignalRResource refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getSignalRs() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE) + .getValue(); + return this; + } + + public SignalRResource refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getSignalRs() + .getByResourceGroupWithResponse(resourceGroupName, resourceName, context) + .getValue(); + return this; + } + + public SignalRResourceImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public SignalRResourceImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public SignalRResourceImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public SignalRResourceImpl withSku(ResourceSku sku) { + this.innerModel().withSku(sku); + return this; + } + + public SignalRResourceImpl withKind(ServiceKind kind) { + this.innerModel().withKind(kind); + return this; + } + + public SignalRResourceImpl withIdentity(ManagedIdentity identity) { + this.innerModel().withIdentity(identity); + return this; + } + + public SignalRResourceImpl withFeatures(List features) { + this.innerModel().withFeatures(features); + return this; + } + + public SignalRResourceImpl withCors(SignalRCorsSettings cors) { + this.innerModel().withCors(cors); + return this; + } + + public SignalRResourceImpl withUpstream(ServerlessUpstreamSettings upstream) { + this.innerModel().withUpstream(upstream); + return this; + } + + public SignalRResourceImpl withNetworkACLs(SignalRNetworkACLs networkACLs) { + this.innerModel().withNetworkACLs(networkACLs); + return this; + } + + public SignalRResourceImpl withTls(SignalRTlsSettings tls) { + this.innerModel().withTls(tls); + return this; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRUsageImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRUsageImpl.java new file mode 100644 index 0000000000000..b2e0935181121 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRUsageImpl.java @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.models.SignalRUsageInner; +import com.azure.resourcemanager.signalr.models.SignalRUsage; +import com.azure.resourcemanager.signalr.models.SignalRUsageName; + +public final class SignalRUsageImpl implements SignalRUsage { + private SignalRUsageInner innerObject; + + private final SignalRManager serviceManager; + + SignalRUsageImpl(SignalRUsageInner innerObject, SignalRManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public Long currentValue() { + return this.innerModel().currentValue(); + } + + public Long limit() { + return this.innerModel().limit(); + } + + public SignalRUsageName name() { + return this.innerModel().name(); + } + + public String unit() { + return this.innerModel().unit(); + } + + public SignalRUsageInner innerModel() { + return this.innerObject; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRsClientImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRsClientImpl.java new file mode 100644 index 0000000000000..a2eb94e74cc5d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRsClientImpl.java @@ -0,0 +1,2570 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.signalr.fluent.SignalRsClient; +import com.azure.resourcemanager.signalr.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.signalr.fluent.models.SignalRKeysInner; +import com.azure.resourcemanager.signalr.fluent.models.SignalRResourceInner; +import com.azure.resourcemanager.signalr.models.NameAvailabilityParameters; +import com.azure.resourcemanager.signalr.models.RegenerateKeyParameters; +import com.azure.resourcemanager.signalr.models.SignalRResourceList; +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 SignalRsClient. */ +public final class SignalRsClientImpl implements SignalRsClient { + private final ClientLogger logger = new ClientLogger(SignalRsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final SignalRsService service; + + /** The service client containing this operation class. */ + private final SignalRManagementClientImpl client; + + /** + * Initializes an instance of SignalRsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SignalRsClientImpl(SignalRManagementClientImpl client) { + this.service = RestProxy.create(SignalRsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SignalRManagementClientSignalRs to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SignalRManagementCli") + private interface SignalRsService { + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}" + + "/checkNameAvailability") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") NameAvailabilityParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/signalR") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}/listKeys") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listKeys( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}/regenerateKey") + @ExpectedResponses({201}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> regenerateKey( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") RegenerateKeyParameters parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}") + @ExpectedResponses({200, 201, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") SignalRResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @BodyParam("application/json") SignalRResourceInner parameters, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService" + + "/signalR/{resourceName}/restart") + @ExpectedResponses({202, 204}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> restart( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("resourceName") String resourceName, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .checkNameAvailability( + this.client.getEndpoint(), + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @param parameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameAvailabilityWithResponseAsync( + String location, NameAvailabilityParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required 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 + .checkNameAvailability( + this.client.getEndpoint(), + location, + this.client.getApiVersion(), + this.client.getSubscriptionId(), + parameters, + accept, + context); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @param parameters Parameters supplied to the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync( + String location, NameAvailabilityParameters parameters) { + return checkNameAvailabilityWithResponseAsync(location, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(String location) { + final NameAvailabilityParameters parameters = null; + return checkNameAvailabilityWithResponseAsync(location, parameters) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NameAvailabilityInner checkNameAvailability(String location) { + final NameAvailabilityParameters parameters = null; + return checkNameAvailabilityAsync(location, parameters).block(); + } + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @param parameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check name availability. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters parameters, Context context) { + return checkNameAvailabilityWithResponseAsync(location, parameters, context).block(); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync( + String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listKeys( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listKeysAsync(String resourceGroupName, String resourceName) { + return listKeysWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRKeysInner listKeys(String resourceGroupName, String resourceName) { + return listKeysAsync(resourceGroupName, resourceName).block(); + } + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listKeysWithResponse( + String resourceGroupName, String resourceName, Context context) { + return listKeysWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> regenerateKeyWithResponseAsync( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .regenerateKey( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> regenerateKeyWithResponseAsync( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .regenerateKey( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SignalRKeysInner> beginRegenerateKeyAsync( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { + Mono>> mono = + regenerateKeyWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SignalRKeysInner.class, SignalRKeysInner.class, Context.NONE); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SignalRKeysInner> beginRegenerateKeyAsync( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + regenerateKeyWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SignalRKeysInner.class, SignalRKeysInner.class, context); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SignalRKeysInner> beginRegenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { + return beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SignalRKeysInner> beginRegenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { + return beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { + return beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync(String resourceGroupName, String resourceName) { + final RegenerateKeyParameters parameters = null; + return beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateKeyAsync( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { + return beginRegenerateKeyAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRKeysInner regenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { + return regenerateKeyAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRKeysInner regenerateKey(String resourceGroupName, String resourceName) { + final RegenerateKeyParameters parameters = null; + return regenerateKeyAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represents the access keys of SignalR service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRKeysInner regenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { + return regenerateKeyAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String resourceName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRResourceInner getByResourceGroup(String resourceGroupName, String resourceName) { + return getByResourceGroupAsync(resourceGroupName, resourceName).block(); + } + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SignalRResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SignalRResourceInner.class, + SignalRResourceInner.class, + Context.NONE); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SignalRResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SignalRResourceInner.class, SignalRResourceInner.class, context); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SignalRResourceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SignalRResourceInner> beginCreateOrUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String resourceName) { + final SignalRResourceInner parameters = null; + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRResourceInner createOrUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRResourceInner createOrUpdate(String resourceGroupName, String resourceName) { + final SignalRResourceInner parameters = null; + return createOrUpdateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Create a new SignalR service and update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the create or update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRResourceInner createOrUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + return createOrUpdateAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .delete( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName) { + return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName) { + deleteAsync(resourceGroupName, resourceName).block(); + } + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, Context context) { + deleteAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + if (parameters != null) { + parameters.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + parameters, + accept, + context); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SignalRResourceInner> beginUpdateAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, resourceName, parameters); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SignalRResourceInner.class, + SignalRResourceInner.class, + Context.NONE); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, SignalRResourceInner> beginUpdateAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, resourceName, parameters, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SignalRResourceInner.class, SignalRResourceInner.class, context); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SignalRResourceInner> beginUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + return beginUpdateAsync(resourceGroupName, resourceName, parameters).getSyncPoller(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, SignalRResourceInner> beginUpdate( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, resourceName, parameters, context).getSyncPoller(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + return beginUpdateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String resourceName) { + final SignalRResourceInner parameters = null; + return beginUpdateAsync(resourceGroupName, resourceName, parameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + return beginUpdateAsync(resourceGroupName, resourceName, parameters, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRResourceInner update(String resourceGroupName, String resourceName, SignalRResourceInner parameters) { + return updateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRResourceInner update(String resourceGroupName, String resourceName) { + final SignalRResourceInner parameters = null; + return updateAsync(resourceGroupName, resourceName, parameters).block(); + } + + /** + * Operation to update an exiting SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameters for the update operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 class represent a SignalR service resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SignalRResourceInner update( + String resourceGroupName, String resourceName, SignalRResourceInner parameters, Context context) { + return updateAsync(resourceGroupName, resourceName, parameters, context).block(); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync(String resourceGroupName, String resourceName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> restartWithResponseAsync( + String resourceGroupName, String resourceName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (resourceName == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restart( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + resourceName, + accept, + context); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync(String resourceGroupName, String resourceName) { + Mono>> mono = restartWithResponseAsync(resourceGroupName, resourceName); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, Void> beginRestartAsync( + String resourceGroupName, String resourceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = restartWithResponseAsync(resourceGroupName, resourceName, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart(String resourceGroupName, String resourceName) { + return beginRestartAsync(resourceGroupName, resourceName).getSyncPoller(); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, Void> beginRestart( + String resourceGroupName, String resourceName, Context context) { + return beginRestartAsync(resourceGroupName, resourceName, context).getSyncPoller(); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String resourceName) { + return beginRestartAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono restartAsync(String resourceGroupName, String resourceName, Context context) { + return beginRestartAsync(resourceGroupName, resourceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String resourceName) { + restartAsync(resourceGroupName, resourceName).block(); + } + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void restart(String resourceGroupName, String resourceName, Context context) { + restartAsync(resourceGroupName, resourceName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRsImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRsImpl.java new file mode 100644 index 0000000000000..15a91f1070b1b --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRsImpl.java @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.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.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.SignalRsClient; +import com.azure.resourcemanager.signalr.fluent.models.NameAvailabilityInner; +import com.azure.resourcemanager.signalr.fluent.models.SignalRKeysInner; +import com.azure.resourcemanager.signalr.fluent.models.SignalRResourceInner; +import com.azure.resourcemanager.signalr.models.NameAvailability; +import com.azure.resourcemanager.signalr.models.NameAvailabilityParameters; +import com.azure.resourcemanager.signalr.models.RegenerateKeyParameters; +import com.azure.resourcemanager.signalr.models.SignalRKeys; +import com.azure.resourcemanager.signalr.models.SignalRResource; +import com.azure.resourcemanager.signalr.models.SignalRs; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class SignalRsImpl implements SignalRs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRsImpl.class); + + private final SignalRsClient innerClient; + + private final SignalRManager serviceManager; + + public SignalRsImpl(SignalRsClient innerClient, SignalRManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public NameAvailability checkNameAvailability(String location) { + NameAvailabilityInner inner = this.serviceClient().checkNameAvailability(location); + if (inner != null) { + return new NameAvailabilityImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters parameters, Context context) { + Response inner = + this.serviceClient().checkNameAvailabilityWithResponse(location, parameters, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new NameAvailabilityImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return inner.mapPage(inner1 -> new SignalRResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return inner.mapPage(inner1 -> new SignalRResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return inner.mapPage(inner1 -> new SignalRResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return inner.mapPage(inner1 -> new SignalRResourceImpl(inner1, this.manager())); + } + + public SignalRKeys listKeys(String resourceGroupName, String resourceName) { + SignalRKeysInner inner = this.serviceClient().listKeys(resourceGroupName, resourceName); + if (inner != null) { + return new SignalRKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listKeysWithResponse(String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().listKeysWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SignalRKeysImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SignalRKeys regenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters) { + SignalRKeysInner inner = this.serviceClient().regenerateKey(resourceGroupName, resourceName, parameters); + if (inner != null) { + return new SignalRKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public SignalRKeys regenerateKey(String resourceGroupName, String resourceName) { + SignalRKeysInner inner = this.serviceClient().regenerateKey(resourceGroupName, resourceName); + if (inner != null) { + return new SignalRKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public SignalRKeys regenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context) { + SignalRKeysInner inner = + this.serviceClient().regenerateKey(resourceGroupName, resourceName, parameters, context); + if (inner != null) { + return new SignalRKeysImpl(inner, this.manager()); + } else { + return null; + } + } + + public SignalRResource getByResourceGroup(String resourceGroupName, String resourceName) { + SignalRResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, resourceName); + if (inner != null) { + return new SignalRResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SignalRResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + this.serviceClient().delete(resourceGroupName, resourceName); + } + + public void delete(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, context); + } + + public void restart(String resourceGroupName, String resourceName) { + this.serviceClient().restart(resourceGroupName, resourceName); + } + + public void restart(String resourceGroupName, String resourceName, Context context) { + this.serviceClient().restart(resourceGroupName, resourceName, context); + } + + public SignalRResource getById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "signalR"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "signalR"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, resourceName, context); + } + + public void deleteById(String id) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "signalR"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", id))); + } + this.delete(resourceGroupName, resourceName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String resourceName = Utils.getValueFromIdByName(id, "signalR"); + if (resourceName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", id))); + } + this.delete(resourceGroupName, resourceName, context); + } + + private SignalRsClient serviceClient() { + return this.innerClient; + } + + private SignalRManager manager() { + return this.serviceManager; + } + + public SignalRResourceImpl define(String name) { + return new SignalRResourceImpl(name, this.manager()); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/UsagesClientImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/UsagesClientImpl.java new file mode 100644 index 0000000000000..f4d7a934ae295 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/UsagesClientImpl.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.UsagesClient; +import com.azure.resourcemanager.signalr.fluent.models.SignalRUsageInner; +import com.azure.resourcemanager.signalr.models.SignalRUsageList; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in UsagesClient. */ +public final class UsagesClientImpl implements UsagesClient { + private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final UsagesService service; + + /** The service client containing this operation class. */ + private final SignalRManagementClientImpl client; + + /** + * Initializes an instance of UsagesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + UsagesClientImpl(SignalRManagementClientImpl client) { + this.service = RestProxy.create(UsagesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SignalRManagementClientUsages to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SignalRManagementCli") + private interface UsagesService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("location") String location, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + location, + 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)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String location, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (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(), + location, + 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)); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location) { + return new PagedFlux<>(() -> listSinglePageAsync(location), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String location, Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(location, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location) { + return new PagedIterable<>(listAsync(location)); + } + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String location, Context context) { + return new PagedIterable<>(listAsync(location, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/UsagesImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/UsagesImpl.java new file mode 100644 index 0000000000000..6986ea4c591c7 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/UsagesImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.SignalRManager; +import com.azure.resourcemanager.signalr.fluent.UsagesClient; +import com.azure.resourcemanager.signalr.fluent.models.SignalRUsageInner; +import com.azure.resourcemanager.signalr.models.SignalRUsage; +import com.azure.resourcemanager.signalr.models.Usages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class UsagesImpl implements Usages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + + private final UsagesClient innerClient; + + private final SignalRManager serviceManager; + + public UsagesImpl(UsagesClient innerClient, SignalRManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); + return inner.mapPage(inner1 -> new SignalRUsageImpl(inner1, this.manager())); + } + + public PagedIterable list(String location, Context context) { + PagedIterable inner = this.serviceClient().list(location, context); + return inner.mapPage(inner1 -> new SignalRUsageImpl(inner1, this.manager())); + } + + private UsagesClient serviceClient() { + return this.innerClient; + } + + private SignalRManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/Utils.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/Utils.java new file mode 100644 index 0000000000000..7290303265d19 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/Utils.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.implementation; + +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/package-info.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/package-info.java new file mode 100644 index 0000000000000..886dfff084241 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for SignalRManagementClient. REST API for Azure SignalR Service. */ +package com.azure.resourcemanager.signalr.implementation; diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/AclAction.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/AclAction.java new file mode 100644 index 0000000000000..3ab851d2ea719 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/AclAction.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AclAction. */ +public final class AclAction extends ExpandableStringEnum { + /** Static value Allow for AclAction. */ + public static final AclAction ALLOW = fromString("Allow"); + + /** Static value Deny for AclAction. */ + public static final AclAction DENY = fromString("Deny"); + + /** + * Creates or finds a AclAction from its string representation. + * + * @param name a name to look for. + * @return the corresponding AclAction. + */ + @JsonCreator + public static AclAction fromString(String name) { + return fromString(name, AclAction.class); + } + + /** @return known AclAction values. */ + public static Collection values() { + return values(AclAction.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Dimension.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Dimension.java new file mode 100644 index 0000000000000..041c9dc5439e6 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Dimension.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Dimension of metrics. */ +@Fluent +public final class Dimension { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dimension.class); + + /* + * The public facing name of the dimension. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the dimension. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Name of the dimension as it appears in MDM. + */ + @JsonProperty(value = "internalName") + private String internalName; + + /* + * A Boolean flag indicating whether this dimension should be included for + * the shoebox export scenario. + */ + @JsonProperty(value = "toBeExportedForShoebox") + private Boolean toBeExportedForShoebox; + + /** + * Get the name property: The public facing name of the dimension. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The public facing name of the dimension. + * + * @param name the name value to set. + * @return the Dimension object itself. + */ + public Dimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the dimension. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the dimension. + * + * @param displayName the displayName value to set. + * @return the Dimension object itself. + */ + public Dimension withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the internalName property: Name of the dimension as it appears in MDM. + * + * @return the internalName value. + */ + public String internalName() { + return this.internalName; + } + + /** + * Set the internalName property: Name of the dimension as it appears in MDM. + * + * @param internalName the internalName value to set. + * @return the Dimension object itself. + */ + public Dimension withInternalName(String internalName) { + this.internalName = internalName; + return this; + } + + /** + * Get the toBeExportedForShoebox property: A Boolean flag indicating whether this dimension should be included for + * the shoebox export scenario. + * + * @return the toBeExportedForShoebox value. + */ + public Boolean toBeExportedForShoebox() { + return this.toBeExportedForShoebox; + } + + /** + * Set the toBeExportedForShoebox property: A Boolean flag indicating whether this dimension should be included for + * the shoebox export scenario. + * + * @param toBeExportedForShoebox the toBeExportedForShoebox value to set. + * @return the Dimension object itself. + */ + public Dimension withToBeExportedForShoebox(Boolean toBeExportedForShoebox) { + this.toBeExportedForShoebox = toBeExportedForShoebox; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/FeatureFlags.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/FeatureFlags.java new file mode 100644 index 0000000000000..d1be2d452deca --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/FeatureFlags.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for FeatureFlags. */ +public final class FeatureFlags extends ExpandableStringEnum { + /** Static value ServiceMode for FeatureFlags. */ + public static final FeatureFlags SERVICE_MODE = fromString("ServiceMode"); + + /** Static value EnableConnectivityLogs for FeatureFlags. */ + public static final FeatureFlags ENABLE_CONNECTIVITY_LOGS = fromString("EnableConnectivityLogs"); + + /** Static value EnableMessagingLogs for FeatureFlags. */ + public static final FeatureFlags ENABLE_MESSAGING_LOGS = fromString("EnableMessagingLogs"); + + /** + * Creates or finds a FeatureFlags from its string representation. + * + * @param name a name to look for. + * @return the corresponding FeatureFlags. + */ + @JsonCreator + public static FeatureFlags fromString(String name) { + return fromString(name, FeatureFlags.class); + } + + /** @return known FeatureFlags values. */ + public static Collection values() { + return values(FeatureFlags.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/KeyType.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/KeyType.java new file mode 100644 index 0000000000000..f29463be88ca6 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/KeyType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for KeyType. */ +public final class KeyType extends ExpandableStringEnum { + /** Static value Primary for KeyType. */ + public static final KeyType PRIMARY = fromString("Primary"); + + /** Static value Secondary for KeyType. */ + public static final KeyType SECONDARY = fromString("Secondary"); + + /** + * Creates or finds a KeyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyType. + */ + @JsonCreator + public static KeyType fromString(String name) { + return fromString(name, KeyType.class); + } + + /** @return known KeyType values. */ + public static Collection values() { + return values(KeyType.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/LogSpecification.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/LogSpecification.java new file mode 100644 index 0000000000000..f0796e4fdc568 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/LogSpecification.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Specifications of the Logs for Azure Monitoring. */ +@Fluent +public final class LogSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogSpecification.class); + + /* + * Name of the log. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the log. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name property: Name of the log. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the log. + * + * @param name the name value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the log. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the log. + * + * @param displayName the displayName value to set. + * @return the LogSpecification object itself. + */ + public LogSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentity.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentity.java new file mode 100644 index 0000000000000..9563f5526c8fd --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentity.java @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** A class represent managed identities used for request and response. */ +@Fluent +public class ManagedIdentity { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentity.class); + + /* + * Represent the identity type: systemAssigned, userAssigned, None + */ + @JsonProperty(value = "type") + private ManagedIdentityType type; + + /* + * Get or set the user assigned identities + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /* + * Get the principal id for the system assigned identity. + * Only be used in response. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * Get the tenant id for the system assigned identity. + * Only be used in response + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * Get the type property: Represent the identity type: systemAssigned, userAssigned, None. + * + * @return the type value. + */ + public ManagedIdentityType type() { + return this.type; + } + + /** + * Set the type property: Represent the identity type: systemAssigned, userAssigned, None. + * + * @param type the type value to set. + * @return the ManagedIdentity object itself. + */ + public ManagedIdentity withType(ManagedIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the userAssignedIdentities property: Get or set the user assigned identities. + * + * @return the userAssignedIdentities value. + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the userAssignedIdentities property: Get or set the user assigned identities. + * + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedIdentity object itself. + */ + public ManagedIdentity withUserAssignedIdentities( + Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + + /** + * Get the principalId property: Get the principal id for the system assigned identity. Only be used in response. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenantId property: Get the tenant id for the system assigned identity. Only be used in response. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (userAssignedIdentities() != null) { + userAssignedIdentities() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentitySettings.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentitySettings.java new file mode 100644 index 0000000000000..21ad9d7911fa6 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentitySettings.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Managed identity settings for upstream. */ +@Fluent +public final class ManagedIdentitySettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedIdentitySettings.class); + + /* + * The Resource indicating the App ID URI of the target resource. + * It also appears in the aud (audience) claim of the issued token. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Get the resource property: The Resource indicating the App ID URI of the target resource. It also appears in the + * aud (audience) claim of the issued token. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: The Resource indicating the App ID URI of the target resource. It also appears in the + * aud (audience) claim of the issued token. + * + * @param resource the resource value to set. + * @return the ManagedIdentitySettings object itself. + */ + public ManagedIdentitySettings withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentityType.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentityType.java new file mode 100644 index 0000000000000..08c919d1d311f --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ManagedIdentityType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ManagedIdentityType. */ +public final class ManagedIdentityType extends ExpandableStringEnum { + /** Static value None for ManagedIdentityType. */ + public static final ManagedIdentityType NONE = fromString("None"); + + /** Static value SystemAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** Static value UserAssigned for ManagedIdentityType. */ + public static final ManagedIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Creates or finds a ManagedIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedIdentityType. + */ + @JsonCreator + public static ManagedIdentityType fromString(String name) { + return fromString(name, ManagedIdentityType.class); + } + + /** @return known ManagedIdentityType values. */ + public static Collection values() { + return values(ManagedIdentityType.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/MetricSpecification.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/MetricSpecification.java new file mode 100644 index 0000000000000..74d74dbef2dd6 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/MetricSpecification.java @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Specifications of the Metrics for Azure Monitoring. */ +@Fluent +public final class MetricSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MetricSpecification.class); + + /* + * Name of the metric. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Localized friendly display name of the metric. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * Localized friendly description of the metric. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /* + * The unit that makes sense for the metric. + */ + @JsonProperty(value = "unit") + private String unit; + + /* + * Only provide one value for this field. Valid values: Average, Minimum, + * Maximum, Total, Count. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /* + * Optional. If set to true, then zero will be returned for time duration + * where no metric is emitted/published. + * Ex. a metric that returns the number of times a particular error code + * was emitted. The error code may not appear + * often, instead of the RP publishing 0, Shoebox can auto fill in 0s for + * time periods where nothing was emitted. + */ + @JsonProperty(value = "fillGapWithZero") + private String fillGapWithZero; + + /* + * The name of the metric category that the metric belongs to. A metric can + * only belong to a single category. + */ + @JsonProperty(value = "category") + private String category; + + /* + * The dimensions of the metrics. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Get the name property: Name of the metric. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the metric. + * + * @param name the name value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withName(String name) { + this.name = name; + return this; + } + + /** + * Get the displayName property: Localized friendly display name of the metric. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized friendly display name of the metric. + * + * @param displayName the displayName value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the displayDescription property: Localized friendly description of the metric. + * + * @return the displayDescription value. + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set the displayDescription property: Localized friendly description of the metric. + * + * @param displayDescription the displayDescription value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get the unit property: The unit that makes sense for the metric. + * + * @return the unit value. + */ + public String unit() { + return this.unit; + } + + /** + * Set the unit property: The unit that makes sense for the metric. + * + * @param unit the unit value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @return the aggregationType value. + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set the aggregationType property: Only provide one value for this field. Valid values: Average, Minimum, Maximum, + * Total, Count. + * + * @param aggregationType the aggregationType value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. Ex. a metric that returns the number of times a particular error code was emitted. + * The error code may not appear often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods + * where nothing was emitted. + * + * @return the fillGapWithZero value. + */ + public String fillGapWithZero() { + return this.fillGapWithZero; + } + + /** + * Set the fillGapWithZero property: Optional. If set to true, then zero will be returned for time duration where no + * metric is emitted/published. Ex. a metric that returns the number of times a particular error code was emitted. + * The error code may not appear often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods + * where nothing was emitted. + * + * @param fillGapWithZero the fillGapWithZero value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withFillGapWithZero(String fillGapWithZero) { + this.fillGapWithZero = fillGapWithZero; + return this; + } + + /** + * Get the category property: The name of the metric category that the metric belongs to. A metric can only belong + * to a single category. + * + * @return the category value. + */ + public String category() { + return this.category; + } + + /** + * Set the category property: The name of the metric category that the metric belongs to. A metric can only belong + * to a single category. + * + * @param category the category value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get the dimensions property: The dimensions of the metrics. + * + * @return the dimensions value. + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions property: The dimensions of the metrics. + * + * @param dimensions the dimensions value to set. + * @return the MetricSpecification object itself. + */ + public MetricSpecification withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (dimensions() != null) { + dimensions().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NameAvailability.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NameAvailability.java new file mode 100644 index 0000000000000..ef5c3f0637729 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NameAvailability.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.resourcemanager.signalr.fluent.models.NameAvailabilityInner; + +/** An immutable client-side representation of NameAvailability. */ +public interface NameAvailability { + /** + * Gets the nameAvailable property: Indicates whether the name is available or not. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason of the availability. Required if name is not available. + * + * @return the reason value. + */ + String reason(); + + /** + * Gets the message property: The message of the operation. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.signalr.fluent.models.NameAvailabilityInner object. + * + * @return the inner object. + */ + NameAvailabilityInner innerModel(); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NameAvailabilityParameters.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NameAvailabilityParameters.java new file mode 100644 index 0000000000000..c33be26f9a9e2 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NameAvailabilityParameters.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data POST-ed to the nameAvailability action. */ +@Fluent +public final class NameAvailabilityParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NameAvailabilityParameters.class); + + /* + * The resource type. Should be always "Microsoft.SignalRService/SignalR". + */ + @JsonProperty(value = "type", required = true) + private String type; + + /* + * The SignalR service name to validate. e.g."my-signalR-name-here" + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the type property: The resource type. Should be always "Microsoft.SignalRService/SignalR". + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type. Should be always "Microsoft.SignalRService/SignalR". + * + * @param type the type value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name property: The SignalR service name to validate. e.g."my-signalR-name-here". + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The SignalR service name to validate. e.g."my-signalR-name-here". + * + * @param name the name value to set. + * @return the NameAvailabilityParameters object itself. + */ + public NameAvailabilityParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (type() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property type in model NameAvailabilityParameters")); + } + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model NameAvailabilityParameters")); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NetworkAcl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NetworkAcl.java new file mode 100644 index 0000000000000..4e9ee934f5624 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/NetworkAcl.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network ACL. */ +@Fluent +public class NetworkAcl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(NetworkAcl.class); + + /* + * Allowed request types. The value can be one or more of: + * ClientConnection, ServerConnection, RESTAPI. + */ + @JsonProperty(value = "allow") + private List allow; + + /* + * Denied request types. The value can be one or more of: ClientConnection, + * ServerConnection, RESTAPI. + */ + @JsonProperty(value = "deny") + private List deny; + + /** + * Get the allow property: Allowed request types. The value can be one or more of: ClientConnection, + * ServerConnection, RESTAPI. + * + * @return the allow value. + */ + public List allow() { + return this.allow; + } + + /** + * Set the allow property: Allowed request types. The value can be one or more of: ClientConnection, + * ServerConnection, RESTAPI. + * + * @param allow the allow value to set. + * @return the NetworkAcl object itself. + */ + public NetworkAcl withAllow(List allow) { + this.allow = allow; + return this; + } + + /** + * Get the deny property: Denied request types. The value can be one or more of: ClientConnection, ServerConnection, + * RESTAPI. + * + * @return the deny value. + */ + public List deny() { + return this.deny; + } + + /** + * Set the deny property: Denied request types. The value can be one or more of: ClientConnection, ServerConnection, + * RESTAPI. + * + * @param deny the deny value to set. + * @return the NetworkAcl object itself. + */ + public NetworkAcl withDeny(List deny) { + this.deny = deny; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Operation.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Operation.java new file mode 100644 index 0000000000000..f450dba11b80e --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Operation.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.resourcemanager.signalr.fluent.models.OperationInner; + +/** An immutable client-side representation of Operation. */ +public interface Operation { + /** + * Gets the name property: Name of the operation with format: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: If the operation is a data action. (for data plane rbac). + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: The object that describes the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Optional. The intended executor of the operation; governs the display of the operation + * in the RBAC UX and the audit logs UX. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the properties property: Extra properties for the operation. + * + * @return the properties value. + */ + OperationProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.signalr.fluent.models.OperationInner object. + * + * @return the inner object. + */ + OperationInner innerModel(); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationDisplay.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationDisplay.java new file mode 100644 index 0000000000000..f7b6d72d5ee31 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The object that describes a operation. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Friendly name of the resource provider + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource type on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * The localized friendly name for the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * The localized friendly description for the operation + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Friendly name of the resource provider. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Friendly name of the resource provider. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource type on which the operation is performed. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource type on which the operation is performed. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: The localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: The localized friendly name for the operation. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: The localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The localized friendly description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationList.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationList.java new file mode 100644 index 0000000000000..49bdda6dc2838 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationList.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.models.OperationInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Result of the request to list REST API operations. It contains a list of operations. */ +@Fluent +public final class OperationList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); + + /* + * List of operations supported by the resource provider. + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL the client should use to fetch the next page (per server side + * paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of operations supported by the resource provider. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of operations supported by the resource provider. + * + * @param value the value value to set. + * @return the OperationList object itself. + */ + public OperationList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). It's + * null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). It's + * null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the OperationList object itself. + */ + public OperationList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationProperties.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationProperties.java new file mode 100644 index 0000000000000..8d5fb2a74040b --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/OperationProperties.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Extra Operation properties. */ +@Fluent +public final class OperationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationProperties.class); + + /* + * The service specifications. + */ + @JsonProperty(value = "serviceSpecification") + private ServiceSpecification serviceSpecification; + + /** + * Get the serviceSpecification property: The service specifications. + * + * @return the serviceSpecification value. + */ + public ServiceSpecification serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the serviceSpecification property: The service specifications. + * + * @param serviceSpecification the serviceSpecification value to set. + * @return the OperationProperties object itself. + */ + public OperationProperties withServiceSpecification(ServiceSpecification serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceSpecification() != null) { + serviceSpecification().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Operations.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Operations.java new file mode 100644 index 0000000000000..76c7091bf237c --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Operations.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + PagedIterable list(); + + /** + * Lists all of the available REST API operations of the Microsoft.SignalRService 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 REST API operations. + */ + PagedIterable list(Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpoint.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpoint.java new file mode 100644 index 0000000000000..f8e1ed354c8f2 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpoint.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Private endpoint. */ +@Fluent +public final class PrivateEndpoint { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpoint.class); + + /* + * Full qualified Id of the private endpoint + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the id property: Full qualified Id of the private endpoint. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Full qualified Id of the private endpoint. + * + * @param id the id value to set. + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpointAcl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpointAcl.java new file mode 100644 index 0000000000000..ba4b654787e9d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpointAcl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** ACL for a private endpoint. */ +@Fluent +public final class PrivateEndpointAcl extends NetworkAcl { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointAcl.class); + + /* + * Name of the private endpoint connection + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the name property: Name of the private endpoint connection. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the private endpoint connection. + * + * @param name the name value to set. + * @return the PrivateEndpointAcl object itself. + */ + public PrivateEndpointAcl withName(String name) { + this.name = name; + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointAcl withAllow(List allow) { + super.withAllow(allow); + return this; + } + + /** {@inheritDoc} */ + @Override + public PrivateEndpointAcl withDeny(List deny) { + super.withDeny(deny); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model PrivateEndpointAcl")); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpointConnection.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpointConnection.java new file mode 100644 index 0000000000000..4d7de52f295a8 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateEndpointConnection.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.resourcemanager.signalr.fluent.models.PrivateEndpointConnectionInner; + +/** An immutable client-side representation of PrivateEndpointConnection. */ +public interface PrivateEndpointConnection { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the provisioningState property: Provisioning state of the private endpoint connection. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the privateEndpoint property: Private endpoint associated with the private endpoint connection. + * + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * Gets the privateLinkServiceConnectionState property: Connection state. + * + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * Gets the inner com.azure.resourcemanager.signalr.fluent.models.PrivateEndpointConnectionInner object. + * + * @return the inner object. + */ + PrivateEndpointConnectionInner innerModel(); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkResource.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkResource.java new file mode 100644 index 0000000000000..e32be4e986ea0 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkResource.java @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.resourcemanager.signalr.fluent.models.PrivateLinkResourceInner; +import java.util.List; + +/** 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 groupId property: Group Id of the private link resource. + * + * @return the groupId value. + */ + String groupId(); + + /** + * Gets the requiredMembers property: Required members of the private link resource. + * + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * Gets the requiredZoneNames property: Required private DNS zone names. + * + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * Gets the inner com.azure.resourcemanager.signalr.fluent.models.PrivateLinkResourceInner object. + * + * @return the inner object. + */ + PrivateLinkResourceInner innerModel(); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkResourceList.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkResourceList.java new file mode 100644 index 0000000000000..c5a61d1c4e693 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkResourceList.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.models.PrivateLinkResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Contains a list of AzSignalR.Models.Response.PrivateLink.PrivateLinkResource and a possible link to query more + * results. + */ +@Fluent +public final class PrivateLinkResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkResourceList.class); + + /* + * List of PrivateLinkResource + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL the client should use to fetch the next page (per server side + * paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of PrivateLinkResource. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of PrivateLinkResource. + * + * @param value the value value to set. + * @return the PrivateLinkResourceList object itself. + */ + public PrivateLinkResourceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). It's + * null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). It's + * null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the PrivateLinkResourceList object itself. + */ + public PrivateLinkResourceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkServiceConnectionState.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkServiceConnectionState.java new file mode 100644 index 0000000000000..7118e7da2984a --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkServiceConnectionState.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Connection state of the private endpoint connection. */ +@Fluent +public final class PrivateLinkServiceConnectionState { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateLinkServiceConnectionState.class); + + /* + * Indicates whether the connection has been Approved/Rejected/Removed by + * the owner of the service. + */ + @JsonProperty(value = "status") + private PrivateLinkServiceConnectionStatus status; + + /* + * The reason for approval/rejection of the connection. + */ + @JsonProperty(value = "description") + private String description; + + /* + * A message indicating if changes on the service provider require any + * updates on the consumer. + */ + @JsonProperty(value = "actionsRequired") + private String actionsRequired; + + /** + * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @return the status value. + */ + public PrivateLinkServiceConnectionStatus status() { + return this.status; + } + + /** + * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the + * service. + * + * @param status the status value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(PrivateLinkServiceConnectionStatus status) { + this.status = status; + return this; + } + + /** + * Get the description property: The reason for approval/rejection of the connection. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The reason for approval/rejection of the connection. + * + * @param description the description value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @return the actionsRequired value. + */ + public String actionsRequired() { + return this.actionsRequired; + } + + /** + * Set the actionsRequired property: A message indicating if changes on the service provider require any updates on + * the consumer. + * + * @param actionsRequired the actionsRequired value to set. + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(String actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkServiceConnectionStatus.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkServiceConnectionStatus.java new file mode 100644 index 0000000000000..46f73beee8b66 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/PrivateLinkServiceConnectionStatus.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateLinkServiceConnectionStatus. */ +public final class PrivateLinkServiceConnectionStatus extends ExpandableStringEnum { + /** Static value Pending for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus PENDING = fromString("Pending"); + + /** Static value Approved for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus APPROVED = fromString("Approved"); + + /** Static value Rejected for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus REJECTED = fromString("Rejected"); + + /** Static value Disconnected for PrivateLinkServiceConnectionStatus. */ + public static final PrivateLinkServiceConnectionStatus DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a PrivateLinkServiceConnectionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateLinkServiceConnectionStatus. + */ + @JsonCreator + public static PrivateLinkServiceConnectionStatus fromString(String name) { + return fromString(name, PrivateLinkServiceConnectionStatus.class); + } + + /** @return known PrivateLinkServiceConnectionStatus values. */ + public static Collection values() { + return values(PrivateLinkServiceConnectionStatus.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ProvisioningState.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ProvisioningState.java new file mode 100644 index 0000000000000..20e09fe695130 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ProvisioningState.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ProvisioningState. */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Unknown for ProvisioningState. */ + public static final ProvisioningState UNKNOWN = fromString("Unknown"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Running for ProvisioningState. */ + public static final ProvisioningState RUNNING = fromString("Running"); + + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Moving for ProvisioningState. */ + public static final ProvisioningState MOVING = fromString("Moving"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProvisioningState. + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** @return known ProvisioningState values. */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/RegenerateKeyParameters.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/RegenerateKeyParameters.java new file mode 100644 index 0000000000000..026ab55c3175d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/RegenerateKeyParameters.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Parameters describes the request to regenerate access keys. */ +@Fluent +public final class RegenerateKeyParameters { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegenerateKeyParameters.class); + + /* + * The keyType to regenerate. Must be either 'primary' or + * 'secondary'(case-insensitive). + */ + @JsonProperty(value = "keyType") + private KeyType keyType; + + /** + * Get the keyType property: The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). + * + * @return the keyType value. + */ + public KeyType keyType() { + return this.keyType; + } + + /** + * Set the keyType property: The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). + * + * @param keyType the keyType value to set. + * @return the RegenerateKeyParameters object itself. + */ + public RegenerateKeyParameters withKeyType(KeyType keyType) { + this.keyType = keyType; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ResourceSku.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ResourceSku.java new file mode 100644 index 0000000000000..55801e90b935a --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ResourceSku.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The billing information of the SignalR resource. */ +@Fluent +public final class ResourceSku { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceSku.class); + + /* + * The name of the SKU. Required. + * + * Allowed values: Standard_S1, Free_F1 + */ + @JsonProperty(value = "name", required = true) + private String name; + + /* + * Optional tier of this particular SKU. 'Standard' or 'Free'. + * + * `Basic` is deprecated, use `Standard` instead. + */ + @JsonProperty(value = "tier") + private SignalRSkuTier tier; + + /* + * Optional string. For future use. + */ + @JsonProperty(value = "size") + private String size; + + /* + * Optional string. For future use. + */ + @JsonProperty(value = "family") + private String family; + + /* + * Optional, integer. The unit count of SignalR resource. 1 by default. + * + * If present, following values are allowed: + * Free: 1 + * Standard: 1,2,5,10,20,50,100 + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Get the name property: The name of the SKU. Required. + * + *

Allowed values: Standard_S1, Free_F1. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the SKU. Required. + * + *

Allowed values: Standard_S1, Free_F1. + * + * @param name the name value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tier property: Optional tier of this particular SKU. 'Standard' or 'Free'. + * + *

`Basic` is deprecated, use `Standard` instead. + * + * @return the tier value. + */ + public SignalRSkuTier tier() { + return this.tier; + } + + /** + * Set the tier property: Optional tier of this particular SKU. 'Standard' or 'Free'. + * + *

`Basic` is deprecated, use `Standard` instead. + * + * @param tier the tier value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withTier(SignalRSkuTier tier) { + this.tier = tier; + return this; + } + + /** + * Get the size property: Optional string. For future use. + * + * @return the size value. + */ + public String size() { + return this.size; + } + + /** + * Set the size property: Optional string. For future use. + * + * @param size the size value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withSize(String size) { + this.size = size; + return this; + } + + /** + * Get the family property: Optional string. For future use. + * + * @return the family value. + */ + public String family() { + return this.family; + } + + /** + * Set the family property: Optional string. For future use. + * + * @param family the family value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withFamily(String family) { + this.family = family; + return this; + } + + /** + * Get the capacity property: Optional, integer. The unit count of SignalR resource. 1 by default. + * + *

If present, following values are allowed: Free: 1 Standard: 1,2,5,10,20,50,100. + * + * @return the capacity value. + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity property: Optional, integer. The unit count of SignalR resource. 1 by default. + * + *

If present, following values are allowed: Free: 1 Standard: 1,2,5,10,20,50,100. + * + * @param capacity the capacity value to set. + * @return the ResourceSku object itself. + */ + public ResourceSku withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property name in model ResourceSku")); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServerlessUpstreamSettings.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServerlessUpstreamSettings.java new file mode 100644 index 0000000000000..aadd9076aa271 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServerlessUpstreamSettings.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The settings for the Upstream when the Azure SignalR is in server-less mode. */ +@Fluent +public final class ServerlessUpstreamSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServerlessUpstreamSettings.class); + + /* + * Gets or sets the list of Upstream URL templates. Order matters, and the + * first matching template takes effects. + */ + @JsonProperty(value = "templates") + private List templates; + + /** + * Get the templates property: Gets or sets the list of Upstream URL templates. Order matters, and the first + * matching template takes effects. + * + * @return the templates value. + */ + public List templates() { + return this.templates; + } + + /** + * Set the templates property: Gets or sets the list of Upstream URL templates. Order matters, and the first + * matching template takes effects. + * + * @param templates the templates value to set. + * @return the ServerlessUpstreamSettings object itself. + */ + public ServerlessUpstreamSettings withTemplates(List templates) { + this.templates = templates; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (templates() != null) { + templates().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServiceKind.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServiceKind.java new file mode 100644 index 0000000000000..73b85ddb89bd3 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServiceKind.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ServiceKind. */ +public final class ServiceKind extends ExpandableStringEnum { + /** Static value SignalR for ServiceKind. */ + public static final ServiceKind SIGNALR = fromString("SignalR"); + + /** Static value RawWebSockets for ServiceKind. */ + public static final ServiceKind RAW_WEB_SOCKETS = fromString("RawWebSockets"); + + /** + * Creates or finds a ServiceKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding ServiceKind. + */ + @JsonCreator + public static ServiceKind fromString(String name) { + return fromString(name, ServiceKind.class); + } + + /** @return known ServiceKind values. */ + public static Collection values() { + return values(ServiceKind.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServiceSpecification.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServiceSpecification.java new file mode 100644 index 0000000000000..8f051849ce813 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/ServiceSpecification.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** An object that describes a specification. */ +@Fluent +public final class ServiceSpecification { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceSpecification.class); + + /* + * Specifications of the Metrics for Azure Monitoring. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /* + * Specifications of the Logs for Azure Monitoring. + */ + @JsonProperty(value = "logSpecifications") + private List logSpecifications; + + /** + * Get the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @return the metricSpecifications value. + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set the metricSpecifications property: Specifications of the Metrics for Azure Monitoring. + * + * @param metricSpecifications the metricSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + + /** + * Get the logSpecifications property: Specifications of the Logs for Azure Monitoring. + * + * @return the logSpecifications value. + */ + public List logSpecifications() { + return this.logSpecifications; + } + + /** + * Set the logSpecifications property: Specifications of the Logs for Azure Monitoring. + * + * @param logSpecifications the logSpecifications value to set. + * @return the ServiceSpecification object itself. + */ + public ServiceSpecification withLogSpecifications(List logSpecifications) { + this.logSpecifications = logSpecifications; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (metricSpecifications() != null) { + metricSpecifications().forEach(e -> e.validate()); + } + if (logSpecifications() != null) { + logSpecifications().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRCorsSettings.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRCorsSettings.java new file mode 100644 index 0000000000000..d7323b4485132 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRCorsSettings.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Cross-Origin Resource Sharing (CORS) settings. */ +@Fluent +public final class SignalRCorsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRCorsSettings.class); + + /* + * Gets or sets the list of origins that should be allowed to make + * cross-origin calls (for example: http://example.com:12345). Use "*" to + * allow all. If omitted, allow all by default. + */ + @JsonProperty(value = "allowedOrigins") + private List allowedOrigins; + + /** + * Get the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. If omitted, allow all by default. + * + * @return the allowedOrigins value. + */ + public List allowedOrigins() { + return this.allowedOrigins; + } + + /** + * Set the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. If omitted, allow all by default. + * + * @param allowedOrigins the allowedOrigins value to set. + * @return the SignalRCorsSettings object itself. + */ + public SignalRCorsSettings withAllowedOrigins(List allowedOrigins) { + this.allowedOrigins = allowedOrigins; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRCreateOrUpdateProperties.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRCreateOrUpdateProperties.java new file mode 100644 index 0000000000000..8ffcb51bb5bdb --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRCreateOrUpdateProperties.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Settings used to provision or configure the resource. */ +@Fluent +public class SignalRCreateOrUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRCreateOrUpdateProperties.class); + + /* + * List of SignalR featureFlags. e.g. ServiceMode. + * + * FeatureFlags that are not included in the parameters for the update + * operation will not be modified. + * And the response will only include featureFlags that are explicitly set. + * When a featureFlag is not explicitly set, SignalR service will use its + * globally default value. + * But keep in mind, the default value doesn't mean "false". It varies in + * terms of different FeatureFlags. + */ + @JsonProperty(value = "features") + private List features; + + /* + * Cross-Origin Resource Sharing (CORS) settings. + */ + @JsonProperty(value = "cors") + private SignalRCorsSettings cors; + + /* + * Upstream settings when the Azure SignalR is in server-less mode. + */ + @JsonProperty(value = "upstream") + private ServerlessUpstreamSettings upstream; + + /* + * Network ACLs + */ + @JsonProperty(value = "networkACLs") + private SignalRNetworkACLs networkACLs; + + /** + * Get the features property: List of SignalR featureFlags. e.g. ServiceMode. + * + *

FeatureFlags that are not included in the parameters for the update operation will not be modified. And the + * response will only include featureFlags that are explicitly set. When a featureFlag is not explicitly set, + * SignalR service will use its globally default value. But keep in mind, the default value doesn't mean "false". It + * varies in terms of different FeatureFlags. + * + * @return the features value. + */ + public List features() { + return this.features; + } + + /** + * Set the features property: List of SignalR featureFlags. e.g. ServiceMode. + * + *

FeatureFlags that are not included in the parameters for the update operation will not be modified. And the + * response will only include featureFlags that are explicitly set. When a featureFlag is not explicitly set, + * SignalR service will use its globally default value. But keep in mind, the default value doesn't mean "false". It + * varies in terms of different FeatureFlags. + * + * @param features the features value to set. + * @return the SignalRCreateOrUpdateProperties object itself. + */ + public SignalRCreateOrUpdateProperties withFeatures(List features) { + this.features = features; + return this; + } + + /** + * Get the cors property: Cross-Origin Resource Sharing (CORS) settings. + * + * @return the cors value. + */ + public SignalRCorsSettings cors() { + return this.cors; + } + + /** + * Set the cors property: Cross-Origin Resource Sharing (CORS) settings. + * + * @param cors the cors value to set. + * @return the SignalRCreateOrUpdateProperties object itself. + */ + public SignalRCreateOrUpdateProperties withCors(SignalRCorsSettings cors) { + this.cors = cors; + return this; + } + + /** + * Get the upstream property: Upstream settings when the Azure SignalR is in server-less mode. + * + * @return the upstream value. + */ + public ServerlessUpstreamSettings upstream() { + return this.upstream; + } + + /** + * Set the upstream property: Upstream settings when the Azure SignalR is in server-less mode. + * + * @param upstream the upstream value to set. + * @return the SignalRCreateOrUpdateProperties object itself. + */ + public SignalRCreateOrUpdateProperties withUpstream(ServerlessUpstreamSettings upstream) { + this.upstream = upstream; + return this; + } + + /** + * Get the networkACLs property: Network ACLs. + * + * @return the networkACLs value. + */ + public SignalRNetworkACLs networkACLs() { + return this.networkACLs; + } + + /** + * Set the networkACLs property: Network ACLs. + * + * @param networkACLs the networkACLs value to set. + * @return the SignalRCreateOrUpdateProperties object itself. + */ + public SignalRCreateOrUpdateProperties withNetworkACLs(SignalRNetworkACLs networkACLs) { + this.networkACLs = networkACLs; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (features() != null) { + features().forEach(e -> e.validate()); + } + if (cors() != null) { + cors().validate(); + } + if (upstream() != null) { + upstream().validate(); + } + if (networkACLs() != null) { + networkACLs().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRFeature.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRFeature.java new file mode 100644 index 0000000000000..c09d2f29b8d12 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRFeature.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Feature of a SignalR resource, which controls the SignalR runtime behavior. */ +@Fluent +public final class SignalRFeature { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRFeature.class); + + /* + * FeatureFlags is the supported features of Azure SignalR service. + * - ServiceMode: Flag for backend server for SignalR service. Values + * allowed: "Default": have your own backend server; "Serverless": your + * application doesn't have a backend server; "Classic": for backward + * compatibility. Support both Default and Serverless mode but not + * recommended; "PredefinedOnly": for future use. + * - EnableConnectivityLogs: "true"/"false", to enable/disable the + * connectivity log category respectively. + */ + @JsonProperty(value = "flag", required = true) + private FeatureFlags flag; + + /* + * Value of the feature flag. See Azure SignalR service document + * https://docs.microsoft.com/azure/azure-signalr/ for allowed values. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /* + * Optional properties related to this feature. + */ + @JsonProperty(value = "properties") + private Map properties; + + /** + * Get the flag property: FeatureFlags is the supported features of Azure SignalR service. - ServiceMode: Flag for + * backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your + * application doesn't have a backend server; "Classic": for backward compatibility. Support both Default and + * Serverless mode but not recommended; "PredefinedOnly": for future use. - EnableConnectivityLogs: "true"/"false", + * to enable/disable the connectivity log category respectively. + * + * @return the flag value. + */ + public FeatureFlags flag() { + return this.flag; + } + + /** + * Set the flag property: FeatureFlags is the supported features of Azure SignalR service. - ServiceMode: Flag for + * backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your + * application doesn't have a backend server; "Classic": for backward compatibility. Support both Default and + * Serverless mode but not recommended; "PredefinedOnly": for future use. - EnableConnectivityLogs: "true"/"false", + * to enable/disable the connectivity log category respectively. + * + * @param flag the flag value to set. + * @return the SignalRFeature object itself. + */ + public SignalRFeature withFlag(FeatureFlags flag) { + this.flag = flag; + return this; + } + + /** + * Get the value property: Value of the feature flag. See Azure SignalR service document + * https://docs.microsoft.com/azure/azure-signalr/ for allowed values. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Value of the feature flag. See Azure SignalR service document + * https://docs.microsoft.com/azure/azure-signalr/ for allowed values. + * + * @param value the value value to set. + * @return the SignalRFeature object itself. + */ + public SignalRFeature withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the properties property: Optional properties related to this feature. + * + * @return the properties value. + */ + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: Optional properties related to this feature. + * + * @param properties the properties value to set. + * @return the SignalRFeature object itself. + */ + public SignalRFeature withProperties(Map properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (flag() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property flag in model SignalRFeature")); + } + if (value() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property value in model SignalRFeature")); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRKeys.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRKeys.java new file mode 100644 index 0000000000000..0d5d1dde0137b --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRKeys.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.resourcemanager.signalr.fluent.models.SignalRKeysInner; + +/** An immutable client-side representation of SignalRKeys. */ +public interface SignalRKeys { + /** + * Gets the primaryKey property: The primary access key. + * + * @return the primaryKey value. + */ + String primaryKey(); + + /** + * Gets the secondaryKey property: The secondary access key. + * + * @return the secondaryKey value. + */ + String secondaryKey(); + + /** + * Gets the primaryConnectionString property: SignalR connection string constructed via the primaryKey. + * + * @return the primaryConnectionString value. + */ + String primaryConnectionString(); + + /** + * Gets the secondaryConnectionString property: SignalR connection string constructed via the secondaryKey. + * + * @return the secondaryConnectionString value. + */ + String secondaryConnectionString(); + + /** + * Gets the inner com.azure.resourcemanager.signalr.fluent.models.SignalRKeysInner object. + * + * @return the inner object. + */ + SignalRKeysInner innerModel(); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRNetworkACLs.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRNetworkACLs.java new file mode 100644 index 0000000000000..a4ad9810407b6 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRNetworkACLs.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Network ACLs for SignalR. */ +@Fluent +public final class SignalRNetworkACLs { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRNetworkACLs.class); + + /* + * Default action when no other rule matches + */ + @JsonProperty(value = "defaultAction") + private AclAction defaultAction; + + /* + * ACL for requests from public network + */ + @JsonProperty(value = "publicNetwork") + private NetworkAcl publicNetwork; + + /* + * ACLs for requests from private endpoints + */ + @JsonProperty(value = "privateEndpoints") + private List privateEndpoints; + + /** + * Get the defaultAction property: Default action when no other rule matches. + * + * @return the defaultAction value. + */ + public AclAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the defaultAction property: Default action when no other rule matches. + * + * @param defaultAction the defaultAction value to set. + * @return the SignalRNetworkACLs object itself. + */ + public SignalRNetworkACLs withDefaultAction(AclAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the publicNetwork property: ACL for requests from public network. + * + * @return the publicNetwork value. + */ + public NetworkAcl publicNetwork() { + return this.publicNetwork; + } + + /** + * Set the publicNetwork property: ACL for requests from public network. + * + * @param publicNetwork the publicNetwork value to set. + * @return the SignalRNetworkACLs object itself. + */ + public SignalRNetworkACLs withPublicNetwork(NetworkAcl publicNetwork) { + this.publicNetwork = publicNetwork; + return this; + } + + /** + * Get the privateEndpoints property: ACLs for requests from private endpoints. + * + * @return the privateEndpoints value. + */ + public List privateEndpoints() { + return this.privateEndpoints; + } + + /** + * Set the privateEndpoints property: ACLs for requests from private endpoints. + * + * @param privateEndpoints the privateEndpoints value to set. + * @return the SignalRNetworkACLs object itself. + */ + public SignalRNetworkACLs withPrivateEndpoints(List privateEndpoints) { + this.privateEndpoints = privateEndpoints; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (publicNetwork() != null) { + publicNetwork().validate(); + } + if (privateEndpoints() != null) { + privateEndpoints().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRPrivateEndpointConnections.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRPrivateEndpointConnections.java new file mode 100644 index 0000000000000..3d4e05a13fbf3 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRPrivateEndpointConnections.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.signalr.fluent.models.PrivateEndpointConnectionInner; + +/** Resource collection API of SignalRPrivateEndpointConnections. */ +public interface SignalRPrivateEndpointConnections { + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + PrivateEndpointConnection get(String privateEndpointConnectionName, String resourceGroupName, String resourceName); + + /** + * Get the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 specified private endpoint connection associated with a SignalR resource. + */ + Response getWithResponse( + String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context); + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a private endpoint connection to SignalR resource. + */ + PrivateEndpointConnection update( + String privateEndpointConnectionName, String resourceGroupName, String resourceName); + + /** + * Update the state of specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters The resource of private endpoint and its properties. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 endpoint connection to SignalR resource. + */ + Response updateWithResponse( + String privateEndpointConnectionName, + String resourceGroupName, + String resourceName, + PrivateEndpointConnectionInner parameters, + Context context); + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName); + + /** + * Delete the specified private endpoint connection associated with a SignalR resource. + * + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the SignalR + * resource. + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + void delete(String privateEndpointConnectionName, String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRPrivateLinkResources.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRPrivateLinkResources.java new file mode 100644 index 0000000000000..bbf0711f48776 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRPrivateLinkResources.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of SignalRPrivateLinkResources. */ +public interface SignalRPrivateLinkResources { + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + PagedIterable list(String resourceGroupName, String resourceName); + + /** + * Get the private link resources that need to be created for a SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 private link resources that need to be created for a SignalR resource. + */ + PagedIterable list(String resourceGroupName, String resourceName, Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRProperties.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRProperties.java new file mode 100644 index 0000000000000..762f045000c24 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRProperties.java @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.models.PrivateEndpointConnectionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * A class that describes the properties of the SignalR service that should contain more read-only properties than + * AzSignalR.Models.SignalRCreateOrUpdateProperties. + */ +@Fluent +public final class SignalRProperties extends SignalRCreateOrUpdateProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRProperties.class); + + /* + * Provisioning state of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /* + * The publicly accessible IP of the SignalR service. + */ + @JsonProperty(value = "externalIP", access = JsonProperty.Access.WRITE_ONLY) + private String externalIp; + + /* + * FQDN of the SignalR service instance. Format: xxx.service.signalr.net + */ + @JsonProperty(value = "hostName", access = JsonProperty.Access.WRITE_ONLY) + private String hostname; + + /* + * The publicly accessible port of the SignalR service which is designed + * for browser/client side usage. + */ + @JsonProperty(value = "publicPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer publicPort; + + /* + * The publicly accessible port of the SignalR service which is designed + * for customer server side usage. + */ + @JsonProperty(value = "serverPort", access = JsonProperty.Access.WRITE_ONLY) + private Integer serverPort; + + /* + * Version of the SignalR resource. Probably you need the same or higher + * version of client SDKs. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /* + * Private endpoint connections to the SignalR resource. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /* + * TLS settings. + */ + @JsonProperty(value = "tls") + private SignalRTlsSettings tls; + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the externalIp property: The publicly accessible IP of the SignalR service. + * + * @return the externalIp value. + */ + public String externalIp() { + return this.externalIp; + } + + /** + * Get the hostname property: FQDN of the SignalR service instance. Format: xxx.service.signalr.net. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Get the publicPort property: The publicly accessible port of the SignalR service which is designed for + * browser/client side usage. + * + * @return the publicPort value. + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Get the serverPort property: The publicly accessible port of the SignalR service which is designed for customer + * server side usage. + * + * @return the serverPort value. + */ + public Integer serverPort() { + return this.serverPort; + } + + /** + * Get the version property: Version of the SignalR resource. Probably you need the same or higher version of client + * SDKs. + * + * @return the version value. + */ + public String version() { + return this.version; + } + + /** + * Get the privateEndpointConnections property: Private endpoint connections to the SignalR resource. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Get the tls property: TLS settings. + * + * @return the tls value. + */ + public SignalRTlsSettings tls() { + return this.tls; + } + + /** + * Set the tls property: TLS settings. + * + * @param tls the tls value to set. + * @return the SignalRProperties object itself. + */ + public SignalRProperties withTls(SignalRTlsSettings tls) { + this.tls = tls; + return this; + } + + /** {@inheritDoc} */ + @Override + public SignalRProperties withFeatures(List features) { + super.withFeatures(features); + return this; + } + + /** {@inheritDoc} */ + @Override + public SignalRProperties withCors(SignalRCorsSettings cors) { + super.withCors(cors); + return this; + } + + /** {@inheritDoc} */ + @Override + public SignalRProperties withUpstream(ServerlessUpstreamSettings upstream) { + super.withUpstream(upstream); + return this; + } + + /** {@inheritDoc} */ + @Override + public SignalRProperties withNetworkACLs(SignalRNetworkACLs networkACLs) { + super.withNetworkACLs(networkACLs); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + if (tls() != null) { + tls().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRRequestType.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRRequestType.java new file mode 100644 index 0000000000000..e5dcd10770604 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRRequestType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SignalRRequestType. */ +public final class SignalRRequestType extends ExpandableStringEnum { + /** Static value ClientConnection for SignalRRequestType. */ + public static final SignalRRequestType CLIENT_CONNECTION = fromString("ClientConnection"); + + /** Static value ServerConnection for SignalRRequestType. */ + public static final SignalRRequestType SERVER_CONNECTION = fromString("ServerConnection"); + + /** Static value RESTAPI for SignalRRequestType. */ + public static final SignalRRequestType RESTAPI = fromString("RESTAPI"); + + /** + * Creates or finds a SignalRRequestType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SignalRRequestType. + */ + @JsonCreator + public static SignalRRequestType fromString(String name) { + return fromString(name, SignalRRequestType.class); + } + + /** @return known SignalRRequestType values. */ + public static Collection values() { + return values(SignalRRequestType.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRResource.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRResource.java new file mode 100644 index 0000000000000..e9635e06aab43 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRResource.java @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.signalr.fluent.models.SignalRResourceInner; +import java.util.List; +import java.util.Map; + +/** An immutable client-side representation of SignalRResource. */ +public interface SignalRResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the sku property: The billing information of the resource.(e.g. Free, Standard). + * + * @return the sku value. + */ + ResourceSku sku(); + + /** + * Gets the kind property: The kind of the service - e.g. "SignalR", or "RawWebSockets" for + * "Microsoft.SignalRService/SignalR". + * + * @return the kind value. + */ + ServiceKind kind(); + + /** + * Gets the identity property: The managed identity response. + * + * @return the identity value. + */ + ManagedIdentity identity(); + + /** + * Gets the features property: List of SignalR featureFlags. e.g. ServiceMode. + * + *

FeatureFlags that are not included in the parameters for the update operation will not be modified. And the + * response will only include featureFlags that are explicitly set. When a featureFlag is not explicitly set, + * SignalR service will use its globally default value. But keep in mind, the default value doesn't mean "false". It + * varies in terms of different FeatureFlags. + * + * @return the features value. + */ + List features(); + + /** + * Gets the cors property: Cross-Origin Resource Sharing (CORS) settings. + * + * @return the cors value. + */ + SignalRCorsSettings cors(); + + /** + * Gets the upstream property: Upstream settings when the Azure SignalR is in server-less mode. + * + * @return the upstream value. + */ + ServerlessUpstreamSettings upstream(); + + /** + * Gets the networkACLs property: Network ACLs. + * + * @return the networkACLs value. + */ + SignalRNetworkACLs networkACLs(); + + /** + * Gets the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the externalIp property: The publicly accessible IP of the SignalR service. + * + * @return the externalIp value. + */ + String externalIp(); + + /** + * Gets the hostname property: FQDN of the SignalR service instance. Format: xxx.service.signalr.net. + * + * @return the hostname value. + */ + String hostname(); + + /** + * Gets the publicPort property: The publicly accessible port of the SignalR service which is designed for + * browser/client side usage. + * + * @return the publicPort value. + */ + Integer publicPort(); + + /** + * Gets the serverPort property: The publicly accessible port of the SignalR service which is designed for customer + * server side usage. + * + * @return the serverPort value. + */ + Integer serverPort(); + + /** + * Gets the version property: Version of the SignalR resource. Probably you need the same or higher version of + * client SDKs. + * + * @return the version value. + */ + String version(); + + /** + * Gets the privateEndpointConnections property: Private endpoint connections to the SignalR resource. + * + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * Gets the tls property: TLS settings. + * + * @return the tls value. + */ + SignalRTlsSettings tls(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.signalr.fluent.models.SignalRResourceInner object. + * + * @return the inner object. + */ + SignalRResourceInner innerModel(); + + /** The entirety of the SignalRResource definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The SignalRResource definition stages. */ + interface DefinitionStages { + /** The first stage of the SignalRResource definition. */ + interface Blank extends WithLocation { + } + /** The stage of the SignalRResource definition allowing to specify location. */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + /** The stage of the SignalRResource definition allowing to specify parent resource. */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this + * value from the Azure Resource Manager API or the portal. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + /** + * The stage of the SignalRResource 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.WithKind, + DefinitionStages.WithIdentity, + DefinitionStages.WithFeatures, + DefinitionStages.WithCors, + DefinitionStages.WithUpstream, + DefinitionStages.WithNetworkACLs, + DefinitionStages.WithTls { + /** + * Executes the create request. + * + * @return the created resource. + */ + SignalRResource create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SignalRResource create(Context context); + } + /** The stage of the SignalRResource definition allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + /** The stage of the SignalRResource definition allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The billing information of the resource.(e.g. Free, Standard). + * + * @param sku The billing information of the resource.(e.g. Free, Standard). + * @return the next definition stage. + */ + WithCreate withSku(ResourceSku sku); + } + /** The stage of the SignalRResource definition allowing to specify kind. */ + interface WithKind { + /** + * Specifies the kind property: The kind of the service - e.g. "SignalR", or "RawWebSockets" for + * "Microsoft.SignalRService/SignalR". + * + * @param kind The kind of the service - e.g. "SignalR", or "RawWebSockets" for + * "Microsoft.SignalRService/SignalR". + * @return the next definition stage. + */ + WithCreate withKind(ServiceKind kind); + } + /** The stage of the SignalRResource definition allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity response. + * + * @param identity The managed identity response. + * @return the next definition stage. + */ + WithCreate withIdentity(ManagedIdentity identity); + } + /** The stage of the SignalRResource definition allowing to specify features. */ + interface WithFeatures { + /** + * Specifies the features property: List of SignalR featureFlags. e.g. ServiceMode. + * + *

FeatureFlags that are not included in the parameters for the update operation will not be modified. + * And the response will only include featureFlags that are explicitly set. When a featureFlag is not + * explicitly set, SignalR service will use its globally default value. But keep in mind, the default value + * doesn't mean "false". It varies in terms of different FeatureFlags.. + * + * @param features List of SignalR featureFlags. e.g. ServiceMode. + *

FeatureFlags that are not included in the parameters for the update operation will not be + * modified. And the response will only include featureFlags that are explicitly set. When a featureFlag + * is not explicitly set, SignalR service will use its globally default value. But keep in mind, the + * default value doesn't mean "false". It varies in terms of different FeatureFlags. + * @return the next definition stage. + */ + WithCreate withFeatures(List features); + } + /** The stage of the SignalRResource definition allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: Cross-Origin Resource Sharing (CORS) settings.. + * + * @param cors Cross-Origin Resource Sharing (CORS) settings. + * @return the next definition stage. + */ + WithCreate withCors(SignalRCorsSettings cors); + } + /** The stage of the SignalRResource definition allowing to specify upstream. */ + interface WithUpstream { + /** + * Specifies the upstream property: Upstream settings when the Azure SignalR is in server-less mode.. + * + * @param upstream Upstream settings when the Azure SignalR is in server-less mode. + * @return the next definition stage. + */ + WithCreate withUpstream(ServerlessUpstreamSettings upstream); + } + /** The stage of the SignalRResource definition allowing to specify networkACLs. */ + interface WithNetworkACLs { + /** + * Specifies the networkACLs property: Network ACLs. + * + * @param networkACLs Network ACLs. + * @return the next definition stage. + */ + WithCreate withNetworkACLs(SignalRNetworkACLs networkACLs); + } + /** The stage of the SignalRResource definition allowing to specify tls. */ + interface WithTls { + /** + * Specifies the tls property: TLS settings.. + * + * @param tls TLS settings. + * @return the next definition stage. + */ + WithCreate withTls(SignalRTlsSettings tls); + } + } + /** + * Begins update for the SignalRResource resource. + * + * @return the stage of resource update. + */ + SignalRResource.Update update(); + + /** The template for SignalRResource update. */ + interface Update + extends UpdateStages.WithTags, + UpdateStages.WithSku, + UpdateStages.WithIdentity, + UpdateStages.WithFeatures, + UpdateStages.WithCors, + UpdateStages.WithUpstream, + UpdateStages.WithNetworkACLs, + UpdateStages.WithTls { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SignalRResource apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SignalRResource apply(Context context); + } + /** The SignalRResource update stages. */ + interface UpdateStages { + /** The stage of the SignalRResource update allowing to specify tags. */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + Update withTags(Map tags); + } + /** The stage of the SignalRResource update allowing to specify sku. */ + interface WithSku { + /** + * Specifies the sku property: The billing information of the resource.(e.g. Free, Standard). + * + * @param sku The billing information of the resource.(e.g. Free, Standard). + * @return the next definition stage. + */ + Update withSku(ResourceSku sku); + } + /** The stage of the SignalRResource update allowing to specify identity. */ + interface WithIdentity { + /** + * Specifies the identity property: The managed identity response. + * + * @param identity The managed identity response. + * @return the next definition stage. + */ + Update withIdentity(ManagedIdentity identity); + } + /** The stage of the SignalRResource update allowing to specify features. */ + interface WithFeatures { + /** + * Specifies the features property: List of SignalR featureFlags. e.g. ServiceMode. + * + *

FeatureFlags that are not included in the parameters for the update operation will not be modified. + * And the response will only include featureFlags that are explicitly set. When a featureFlag is not + * explicitly set, SignalR service will use its globally default value. But keep in mind, the default value + * doesn't mean "false". It varies in terms of different FeatureFlags.. + * + * @param features List of SignalR featureFlags. e.g. ServiceMode. + *

FeatureFlags that are not included in the parameters for the update operation will not be + * modified. And the response will only include featureFlags that are explicitly set. When a featureFlag + * is not explicitly set, SignalR service will use its globally default value. But keep in mind, the + * default value doesn't mean "false". It varies in terms of different FeatureFlags. + * @return the next definition stage. + */ + Update withFeatures(List features); + } + /** The stage of the SignalRResource update allowing to specify cors. */ + interface WithCors { + /** + * Specifies the cors property: Cross-Origin Resource Sharing (CORS) settings.. + * + * @param cors Cross-Origin Resource Sharing (CORS) settings. + * @return the next definition stage. + */ + Update withCors(SignalRCorsSettings cors); + } + /** The stage of the SignalRResource update allowing to specify upstream. */ + interface WithUpstream { + /** + * Specifies the upstream property: Upstream settings when the Azure SignalR is in server-less mode.. + * + * @param upstream Upstream settings when the Azure SignalR is in server-less mode. + * @return the next definition stage. + */ + Update withUpstream(ServerlessUpstreamSettings upstream); + } + /** The stage of the SignalRResource update allowing to specify networkACLs. */ + interface WithNetworkACLs { + /** + * Specifies the networkACLs property: Network ACLs. + * + * @param networkACLs Network ACLs. + * @return the next definition stage. + */ + Update withNetworkACLs(SignalRNetworkACLs networkACLs); + } + /** The stage of the SignalRResource update allowing to specify tls. */ + interface WithTls { + /** + * Specifies the tls property: TLS settings.. + * + * @param tls TLS settings. + * @return the next definition stage. + */ + Update withTls(SignalRTlsSettings tls); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SignalRResource refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SignalRResource refresh(Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRResourceList.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRResourceList.java new file mode 100644 index 0000000000000..bda5c47f8da2d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRResourceList.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.models.SignalRResourceInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of SignalR services and a possible link for next set. */ +@Fluent +public final class SignalRResourceList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRResourceList.class); + + /* + * List of SignalR services + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL the client should use to fetch the next page (per server side + * paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of SignalR services. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of SignalR services. + * + * @param value the value value to set. + * @return the SignalRResourceList object itself. + */ + public SignalRResourceList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). It's + * null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). It's + * null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the SignalRResourceList object itself. + */ + public SignalRResourceList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRSkuTier.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRSkuTier.java new file mode 100644 index 0000000000000..01306301b3463 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRSkuTier.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SignalRSkuTier. */ +public final class SignalRSkuTier extends ExpandableStringEnum { + /** Static value Free for SignalRSkuTier. */ + public static final SignalRSkuTier FREE = fromString("Free"); + + /** Static value Basic for SignalRSkuTier. */ + public static final SignalRSkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SignalRSkuTier. */ + public static final SignalRSkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for SignalRSkuTier. */ + public static final SignalRSkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SignalRSkuTier from its string representation. + * + * @param name a name to look for. + * @return the corresponding SignalRSkuTier. + */ + @JsonCreator + public static SignalRSkuTier fromString(String name) { + return fromString(name, SignalRSkuTier.class); + } + + /** @return known SignalRSkuTier values. */ + public static Collection values() { + return values(SignalRSkuTier.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRTlsSettings.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRTlsSettings.java new file mode 100644 index 0000000000000..1dc94ff48ee67 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRTlsSettings.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** TLS settings for SignalR. */ +@Fluent +public final class SignalRTlsSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRTlsSettings.class); + + /* + * Request client certificate during TLS handshake if enabled + */ + @JsonProperty(value = "clientCertEnabled") + private Boolean clientCertEnabled; + + /** + * Get the clientCertEnabled property: Request client certificate during TLS handshake if enabled. + * + * @return the clientCertEnabled value. + */ + public Boolean clientCertEnabled() { + return this.clientCertEnabled; + } + + /** + * Set the clientCertEnabled property: Request client certificate during TLS handshake if enabled. + * + * @param clientCertEnabled the clientCertEnabled value to set. + * @return the SignalRTlsSettings object itself. + */ + public SignalRTlsSettings withClientCertEnabled(Boolean clientCertEnabled) { + this.clientCertEnabled = clientCertEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsage.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsage.java new file mode 100644 index 0000000000000..10ad57a8fe62c --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsage.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.resourcemanager.signalr.fluent.models.SignalRUsageInner; + +/** An immutable client-side representation of SignalRUsage. */ +public interface SignalRUsage { + /** + * Gets the id property: Fully qualified ARM resource id. + * + * @return the id value. + */ + String id(); + + /** + * Gets the currentValue property: Current value for the usage quota. + * + * @return the currentValue value. + */ + Long currentValue(); + + /** + * Gets the limit property: The maximum permitted value for the usage quota. If there is no limit, this value will + * be -1. + * + * @return the limit value. + */ + Long limit(); + + /** + * Gets the name property: Localizable String object containing the name and a localized value. + * + * @return the name value. + */ + SignalRUsageName name(); + + /** + * Gets the unit property: Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, + * Percent, CountPerSecond, BytesPerSecond. + * + * @return the unit value. + */ + String unit(); + + /** + * Gets the inner com.azure.resourcemanager.signalr.fluent.models.SignalRUsageInner object. + * + * @return the inner object. + */ + SignalRUsageInner innerModel(); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsageList.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsageList.java new file mode 100644 index 0000000000000..ef47d0f3d8210 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsageList.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.signalr.fluent.models.SignalRUsageInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Object that includes an array of SignalR resource usages and a possible link for next set. */ +@Fluent +public final class SignalRUsageList { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRUsageList.class); + + /* + * List of SignalR usages + */ + @JsonProperty(value = "value") + private List value; + + /* + * The URL the client should use to fetch the next page (per server side + * paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: List of SignalR usages. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: List of SignalR usages. + * + * @param value the value value to set. + * @return the SignalRUsageList object itself. + */ + public SignalRUsageList withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The URL the client should use to fetch the next page (per server side paging). It's + * null for now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The URL the client should use to fetch the next page (per server side paging). It's + * null for now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the SignalRUsageList object itself. + */ + public SignalRUsageList withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsageName.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsageName.java new file mode 100644 index 0000000000000..62b5b2428ba57 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRUsageName.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Localizable String object containing the name and a localized value. */ +@Fluent +public final class SignalRUsageName { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SignalRUsageName.class); + + /* + * The identifier of the usage. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Localized name of the usage. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the value property: The identifier of the usage. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: The identifier of the usage. + * + * @param value the value value to set. + * @return the SignalRUsageName object itself. + */ + public SignalRUsageName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localizedValue property: Localized name of the usage. + * + * @return the localizedValue value. + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localizedValue property: Localized name of the usage. + * + * @param localizedValue the localizedValue value to set. + * @return the SignalRUsageName object itself. + */ + public SignalRUsageName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRs.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRs.java new file mode 100644 index 0000000000000..73ba6106e1875 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/SignalRs.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of SignalRs. */ +public interface SignalRs { + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 check name availability. + */ + NameAvailability checkNameAvailability(String location); + + /** + * Checks that the SignalR name is valid and is not already in use. + * + * @param location the region. + * @param parameters Parameters supplied to the operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 check name availability. + */ + Response checkNameAvailabilityWithResponse( + String location, NameAvailabilityParameters parameters, Context context); + + /** + * Handles requests to list all resources in a subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + PagedIterable list(); + + /** + * Handles requests to list all resources in a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + PagedIterable list(Context context); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Handles requests to list all resources in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR services and a possible link for next set. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + SignalRKeys listKeys(String resourceGroupName, String resourceName); + + /** + * Get the access keys of the SignalR resource. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 access keys of the SignalR resource. + */ + Response listKeysWithResponse(String resourceGroupName, String resourceName, Context context); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represents the access keys of SignalR service. + */ + SignalRKeys regenerateKey(String resourceGroupName, String resourceName, RegenerateKeyParameters parameters); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 a class represents the access keys of SignalR service. + */ + SignalRKeys regenerateKey(String resourceGroupName, String resourceName); + + /** + * Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same time. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR resource. + * @param parameters Parameter that describes the Regenerate Key Operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 class represents the access keys of SignalR service. + */ + SignalRKeys regenerateKey( + String resourceGroupName, String resourceName, RegenerateKeyParameters parameters, Context context); + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + SignalRResource getByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Get the SignalR service and its properties. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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 SignalR service and its properties. + */ + Response getByResourceGroupWithResponse( + String resourceGroupName, String resourceName, Context context); + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + void deleteByResourceGroup(String resourceGroupName, String resourceName); + + /** + * Operation to delete a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + void delete(String resourceGroupName, String resourceName, Context context); + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + void restart(String resourceGroupName, String resourceName); + + /** + * Operation to restart a SignalR service. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value + * from the Azure Resource Manager API or the portal. + * @param resourceName The name of the SignalR 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. + */ + void restart(String resourceGroupName, String resourceName, Context context); + + /** + * Get the SignalR service and its properties. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SignalR service and its properties. + */ + SignalRResource getById(String id); + + /** + * Get the SignalR service and its properties. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SignalR service and its properties. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Operation to delete a SignalR service. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Operation to delete a SignalR service. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SignalRResource resource. + * + * @param name resource name. + * @return the first stage of the new SignalRResource definition. + */ + SignalRResource.DefinitionStages.Blank define(String name); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamAuthSettings.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamAuthSettings.java new file mode 100644 index 0000000000000..0ccdf1f3282ea --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamAuthSettings.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Upstream auth settings. */ +@Fluent +public final class UpstreamAuthSettings { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpstreamAuthSettings.class); + + /* + * Gets or sets the type of auth. None or ManagedIdentity is supported now. + */ + @JsonProperty(value = "type") + private UpstreamAuthType type; + + /* + * Gets or sets the managed identity settings. It's required if the auth + * type is set to ManagedIdentity. + */ + @JsonProperty(value = "managedIdentity") + private ManagedIdentitySettings managedIdentity; + + /** + * Get the type property: Gets or sets the type of auth. None or ManagedIdentity is supported now. + * + * @return the type value. + */ + public UpstreamAuthType type() { + return this.type; + } + + /** + * Set the type property: Gets or sets the type of auth. None or ManagedIdentity is supported now. + * + * @param type the type value to set. + * @return the UpstreamAuthSettings object itself. + */ + public UpstreamAuthSettings withType(UpstreamAuthType type) { + this.type = type; + return this; + } + + /** + * Get the managedIdentity property: Gets or sets the managed identity settings. It's required if the auth type is + * set to ManagedIdentity. + * + * @return the managedIdentity value. + */ + public ManagedIdentitySettings managedIdentity() { + return this.managedIdentity; + } + + /** + * Set the managedIdentity property: Gets or sets the managed identity settings. It's required if the auth type is + * set to ManagedIdentity. + * + * @param managedIdentity the managedIdentity value to set. + * @return the UpstreamAuthSettings object itself. + */ + public UpstreamAuthSettings withManagedIdentity(ManagedIdentitySettings managedIdentity) { + this.managedIdentity = managedIdentity; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (managedIdentity() != null) { + managedIdentity().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamAuthType.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamAuthType.java new file mode 100644 index 0000000000000..d24620b6d13ba --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamAuthType.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for UpstreamAuthType. */ +public final class UpstreamAuthType extends ExpandableStringEnum { + /** Static value None for UpstreamAuthType. */ + public static final UpstreamAuthType NONE = fromString("None"); + + /** Static value ManagedIdentity for UpstreamAuthType. */ + public static final UpstreamAuthType MANAGED_IDENTITY = fromString("ManagedIdentity"); + + /** + * Creates or finds a UpstreamAuthType from its string representation. + * + * @param name a name to look for. + * @return the corresponding UpstreamAuthType. + */ + @JsonCreator + public static UpstreamAuthType fromString(String name) { + return fromString(name, UpstreamAuthType.class); + } + + /** @return known UpstreamAuthType values. */ + public static Collection values() { + return values(UpstreamAuthType.class); + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamTemplate.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamTemplate.java new file mode 100644 index 0000000000000..9f2b8b5cdd72c --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UpstreamTemplate.java @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Upstream template item settings. It defines the Upstream URL of the incoming requests. The template defines the + * pattern of the event, the hub or the category of the incoming request that matches current URL template. + */ +@Fluent +public final class UpstreamTemplate { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UpstreamTemplate.class); + + /* + * Gets or sets the matching pattern for hub names. If not set, it matches + * any hub. + * There are 3 kind of patterns supported: + * 1. "*", it to matches any hub name + * 2. Combine multiple hubs with ",", for example "hub1,hub2", it matches + * "hub1" and "hub2" + * 3. The single hub name, for example, "hub1", it matches "hub1" + */ + @JsonProperty(value = "hubPattern") + private String hubPattern; + + /* + * Gets or sets the matching pattern for event names. If not set, it + * matches any event. + * There are 3 kind of patterns supported: + * 1. "*", it to matches any event name + * 2. Combine multiple events with ",", for example "connect,disconnect", + * it matches event "connect" and "disconnect" + * 3. The single event name, for example, "connect", it matches "connect" + */ + @JsonProperty(value = "eventPattern") + private String eventPattern; + + /* + * Gets or sets the matching pattern for category names. If not set, it + * matches any category. + * There are 3 kind of patterns supported: + * 1. "*", it to matches any category name + * 2. Combine multiple categories with ",", for example + * "connections,messages", it matches category "connections" and "messages" + * 3. The single category name, for example, "connections", it matches the + * category "connections" + */ + @JsonProperty(value = "categoryPattern") + private String categoryPattern; + + /* + * Gets or sets the Upstream URL template. You can use 3 predefined + * parameters {hub}, {category} {event} inside the template, the value of + * the Upstream URL is dynamically calculated when the client request comes + * in. + * For example, if the urlTemplate is + * `http://example.com/{hub}/api/{event}`, with a client request from hub + * `chat` connects, it will first POST to this URL: + * `http://example.com/chat/api/connect`. + */ + @JsonProperty(value = "urlTemplate", required = true) + private String urlTemplate; + + /* + * Gets or sets the auth settings for an upstream. If not set, no auth is + * used for upstream messages. + */ + @JsonProperty(value = "auth") + private UpstreamAuthSettings auth; + + /** + * Get the hubPattern property: Gets or sets the matching pattern for hub names. If not set, it matches any hub. + * There are 3 kind of patterns supported: 1. "*", it to matches any hub name 2. Combine multiple hubs with ",", for + * example "hub1,hub2", it matches "hub1" and "hub2" 3. The single hub name, for example, "hub1", it matches "hub1". + * + * @return the hubPattern value. + */ + public String hubPattern() { + return this.hubPattern; + } + + /** + * Set the hubPattern property: Gets or sets the matching pattern for hub names. If not set, it matches any hub. + * There are 3 kind of patterns supported: 1. "*", it to matches any hub name 2. Combine multiple hubs with ",", for + * example "hub1,hub2", it matches "hub1" and "hub2" 3. The single hub name, for example, "hub1", it matches "hub1". + * + * @param hubPattern the hubPattern value to set. + * @return the UpstreamTemplate object itself. + */ + public UpstreamTemplate withHubPattern(String hubPattern) { + this.hubPattern = hubPattern; + return this; + } + + /** + * Get the eventPattern property: Gets or sets the matching pattern for event names. If not set, it matches any + * event. There are 3 kind of patterns supported: 1. "*", it to matches any event name 2. Combine multiple events + * with ",", for example "connect,disconnect", it matches event "connect" and "disconnect" 3. The single event name, + * for example, "connect", it matches "connect". + * + * @return the eventPattern value. + */ + public String eventPattern() { + return this.eventPattern; + } + + /** + * Set the eventPattern property: Gets or sets the matching pattern for event names. If not set, it matches any + * event. There are 3 kind of patterns supported: 1. "*", it to matches any event name 2. Combine multiple events + * with ",", for example "connect,disconnect", it matches event "connect" and "disconnect" 3. The single event name, + * for example, "connect", it matches "connect". + * + * @param eventPattern the eventPattern value to set. + * @return the UpstreamTemplate object itself. + */ + public UpstreamTemplate withEventPattern(String eventPattern) { + this.eventPattern = eventPattern; + return this; + } + + /** + * Get the categoryPattern property: Gets or sets the matching pattern for category names. If not set, it matches + * any category. There are 3 kind of patterns supported: 1. "*", it to matches any category name 2. Combine multiple + * categories with ",", for example "connections,messages", it matches category "connections" and "messages" 3. The + * single category name, for example, "connections", it matches the category "connections". + * + * @return the categoryPattern value. + */ + public String categoryPattern() { + return this.categoryPattern; + } + + /** + * Set the categoryPattern property: Gets or sets the matching pattern for category names. If not set, it matches + * any category. There are 3 kind of patterns supported: 1. "*", it to matches any category name 2. Combine multiple + * categories with ",", for example "connections,messages", it matches category "connections" and "messages" 3. The + * single category name, for example, "connections", it matches the category "connections". + * + * @param categoryPattern the categoryPattern value to set. + * @return the UpstreamTemplate object itself. + */ + public UpstreamTemplate withCategoryPattern(String categoryPattern) { + this.categoryPattern = categoryPattern; + return this; + } + + /** + * Get the urlTemplate property: Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, + * {category} {event} inside the template, the value of the Upstream URL is dynamically calculated when the client + * request comes in. For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client + * request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`. + * + * @return the urlTemplate value. + */ + public String urlTemplate() { + return this.urlTemplate; + } + + /** + * Set the urlTemplate property: Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, + * {category} {event} inside the template, the value of the Upstream URL is dynamically calculated when the client + * request comes in. For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client + * request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`. + * + * @param urlTemplate the urlTemplate value to set. + * @return the UpstreamTemplate object itself. + */ + public UpstreamTemplate withUrlTemplate(String urlTemplate) { + this.urlTemplate = urlTemplate; + return this; + } + + /** + * Get the auth property: Gets or sets the auth settings for an upstream. If not set, no auth is used for upstream + * messages. + * + * @return the auth value. + */ + public UpstreamAuthSettings auth() { + return this.auth; + } + + /** + * Set the auth property: Gets or sets the auth settings for an upstream. If not set, no auth is used for upstream + * messages. + * + * @param auth the auth value to set. + * @return the UpstreamTemplate object itself. + */ + public UpstreamTemplate withAuth(UpstreamAuthSettings auth) { + this.auth = auth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (urlTemplate() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property urlTemplate in model UpstreamTemplate")); + } + if (auth() != null) { + auth().validate(); + } + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Usages.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Usages.java new file mode 100644 index 0000000000000..10468bf7b2b79 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/Usages.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Usages. */ +public interface Usages { + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + PagedIterable list(String location); + + /** + * List usage quotas for Azure SignalR service by location. + * + * @param location the location like "eastus". + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that includes an array of SignalR resource usages and a possible link for next set. + */ + PagedIterable list(String location, Context context); +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UserAssignedIdentityProperty.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UserAssignedIdentityProperty.java new file mode 100644 index 0000000000000..c0fbfbbee06fe --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/UserAssignedIdentityProperty.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.signalr.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of user assigned identity. */ +@Immutable +public final class UserAssignedIdentityProperty { + @JsonIgnore private final ClientLogger logger = new ClientLogger(UserAssignedIdentityProperty.class); + + /* + * Get the principal id for the user assigned identity + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /* + * Get the client id for the user assigned identity + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principalId property: Get the principal id for the user assigned identity. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the clientId property: Get the client id for the user assigned identity. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/package-info.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/package-info.java new file mode 100644 index 0000000000000..bff80d19552c8 --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for SignalRManagementClient. REST API for Azure SignalR Service. */ +package com.azure.resourcemanager.signalr.models; diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/package-info.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/package-info.java new file mode 100644 index 0000000000000..0685d07d9b24e --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for SignalRManagementClient. REST API for Azure SignalR Service. */ +package com.azure.resourcemanager.signalr; diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/module-info.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/module-info.java new file mode 100644 index 0000000000000..346c0e5321d1d --- /dev/null +++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.signalr { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.signalr; + exports com.azure.resourcemanager.signalr.fluent; + exports com.azure.resourcemanager.signalr.fluent.models; + exports com.azure.resourcemanager.signalr.models; + + opens com.azure.resourcemanager.signalr.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.signalr.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/signalr/ci.yml b/sdk/signalr/ci.yml new file mode 100644 index 0000000000000..155342a8177a9 --- /dev/null +++ b/sdk/signalr/ci.yml @@ -0,0 +1,31 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - master + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ + +pr: + branches: + include: + - master + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/signalr/ + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: signalr + Artifacts: + - name: azure-resourcemanager-signalr + groupId: com.azure.resourcemanager + safeName: azureresourcemanagersignalr diff --git a/sdk/signalr/pom.xml b/sdk/signalr/pom.xml new file mode 100644 index 0000000000000..a472ea8c6447d --- /dev/null +++ b/sdk/signalr/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-signalr-service + pom + 1.0.0 + + azure-resourcemanager-signalr + +