From 87d9a56e27359a951d76a18b8f00183e0ded201a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 24 Feb 2025 06:34:04 +0000 Subject: [PATCH] CodeGen from PR 32744 in Azure/azure-rest-api-specs Merge b64712c9889eb514591e722ba9c3f930b556bacf into a570eb7b5643099a4c210b2e7b7d2fd3038f8c74 --- .../CHANGELOG.md | 102 +- .../README.md | 14 +- .../SAMPLE.md | 657 +++++++- .../pom.xml | 7 +- .../HybridConnectivityManager.java | 123 +- .../fluent/EndpointsClient.java | 80 +- .../fluent/GenerateAwsTemplatesClient.java | 45 + .../HybridConnectivityManagementApi.java | 62 - .../fluent/HybridConnectivityMgmtClient.java | 104 ++ .../fluent/InventoriesClient.java | 75 + .../fluent/OperationsClient.java | 6 +- .../fluent/PublicCloudConnectorsClient.java | 270 ++++ .../fluent/ServiceConfigurationsClient.java | 82 +- .../fluent/SolutionConfigurationsClient.java | 217 +++ .../fluent/SolutionTypesClient.java | 92 ++ .../fluent/models/AadProfileProperties.java | 30 +- .../models/EndpointAccessResourceInner.java | 78 +- .../fluent/models/EndpointResourceInner.java | 2 +- .../models/IngressGatewayResourceInner.java | 120 +- .../models/IngressProfileProperties.java | 49 +- .../fluent/models/InventoryResourceInner.java | 155 ++ .../models/ManagedProxyResourceInner.java | 30 +- .../fluent/models/OperationInner.java | 33 +- .../models/OperationStatusResultInner.java | 241 +++ .../fluent/models/PostResponseInner.java | 63 + .../models/PublicCloudConnectorInner.java | 192 +++ .../RelayNamespaceAccessProperties.java | 63 +- .../ServiceConfigurationProperties.java | 2 +- .../ServiceConfigurationPropertiesPatch.java | 2 +- .../ServiceConfigurationResourceInner.java | 2 +- .../models/SolutionConfigurationInner.java | 167 ++ .../models/SolutionTypeResourceInner.java | 155 ++ .../fluent/models/package-info.java | 6 +- .../fluent/package-info.java | 6 +- .../EndpointAccessResourceImpl.java | 2 +- .../implementation/EndpointResourceImpl.java | 2 +- .../implementation/EndpointsClientImpl.java | 400 ++--- .../implementation/EndpointsImpl.java | 22 +- .../GenerateAwsTemplatesClientImpl.java | 186 +++ .../GenerateAwsTemplatesImpl.java | 57 + ... HybridConnectivityMgmtClientBuilder.java} | 58 +- ... => HybridConnectivityMgmtClientImpl.java} | 126 +- .../IngressGatewayResourceImpl.java | 2 +- .../implementation/InventoriesClientImpl.java | 409 +++++ .../implementation/InventoriesImpl.java | 72 + .../implementation/InventoryResourceImpl.java | 50 + .../ManagedProxyResourceImpl.java | 2 +- .../implementation/OperationImpl.java | 2 +- .../OperationStatusResultImpl.java | 76 + .../implementation/OperationsClientImpl.java | 30 +- .../implementation/OperationsImpl.java | 2 +- .../implementation/PostResponseImpl.java | 28 + .../PublicCloudConnectorImpl.java | 178 +++ .../PublicCloudConnectorsClientImpl.java | 1339 +++++++++++++++++ .../PublicCloudConnectorsImpl.java | 172 +++ .../implementation/ResourceManagerUtils.java | 2 +- .../ServiceConfigurationResourceImpl.java | 2 +- .../ServiceConfigurationsClientImpl.java | 408 ++--- .../ServiceConfigurationsImpl.java | 32 +- .../SolutionConfigurationImpl.java | 140 ++ .../SolutionConfigurationsClientImpl.java | 983 ++++++++++++ .../SolutionConfigurationsImpl.java | 173 +++ .../SolutionTypeResourceImpl.java | 50 + .../SolutionTypesClientImpl.java | 576 +++++++ .../implementation/SolutionTypesImpl.java | 79 + .../models/EndpointsList.java | 65 +- .../models/InventoryResourceListResult.java | 114 ++ .../models/OperationListResult.java | 25 +- .../PublicCloudConnectorListResult.java | 115 ++ .../models/ServiceConfigurationList.java | 41 +- .../SolutionConfigurationListResult.java | 115 ++ .../SolutionTypeResourceListResult.java | 115 ++ .../implementation/package-info.java | 6 +- .../hybridconnectivity/models/ActionType.java | 6 +- .../models/AwsCloudProfile.java | 163 ++ .../models/CloudNativeType.java | 46 + .../models/EndpointAccessResource.java | 2 +- .../models/EndpointProperties.java | 2 +- .../models/EndpointResource.java | 4 +- .../hybridconnectivity/models/Endpoints.java | 68 +- .../models/GenerateAwsTemplateRequest.java | 136 ++ .../models/GenerateAwsTemplates.java | 38 + .../hybridconnectivity/models/HostType.java | 46 + .../models/IngressGatewayResource.java | 2 +- .../models/Inventories.java | 68 + .../models/InventoryProperties.java | 168 +++ .../models/InventoryResource.java | 55 + .../models/ListCredentialsRequest.java | 2 +- .../ListIngressGatewayCredentialsRequest.java | 10 +- .../models/ManagedProxyRequest.java | 2 +- .../models/ManagedProxyResource.java | 2 +- .../hybridconnectivity/models/Operation.java | 8 +- .../models/OperationDisplay.java | 6 +- .../models/OperationStatusResult.java | 86 ++ .../hybridconnectivity/models/Operations.java | 6 +- .../hybridconnectivity/models/Origin.java | 8 +- .../models/PostResponse.java | 19 + .../models/ProvisioningState.java | 2 +- .../models/PublicCloudConnector.java | 285 ++++ .../PublicCloudConnectorProperties.java | 171 +++ .../models/PublicCloudConnectors.java | 186 +++ .../models/ResourceProvisioningState.java | 56 + .../models/ServiceConfigurationResource.java | 4 +- .../ServiceConfigurationResourcePatch.java | 2 +- .../models/ServiceConfigurations.java | 70 +- .../models/ServiceName.java | 2 +- .../models/SolutionConfiguration.java | 200 +++ .../SolutionConfigurationProperties.java | 203 +++ .../models/SolutionConfigurationStatus.java | 61 + .../models/SolutionConfigurations.java | 164 ++ .../models/SolutionSettings.java | 101 ++ .../models/SolutionTypeProperties.java | 142 ++ .../models/SolutionTypeResource.java | 55 + .../models/SolutionTypeSettings.java | 133 ++ .../SolutionTypeSettingsProperties.java | 205 +++ .../models/SolutionTypes.java | 83 + .../hybridconnectivity/models/Type.java | 2 +- .../models/package-info.java | 6 +- .../hybridconnectivity/package-info.java | 6 +- .../src/main/java/module-info.java | 3 +- .../proxy-config.json | 2 +- ...ourcemanager-hybridconnectivity.properties | 1 + .../EndpointsCreateOrUpdateSamples.java | 10 +- .../generated/EndpointsDeleteSamples.java | 6 +- .../generated/EndpointsGetSamples.java | 10 +- .../EndpointsListCredentialsSamples.java | 6 +- ...sListIngressGatewayCredentialsSamples.java | 6 +- ...dpointsListManagedProxyDetailsSamples.java | 6 +- .../generated/EndpointsListSamples.java | 6 +- .../generated/EndpointsUpdateSamples.java | 6 +- .../GenerateAwsTemplatePostSamples.java | 47 + .../generated/InventoryGetSamples.java | 23 + ...oryListBySolutionConfigurationSamples.java | 23 + .../generated/OperationsListSamples.java | 6 +- ...cCloudConnectorsCreateOrUpdateSamples.java | 52 + .../PublicCloudConnectorsDeleteSamples.java | 25 + ...udConnectorsGetByResourceGroupSamples.java | 25 + ...dConnectorsListByResourceGroupSamples.java | 23 + .../PublicCloudConnectorsListSamples.java | 23 + ...CloudConnectorsTestPermissionsSamples.java | 24 + .../PublicCloudConnectorsUpdateSamples.java | 50 + ...ceConfigurationsCreateOrupdateSamples.java | 10 +- .../ServiceConfigurationsDeleteSamples.java | 6 +- .../ServiceConfigurationsGetSamples.java | 10 +- ...urationsListByEndpointResourceSamples.java | 6 +- .../ServiceConfigurationsUpdateSamples.java | 6 +- ...onConfigurationsCreateOrUpdateSamples.java | 45 + .../SolutionConfigurationsDeleteSamples.java | 24 + .../SolutionConfigurationsGetSamples.java | 23 + .../SolutionConfigurationsListSamples.java | 23 + .../SolutionConfigurationsSyncNowSamples.java | 23 + .../SolutionConfigurationsUpdateSamples.java | 47 + ...olutionTypesGetByResourceGroupSamples.java | 24 + ...lutionTypesListByResourceGroupSamples.java | 23 + .../generated/SolutionTypesListSamples.java | 23 + .../generated/AadProfilePropertiesTests.java | 16 +- .../generated/AwsCloudProfileTests.java | 33 + .../generated/EndpointPropertiesTests.java | 14 +- .../generated/EndpointResourceInnerTests.java | 10 +- ...tsCreateOrUpdateWithResponseMockTests.java | 18 +- ...eByResourceGroupWithResponseMockTests.java | 9 +- .../EndpointsGetWithResponseMockTests.java | 14 +- ...agedProxyDetailsWithResponseMockTests.java | 20 +- .../generated/EndpointsListMockTests.java | 14 +- .../generated/EndpointsListTests.java | 24 +- .../GenerateAwsTemplateRequestTests.java | 50 + ...AwsTemplatesPostWithResponseMockTests.java | 61 + .../IngressProfilePropertiesTests.java | 23 +- .../InventoriesGetWithResponseMockTests.java | 45 + ...sListBySolutionConfigurationMockTests.java | 45 + .../generated/InventoryPropertiesTests.java | 25 + .../InventoryResourceInnerTests.java | 25 + .../InventoryResourceListResultTests.java | 26 + .../ListCredentialsRequestTests.java | 10 +- ...IngressGatewayCredentialsRequestTests.java | 2 +- .../generated/ManagedProxyRequestTests.java | 14 +- .../ManagedProxyResourceInnerTests.java | 18 +- .../generated/OperationDisplayTests.java | 10 +- .../generated/OperationInnerTests.java | 11 +- .../generated/OperationListResultTests.java | 14 +- .../generated/OperationsListMockTests.java | 8 +- .../generated/PostResponseInnerTests.java | 15 + .../PublicCloudConnectorInnerTests.java | 61 + .../PublicCloudConnectorListResultTests.java | 27 + .../PublicCloudConnectorPropertiesTests.java | 39 + ...loudConnectorsCreateOrUpdateMockTests.java | 70 + ...eByResourceGroupWithResponseMockTests.java | 34 + ...tByResourceGroupWithResponseMockTests.java | 45 + ...onnectorsListByResourceGroupMockTests.java | 47 + .../PublicCloudConnectorsListMockTests.java | 47 + .../ServiceConfigurationListTests.java | 36 +- ...viceConfigurationPropertiesPatchTests.java | 10 +- .../ServiceConfigurationPropertiesTests.java | 22 +- ...erviceConfigurationResourceInnerTests.java | 16 +- ...erviceConfigurationResourcePatchTests.java | 10 +- ...nsCreateOrupdateWithResponseMockTests.java | 22 +- ...igurationsDeleteWithResponseMockTests.java | 9 +- ...onfigurationsGetWithResponseMockTests.java | 14 +- ...ationsListByEndpointResourceMockTests.java | 16 +- .../SolutionConfigurationInnerTests.java | 44 + .../SolutionConfigurationListResultTests.java | 20 + .../SolutionConfigurationPropertiesTests.java | 42 + ...nsCreateOrUpdateWithResponseMockTests.java | 58 + ...eByResourceGroupWithResponseMockTests.java | 34 + ...onfigurationsGetWithResponseMockTests.java | 39 + .../SolutionConfigurationsListMockTests.java | 39 + .../generated/SolutionSettingsTests.java | 36 + .../SolutionTypePropertiesTests.java | 27 + .../SolutionTypeResourceInnerTests.java | 27 + .../SolutionTypeResourceListResultTests.java | 30 + .../SolutionTypeSettingsPropertiesTests.java | 24 + .../generated/SolutionTypeSettingsTests.java | 42 + ...tByResourceGroupWithResponseMockTests.java | 47 + ...tionTypesListByResourceGroupMockTests.java | 52 + .../generated/SolutionTypesListMockTests.java | 50 + .../tsp-location.yaml | 4 + 216 files changed, 13475 insertions(+), 1595 deletions(-) create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/GenerateAwsTemplatesClient.java delete mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/HybridConnectivityManagementApi.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/HybridConnectivityMgmtClient.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/InventoriesClient.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/SolutionConfigurationsClient.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/SolutionTypesClient.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/InventoryResourceInner.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/OperationStatusResultInner.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/PostResponseInner.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/PublicCloudConnectorInner.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/SolutionConfigurationInner.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/SolutionTypeResourceInner.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/GenerateAwsTemplatesClientImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/GenerateAwsTemplatesImpl.java rename sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/{HybridConnectivityManagementApiBuilder.java => HybridConnectivityMgmtClientBuilder.java} (61%) rename sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/{HybridConnectivityManagementApiImpl.java => HybridConnectivityMgmtClientImpl.java} (71%) create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoriesClientImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoriesImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoryResourceImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationStatusResultImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PostResponseImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationsClientImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationsImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypeResourceImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypesClientImpl.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypesImpl.java rename sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/{ => implementation}/models/EndpointsList.java (75%) create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/InventoryResourceListResult.java rename sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/{ => implementation}/models/OperationListResult.java (73%) create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/PublicCloudConnectorListResult.java rename sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/{ => implementation}/models/ServiceConfigurationList.java (78%) create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/SolutionConfigurationListResult.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/SolutionTypeResourceListResult.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/AwsCloudProfile.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/CloudNativeType.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/GenerateAwsTemplateRequest.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/GenerateAwsTemplates.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/HostType.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Inventories.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/InventoryProperties.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/InventoryResource.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/OperationStatusResult.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PostResponse.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectorProperties.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ResourceProvisioningState.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfiguration.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurationProperties.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurationStatus.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurations.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionSettings.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeProperties.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeResource.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeSettings.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeSettingsProperties.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypes.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/resources/azure-resourcemanager-hybridconnectivity.properties create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplatePostSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryGetSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryListBySolutionConfigurationSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsCreateOrUpdateSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsDeleteSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsGetByResourceGroupSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListByResourceGroupSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsTestPermissionsSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsUpdateSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsCreateOrUpdateSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsDeleteSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsGetSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsListSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsSyncNowSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsUpdateSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesGetByResourceGroupSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListByResourceGroupSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListSamples.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/AwsCloudProfileTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplateRequestTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplatesPostWithResponseMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoriesGetWithResponseMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoriesListBySolutionConfigurationMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryPropertiesTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryResourceInnerTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryResourceListResultTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PostResponseInnerTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorInnerTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorListResultTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorPropertiesTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsCreateOrUpdateMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsDeleteByResourceGroupWithResponseMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListByResourceGroupMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationInnerTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationListResultTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationPropertiesTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsCreateOrUpdateWithResponseMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsDeleteByResourceGroupWithResponseMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsGetWithResponseMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsListMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionSettingsTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypePropertiesTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeResourceInnerTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeResourceListResultTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeSettingsPropertiesTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeSettingsTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesGetByResourceGroupWithResponseMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListByResourceGroupMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListMockTests.java create mode 100644 sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/tsp-location.yaml diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/CHANGELOG.md b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/CHANGELOG.md index d4fc45aa4b63..a4b62f9127bc 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/CHANGELOG.md +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/CHANGELOG.md @@ -1,14 +1,108 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0-beta.1 (2025-02-24) -### Features Added +- Azure Resource Manager Hybrid Connectivity client library for Java. This package contains Microsoft Azure SDK for Hybrid Connectivity Management SDK. REST API for public clouds. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.EndpointsList` was removed + +#### `models.OperationListResult` was removed + +#### `models.ServiceConfigurationList` was removed + +#### `HybridConnectivityManager` was modified + +* `fluent.HybridConnectivityManagementApi serviceClient()` -> `fluent.HybridConnectivityMgmtClient serviceClient()` + +### Features Added + +* `models.SolutionConfiguration` was added + +* `models.GenerateAwsTemplateRequest` was added + +* `models.PublicCloudConnector` was added + +* `models.SolutionSettings` was added + +* `models.Inventories` was added + +* `models.SolutionConfiguration$Definition` was added + +* `implementation.models.ServiceConfigurationList` was added + +* `models.OperationStatusResult` was added + +* `models.SolutionTypeSettingsProperties` was added + +* `models.SolutionTypeResource` was added + +* `models.AwsCloudProfile` was added + +* `implementation.models.SolutionConfigurationListResult` was added + +* `implementation.models.SolutionTypeResourceListResult` was added + +* `models.InventoryResource` was added + +* `implementation.models.EndpointsList` was added + +* `models.SolutionTypeSettings` was added + +* `models.SolutionConfigurationStatus` was added + +* `models.SolutionConfigurations` was added + +* `models.SolutionConfigurationProperties` was added + +* `models.ResourceProvisioningState` was added + +* `models.HostType` was added + +* `models.PublicCloudConnectors` was added + +* `models.PublicCloudConnectorProperties` was added + +* `models.SolutionConfiguration$Update` was added + +* `models.PublicCloudConnector$Definition` was added + +* `models.SolutionTypes` was added + +* `implementation.models.PublicCloudConnectorListResult` was added + +* `models.PublicCloudConnector$DefinitionStages` was added + +* `models.PublicCloudConnector$Update` was added + +* `models.SolutionTypeProperties` was added + +* `models.PostResponse` was added + +* `models.PublicCloudConnector$UpdateStages` was added + +* `models.SolutionConfiguration$DefinitionStages` was added + +* `implementation.models.OperationListResult` was added + +* `models.InventoryProperties` was added + +* `implementation.models.InventoryResourceListResult` was added + +* `models.CloudNativeType` was added + +* `models.GenerateAwsTemplates` was added + +* `models.SolutionConfiguration$UpdateStages` was added + +#### `HybridConnectivityManager` was modified -### Other Changes +* `inventories()` was added +* `generateAwsTemplates()` was added +* `solutionTypes()` was added +* `solutionConfigurations()` was added +* `publicCloudConnectors()` was added ## 1.1.0 (2024-12-11) diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/README.md b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/README.md index 95e30f2d4354..4d59e3a70bf1 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/README.md +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager HybridConnectivity client library for Java +# Azure Resource Manager Hybrid Connectivity client library for Java -Azure Resource Manager HybridConnectivity client library for Java. +Azure Resource Manager Hybrid Connectivity client library for Java. -This package contains Microsoft Azure SDK for HybridConnectivity Management SDK. REST API for Hybrid Connectivity. Package tag package-2023-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Hybrid Connectivity Management SDK. REST API for public clouds. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hybridconnectivity - 1.1.0 + 1.2.0-beta.1 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ HybridConnectivityManager manager = HybridConnectivityManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/SAMPLE.md b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/SAMPLE.md index 93b4260fccf5..e11ba7bbfe98 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/SAMPLE.md +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/SAMPLE.md @@ -12,10 +12,29 @@ - [ListManagedProxyDetails](#endpoints_listmanagedproxydetails) - [Update](#endpoints_update) +## GenerateAwsTemplate + +- [Post](#generateawstemplate_post) + +## Inventory + +- [Get](#inventory_get) +- [ListBySolutionConfiguration](#inventory_listbysolutionconfiguration) + ## Operations - [List](#operations_list) +## PublicCloudConnectors + +- [CreateOrUpdate](#publiccloudconnectors_createorupdate) +- [Delete](#publiccloudconnectors_delete) +- [GetByResourceGroup](#publiccloudconnectors_getbyresourcegroup) +- [List](#publiccloudconnectors_list) +- [ListByResourceGroup](#publiccloudconnectors_listbyresourcegroup) +- [TestPermissions](#publiccloudconnectors_testpermissions) +- [Update](#publiccloudconnectors_update) + ## ServiceConfigurations - [CreateOrupdate](#serviceconfigurations_createorupdate) @@ -23,6 +42,21 @@ - [Get](#serviceconfigurations_get) - [ListByEndpointResource](#serviceconfigurations_listbyendpointresource) - [Update](#serviceconfigurations_update) + +## SolutionConfigurations + +- [CreateOrUpdate](#solutionconfigurations_createorupdate) +- [Delete](#solutionconfigurations_delete) +- [Get](#solutionconfigurations_get) +- [List](#solutionconfigurations_list) +- [SyncNow](#solutionconfigurations_syncnow) +- [Update](#solutionconfigurations_update) + +## SolutionTypes + +- [GetByResourceGroup](#solutiontypes_getbyresourcegroup) +- [List](#solutiontypes_list) +- [ListByResourceGroup](#solutiontypes_listbyresourcegroup) ### Endpoints_CreateOrUpdate ```java @@ -34,9 +68,7 @@ import com.azure.resourcemanager.hybridconnectivity.models.Type; */ public final class EndpointsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPutCustom.json + * x-ms-original-file: 2024-12-01/EndpointsPutCustom.json */ /** * Sample code: HybridConnectivityEndpointsPutCustom. @@ -56,9 +88,7 @@ public final class EndpointsCreateOrUpdateSamples { } /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPutDefault.json + * x-ms-original-file: 2024-12-01/EndpointsPutDefault.json */ /** * Sample code: HybridConnectivityEndpointsPutDefault. @@ -85,9 +115,7 @@ public final class EndpointsCreateOrUpdateSamples { */ public final class EndpointsDeleteSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsDeleteDefault.json + * x-ms-original-file: 2024-12-01/EndpointsDeleteDefault.json */ /** * Sample code: HybridConnectivityEndpointsDeleteDefault. @@ -112,9 +140,7 @@ public final class EndpointsDeleteSamples { */ public final class EndpointsGetSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsGetDefault.json + * x-ms-original-file: 2024-12-01/EndpointsGetDefault.json */ /** * Sample code: HybridConnectivityEndpointsGetDefault. @@ -130,9 +156,7 @@ public final class EndpointsGetSamples { } /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsGetCustom.json + * x-ms-original-file: 2024-12-01/EndpointsGetCustom.json */ /** * Sample code: HybridConnectivityEndpointsGetCustom. @@ -157,9 +181,7 @@ public final class EndpointsGetSamples { */ public final class EndpointsListSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsList.json + * x-ms-original-file: 2024-12-01/EndpointsList.json */ /** * Sample code: HybridConnectivityEndpointsGet. @@ -187,9 +209,7 @@ import com.azure.resourcemanager.hybridconnectivity.models.ServiceName; */ public final class EndpointsListCredentialsSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPostListCredentials.json + * x-ms-original-file: 2024-12-01/EndpointsPostListCredentials.json */ /** * Sample code: HybridConnectivityEndpointsPostListCredentials. @@ -216,9 +236,7 @@ public final class EndpointsListCredentialsSamples { */ public final class EndpointsListIngressGatewayCredentialsSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPostListIngressGatewayCredentials.json + * x-ms-original-file: 2024-12-01/EndpointsPostListIngressGatewayCredentials.json */ /** * Sample code: HybridConnectivityEndpointsPostListIngressGatewayCredentials. @@ -246,9 +264,7 @@ import com.azure.resourcemanager.hybridconnectivity.models.ServiceName; */ public final class EndpointsListManagedProxyDetailsSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPostListManagedProxyDetails.json + * x-ms-original-file: 2024-12-01/EndpointsPostListManagedProxyDetails.json */ /** * Sample code: HybridConnectivityEndpointsPostListManagedProxyDetails. @@ -281,9 +297,7 @@ import com.azure.resourcemanager.hybridconnectivity.models.Type; */ public final class EndpointsUpdateSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPatchDefault.json + * x-ms-original-file: 2024-12-01/EndpointsPatchDefault.json */ /** * Sample code: HybridConnectivityEndpointsPatchDefault. @@ -302,6 +316,96 @@ public final class EndpointsUpdateSamples { } ``` +### GenerateAwsTemplate_Post + +```java +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplateRequest; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeSettings; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for GenerateAwsTemplate Post. + */ +public final class GenerateAwsTemplatePostSamples { + /* + * x-ms-original-file: 2024-12-01/GenerateAwsTemplate_Post.json + */ + /** + * Sample code: GenerateAwsTemplate_Post. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + generateAwsTemplatePost(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.generateAwsTemplates() + .postWithResponse( + new GenerateAwsTemplateRequest().withConnectorId("pnxcfjidglabnwxit") + .withSolutionTypes(Arrays.asList(new SolutionTypeSettings().withSolutionType("hjyownzpfxwiufmd") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf())))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Inventory_Get + +```java +/** + * Samples for Inventory Get. + */ +public final class InventoryGetSamples { + /* + * x-ms-original-file: 2024-12-01/Inventory_Get.json + */ + /** + * Sample code: Inventory_Get. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void inventoryGet(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.inventories() + .getWithResponse("ymuj", "zarfsraogroxlaqjjnwixtn", "xofprmcboosrbd", com.azure.core.util.Context.NONE); + } +} +``` + +### Inventory_ListBySolutionConfiguration + +```java +/** + * Samples for Inventory ListBySolutionConfiguration. + */ +public final class InventoryListBySolutionConfigurationSamples { + /* + * x-ms-original-file: 2024-12-01/Inventory_ListBySolutionConfiguration.json + */ + /** + * Sample code: Inventory_ListBySolutionConfiguration. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void inventoryListBySolutionConfiguration( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.inventories().listBySolutionConfiguration("ymuj", "wsxt", com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java @@ -310,9 +414,7 @@ public final class EndpointsUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * OperationsList.json + * x-ms-original-file: 2024-12-01/OperationsList.json */ /** * Sample code: HybridConnectivityOperationsList. @@ -326,6 +428,221 @@ public final class OperationsListSamples { } ``` +### PublicCloudConnectors_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridconnectivity.models.AwsCloudProfile; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PublicCloudConnectors CreateOrUpdate. + */ +public final class PublicCloudConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_CreateOrUpdate.json + */ + /** + * Sample code: PublicCloudConnectors_CreateOrUpdate. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void publicCloudConnectorsCreateOrUpdate( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors() + .define("advjwoakdusalamomg") + .withRegion("jpiglusfxynfcewcjwvvnn") + .withExistingResourceGroup("rgpublicCloud") + .withTags(mapOf()) + .withProperties(new PublicCloudConnectorProperties() + .withAwsCloudProfile(new AwsCloudProfile().withAccountId("snbnuxckevyqpm") + .withExcludedAccounts(Arrays.asList("rwgqpukglvbqmogqcliqolucp")) + .withIsOrganizationalAccount(true)) + .withHostType(HostType.AWS)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### PublicCloudConnectors_Delete + +```java +/** + * Samples for PublicCloudConnectors Delete. + */ +public final class PublicCloudConnectorsDeleteSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_Delete.json + */ + /** + * Sample code: PublicCloudConnectors_Delete. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + publicCloudConnectorsDelete(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors() + .deleteByResourceGroupWithResponse("rgpublicCloud", "skcfyjvflkhibdywjay", + com.azure.core.util.Context.NONE); + } +} +``` + +### PublicCloudConnectors_GetByResourceGroup + +```java +/** + * Samples for PublicCloudConnectors GetByResourceGroup. + */ +public final class PublicCloudConnectorsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_Get.json + */ + /** + * Sample code: PublicCloudConnectors_Get. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + publicCloudConnectorsGet(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors() + .getByResourceGroupWithResponse("rgpublicCloud", "rzygvnpsnrdylwzdbsscjazvamyxmh", + com.azure.core.util.Context.NONE); + } +} +``` + +### PublicCloudConnectors_List + +```java +/** + * Samples for PublicCloudConnectors List. + */ +public final class PublicCloudConnectorsListSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_ListBySubscription.json + */ + /** + * Sample code: PublicCloudConnectors_ListBySubscription. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void publicCloudConnectorsListBySubscription( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PublicCloudConnectors_ListByResourceGroup + +```java +/** + * Samples for PublicCloudConnectors ListByResourceGroup. + */ +public final class PublicCloudConnectorsListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_ListByResourceGroup.json + */ + /** + * Sample code: PublicCloudConnectors_ListByResourceGroup. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void publicCloudConnectorsListByResourceGroup( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors().listByResourceGroup("rgpublicCloud", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicCloudConnectors_TestPermissions + +```java +/** + * Samples for PublicCloudConnectors TestPermissions. + */ +public final class PublicCloudConnectorsTestPermissionsSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_TestPermissions.json + */ + /** + * Sample code: PublicCloudConnectors_TestPermissions. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void publicCloudConnectorsTestPermissions( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors() + .testPermissions("rgpublicCloud", "rzygvnpsnrdylwzdbsscjazvamyxmh", com.azure.core.util.Context.NONE); + } +} +``` + +### PublicCloudConnectors_Update + +```java +import com.azure.resourcemanager.hybridconnectivity.models.AwsCloudProfile; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnector; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PublicCloudConnectors Update. + */ +public final class PublicCloudConnectorsUpdateSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_Update.json + */ + /** + * Sample code: PublicCloudConnectors_Update. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + publicCloudConnectorsUpdate(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + PublicCloudConnector resource = manager.publicCloudConnectors() + .getByResourceGroupWithResponse("rgpublicCloud", "svtirlbyqpepbzyessjenlueeznhg", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withProperties(new PublicCloudConnectorProperties() + .withAwsCloudProfile(new AwsCloudProfile().withExcludedAccounts(Arrays.asList("zrbtd")))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + ### ServiceConfigurations_CreateOrupdate ```java @@ -336,9 +653,7 @@ import com.azure.resourcemanager.hybridconnectivity.models.ServiceName; */ public final class ServiceConfigurationsCreateOrupdateSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsPutWAC.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsPutWAC.json */ /** * Sample code: ServiceConfigurationsPutWAC. @@ -358,9 +673,7 @@ public final class ServiceConfigurationsCreateOrupdateSamples { } /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsPutSSH.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsPutSSH.json */ /** * Sample code: ServiceConfigurationsPutSSH. @@ -389,9 +702,7 @@ public final class ServiceConfigurationsCreateOrupdateSamples { */ public final class ServiceConfigurationsDeleteSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsDeleteSSH.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsDeleteSSH.json */ /** * Sample code: ServiceConfigurationsDeleteSSH. @@ -416,9 +727,7 @@ public final class ServiceConfigurationsDeleteSamples { */ public final class ServiceConfigurationsGetSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsGetWAC.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsGetWAC.json */ /** * Sample code: HybridConnectivityEndpointsServiceconfigurationsGetWAC. @@ -434,9 +743,7 @@ public final class ServiceConfigurationsGetSamples { } /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsGetSSH.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsGetSSH.json */ /** * Sample code: HybridConnectivityEndpointsServiceconfigurationsGetSSH. @@ -461,9 +768,7 @@ public final class ServiceConfigurationsGetSamples { */ public final class ServiceConfigurationsListByEndpointResourceSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsList.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsList.json */ /** * Sample code: GetClustersExample. @@ -490,9 +795,7 @@ import com.azure.resourcemanager.hybridconnectivity.models.ServiceConfigurationR */ public final class ServiceConfigurationsUpdateSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsPatchSSH.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsPatchSSH.json */ /** * Sample code: ServiceConfigurationsPatchSSH. @@ -511,3 +814,249 @@ public final class ServiceConfigurationsUpdateSamples { } ``` +### SolutionConfigurations_CreateOrUpdate + +```java +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SolutionConfigurations CreateOrUpdate. + */ +public final class SolutionConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_CreateOrUpdate.json + */ + /** + * Sample code: SolutionConfigurations_CreateOrUpdate. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void solutionConfigurationsCreateOrUpdate( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations() + .define("keebwujt") + .withExistingResourceUri("ymuj") + .withProperties(new SolutionConfigurationProperties().withSolutionType("nmtqllkyohwtsthxaimsye") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf()))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SolutionConfigurations_Delete + +```java +/** + * Samples for SolutionConfigurations Delete. + */ +public final class SolutionConfigurationsDeleteSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_Delete.json + */ + /** + * Sample code: SolutionConfigurations_Delete. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsDelete(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations() + .deleteByResourceGroupWithResponse("ymuj", "stu", com.azure.core.util.Context.NONE); + } +} +``` + +### SolutionConfigurations_Get + +```java +/** + * Samples for SolutionConfigurations Get. + */ +public final class SolutionConfigurationsGetSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_Get.json + */ + /** + * Sample code: SolutionConfigurations_Get. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsGet(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations().getWithResponse("ymuj", "tks", com.azure.core.util.Context.NONE); + } +} +``` + +### SolutionConfigurations_List + +```java +/** + * Samples for SolutionConfigurations List. + */ +public final class SolutionConfigurationsListSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_List.json + */ + /** + * Sample code: SolutionConfigurations_List. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsList(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations().list("ymuj", com.azure.core.util.Context.NONE); + } +} +``` + +### SolutionConfigurations_SyncNow + +```java +/** + * Samples for SolutionConfigurations SyncNow. + */ +public final class SolutionConfigurationsSyncNowSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_SyncNow.json + */ + /** + * Sample code: SolutionConfigurations_SyncNow. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsSyncNow(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations().syncNow("ymuj", "tks", com.azure.core.util.Context.NONE); + } +} +``` + +### SolutionConfigurations_Update + +```java +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfiguration; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SolutionConfigurations Update. + */ +public final class SolutionConfigurationsUpdateSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_Update.json + */ + /** + * Sample code: SolutionConfigurations_Update. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsUpdate(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + SolutionConfiguration resource = manager.solutionConfigurations() + .getWithResponse("ymuj", "dxt", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SolutionConfigurationProperties().withSolutionType("myzljlstvmgkp") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf()))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### SolutionTypes_GetByResourceGroup + +```java +/** + * Samples for SolutionTypes GetByResourceGroup. + */ +public final class SolutionTypesGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionTypes_Get.json + */ + /** + * Sample code: SolutionTypes_Get. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionTypesGet(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionTypes() + .getByResourceGroupWithResponse("rgpublicCloud", "lulzqllpu", com.azure.core.util.Context.NONE); + } +} +``` + +### SolutionTypes_List + +```java +/** + * Samples for SolutionTypes List. + */ +public final class SolutionTypesListSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionTypes_ListBySubscription.json + */ + /** + * Sample code: SolutionTypes_ListBySubscription. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void solutionTypesListBySubscription( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionTypes().list(com.azure.core.util.Context.NONE); + } +} +``` + +### SolutionTypes_ListByResourceGroup + +```java +/** + * Samples for SolutionTypes ListByResourceGroup. + */ +public final class SolutionTypesListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionTypes_ListByResourceGroup.json + */ + /** + * Sample code: SolutionTypes_ListByResourceGroup. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void solutionTypesListByResourceGroup( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionTypes().listByResourceGroup("rgpublicCloud", com.azure.core.util.Context.NONE); + } +} +``` + diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/pom.xml b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/pom.xml index 7019e71ebf74..d6c1fe4d0ae7 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/pom.xml +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -17,8 +17,8 @@ 1.2.0-beta.1 jar - Microsoft Azure SDK for HybridConnectivity Management - This package contains Microsoft Azure SDK for HybridConnectivity Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for Hybrid Connectivity. Package tag package-2023-03. + Microsoft Azure SDK for Hybrid Connectivity Management + This package contains Microsoft Azure SDK for Hybrid Connectivity Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for public clouds. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true false diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/HybridConnectivityManager.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/HybridConnectivityManager.java index b4c53ea39683..d2381b4adbf6 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/HybridConnectivityManager.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/HybridConnectivityManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity; @@ -22,25 +22,37 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hybridconnectivity.fluent.HybridConnectivityManagementApi; +import com.azure.resourcemanager.hybridconnectivity.fluent.HybridConnectivityMgmtClient; import com.azure.resourcemanager.hybridconnectivity.implementation.EndpointsImpl; -import com.azure.resourcemanager.hybridconnectivity.implementation.HybridConnectivityManagementApiBuilder; +import com.azure.resourcemanager.hybridconnectivity.implementation.GenerateAwsTemplatesImpl; +import com.azure.resourcemanager.hybridconnectivity.implementation.HybridConnectivityMgmtClientBuilder; +import com.azure.resourcemanager.hybridconnectivity.implementation.InventoriesImpl; import com.azure.resourcemanager.hybridconnectivity.implementation.OperationsImpl; +import com.azure.resourcemanager.hybridconnectivity.implementation.PublicCloudConnectorsImpl; import com.azure.resourcemanager.hybridconnectivity.implementation.ServiceConfigurationsImpl; +import com.azure.resourcemanager.hybridconnectivity.implementation.SolutionConfigurationsImpl; +import com.azure.resourcemanager.hybridconnectivity.implementation.SolutionTypesImpl; import com.azure.resourcemanager.hybridconnectivity.models.Endpoints; +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplates; +import com.azure.resourcemanager.hybridconnectivity.models.Inventories; import com.azure.resourcemanager.hybridconnectivity.models.Operations; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectors; import com.azure.resourcemanager.hybridconnectivity.models.ServiceConfigurations; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurations; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypes; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; /** * Entry point to HybridConnectivityManager. - * REST API for Hybrid Connectivity. + * REST API for public clouds. */ public final class HybridConnectivityManager { private Operations operations; @@ -49,23 +61,34 @@ public final class HybridConnectivityManager { private ServiceConfigurations serviceConfigurations; - private final HybridConnectivityManagementApi clientObject; + private GenerateAwsTemplates generateAwsTemplates; + + private PublicCloudConnectors publicCloudConnectors; + + private SolutionConfigurations solutionConfigurations; + + private Inventories inventories; + + private SolutionTypes solutionTypes; + + private final HybridConnectivityMgmtClient clientObject; private HybridConnectivityManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new HybridConnectivityManagementApiBuilder().pipeline(httpPipeline) + this.clientObject = new HybridConnectivityMgmtClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) .buildClient(); } /** - * Creates an instance of HybridConnectivity service API entry point. + * Creates an instance of Hybrid Connectivity service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the HybridConnectivity service API instance. + * @return the Hybrid Connectivity service API instance. */ public static HybridConnectivityManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -74,11 +97,11 @@ public static HybridConnectivityManager authenticate(TokenCredential credential, } /** - * Creates an instance of HybridConnectivity service API entry point. + * Creates an instance of Hybrid Connectivity service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the HybridConnectivity service API instance. + * @return the Hybrid Connectivity service API instance. */ public static HybridConnectivityManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -100,6 +123,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-hybridconnectivity.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -197,22 +223,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of HybridConnectivity service API entry point. + * Creates an instance of Hybrid Connectivity service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the HybridConnectivity service API instance. + * @return the Hybrid Connectivity service API instance. */ public HybridConnectivityManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.hybridconnectivity") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -295,12 +323,73 @@ public ServiceConfigurations serviceConfigurations() { } /** - * Gets wrapped service client HybridConnectivityManagementApi providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets the resource collection API of GenerateAwsTemplates. + * + * @return Resource collection API of GenerateAwsTemplates. + */ + public GenerateAwsTemplates generateAwsTemplates() { + if (this.generateAwsTemplates == null) { + this.generateAwsTemplates = new GenerateAwsTemplatesImpl(clientObject.getGenerateAwsTemplates(), this); + } + return generateAwsTemplates; + } + + /** + * Gets the resource collection API of PublicCloudConnectors. It manages PublicCloudConnector. + * + * @return Resource collection API of PublicCloudConnectors. + */ + public PublicCloudConnectors publicCloudConnectors() { + if (this.publicCloudConnectors == null) { + this.publicCloudConnectors = new PublicCloudConnectorsImpl(clientObject.getPublicCloudConnectors(), this); + } + return publicCloudConnectors; + } + + /** + * Gets the resource collection API of SolutionConfigurations. It manages SolutionConfiguration. + * + * @return Resource collection API of SolutionConfigurations. + */ + public SolutionConfigurations solutionConfigurations() { + if (this.solutionConfigurations == null) { + this.solutionConfigurations + = new SolutionConfigurationsImpl(clientObject.getSolutionConfigurations(), this); + } + return solutionConfigurations; + } + + /** + * Gets the resource collection API of Inventories. + * + * @return Resource collection API of Inventories. + */ + public Inventories inventories() { + if (this.inventories == null) { + this.inventories = new InventoriesImpl(clientObject.getInventories(), this); + } + return inventories; + } + + /** + * Gets the resource collection API of SolutionTypes. + * + * @return Resource collection API of SolutionTypes. + */ + public SolutionTypes solutionTypes() { + if (this.solutionTypes == null) { + this.solutionTypes = new SolutionTypesImpl(clientObject.getSolutionTypes(), this); + } + return solutionTypes; + } + + /** + * Gets wrapped service client HybridConnectivityMgmtClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. * - * @return Wrapped service client HybridConnectivityManagementApi. + * @return Wrapped service client HybridConnectivityMgmtClient. */ - public HybridConnectivityManagementApi serviceClient() { + public HybridConnectivityMgmtClient serviceClient() { return this.clientObject; } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/EndpointsClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/EndpointsClient.java index 6b5984063fe4..07c88c47b28c 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/EndpointsClient.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/EndpointsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.fluent; @@ -21,35 +21,10 @@ * An instance of this class provides access to all the operations defined in EndpointsClient. */ public interface EndpointsClient { - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri); - - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceUri, Context context); - /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -63,7 +38,7 @@ public interface EndpointsClient { /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -76,7 +51,7 @@ public interface EndpointsClient { /** * Create or update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @param context The context to associate with this operation. @@ -92,7 +67,7 @@ Response createOrUpdateWithResponse(String resourceUri, S /** * Create or update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,7 +82,7 @@ EndpointResourceInner createOrUpdate(String resourceUri, String endpointName, /** * Update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @param context The context to associate with this operation. @@ -123,7 +98,7 @@ Response updateWithResponse(String resourceUri, String en /** * Update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -137,7 +112,7 @@ Response updateWithResponse(String resourceUri, String en /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -151,7 +126,7 @@ Response updateWithResponse(String resourceUri, String en /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -160,10 +135,35 @@ Response updateWithResponse(String resourceUri, String en @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceUri, String endpointName); + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); + /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listCredentialsRequest Object of type ListCredentialsRequest. @@ -180,7 +180,7 @@ Response listCredentialsWithResponse(String resourc /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -193,7 +193,7 @@ Response listCredentialsWithResponse(String resourc /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listIngressGatewayCredentialsRequest Object of type ListIngressGatewayCredentialsRequest. @@ -211,7 +211,7 @@ Response listIngressGatewayCredentialsWithResponse( /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -224,7 +224,7 @@ Response listIngressGatewayCredentialsWithResponse( /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @param context The context to associate with this operation. @@ -240,7 +240,7 @@ Response listManagedProxyDetailsWithResponse(String r /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/GenerateAwsTemplatesClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/GenerateAwsTemplatesClient.java new file mode 100644 index 000000000000..c78e8ad22d7e --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/GenerateAwsTemplatesClient.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PostResponseInner; +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplateRequest; + +/** + * An instance of this class provides access to all the operations defined in GenerateAwsTemplatesClient. + */ +public interface GenerateAwsTemplatesClient { + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response postWithResponse(GenerateAwsTemplateRequest generateAwsTemplateRequest, + Context context); + + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PostResponseInner post(GenerateAwsTemplateRequest generateAwsTemplateRequest); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/HybridConnectivityManagementApi.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/HybridConnectivityManagementApi.java deleted file mode 100644 index e5b7ddf848fc..000000000000 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/HybridConnectivityManagementApi.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.hybridconnectivity.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** - * The interface for HybridConnectivityManagementApi class. - */ -public interface HybridConnectivityManagementApi { - /** - * 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 EndpointsClient object to access its operations. - * - * @return the EndpointsClient object. - */ - EndpointsClient getEndpoints(); - - /** - * Gets the ServiceConfigurationsClient object to access its operations. - * - * @return the ServiceConfigurationsClient object. - */ - ServiceConfigurationsClient getServiceConfigurations(); -} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/HybridConnectivityMgmtClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/HybridConnectivityMgmtClient.java new file mode 100644 index 000000000000..2c551213b9e8 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/HybridConnectivityMgmtClient.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for HybridConnectivityMgmtClient class. + */ +public interface HybridConnectivityMgmtClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @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 EndpointsClient object to access its operations. + * + * @return the EndpointsClient object. + */ + EndpointsClient getEndpoints(); + + /** + * Gets the ServiceConfigurationsClient object to access its operations. + * + * @return the ServiceConfigurationsClient object. + */ + ServiceConfigurationsClient getServiceConfigurations(); + + /** + * Gets the GenerateAwsTemplatesClient object to access its operations. + * + * @return the GenerateAwsTemplatesClient object. + */ + GenerateAwsTemplatesClient getGenerateAwsTemplates(); + + /** + * Gets the PublicCloudConnectorsClient object to access its operations. + * + * @return the PublicCloudConnectorsClient object. + */ + PublicCloudConnectorsClient getPublicCloudConnectors(); + + /** + * Gets the SolutionConfigurationsClient object to access its operations. + * + * @return the SolutionConfigurationsClient object. + */ + SolutionConfigurationsClient getSolutionConfigurations(); + + /** + * Gets the InventoriesClient object to access its operations. + * + * @return the InventoriesClient object. + */ + InventoriesClient getInventories(); + + /** + * Gets the SolutionTypesClient object to access its operations. + * + * @return the SolutionTypesClient object. + */ + SolutionTypesClient getSolutionTypes(); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/InventoriesClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/InventoriesClient.java new file mode 100644 index 000000000000..64097824e2d3 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/InventoriesClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.InventoryResourceInner; + +/** + * An instance of this class provides access to all the operations defined in InventoriesClient. + */ +public interface InventoriesClient { + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 a InventoryResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, String solutionConfiguration, + String inventoryId, Context context); + + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 InventoryResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + InventoryResourceInner get(String resourceUri, String solutionConfiguration, String inventoryId); + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySolutionConfiguration(String resourceUri, String solutionConfiguration); + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBySolutionConfiguration(String resourceUri, String solutionConfiguration, + Context context); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/OperationsClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/OperationsClient.java index d8c9fc8cb011..fc11b01f3b90 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/OperationsClient.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.fluent; @@ -15,7 +15,7 @@ */ public interface OperationsClient { /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -26,7 +26,7 @@ public interface OperationsClient { PagedIterable list(); /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java new file mode 100644 index 000000000000..83728ede6a4a --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/PublicCloudConnectorsClient.java @@ -0,0 +1,270 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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.hybridconnectivity.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PublicCloudConnectorInner; + +/** + * An instance of this class provides access to all the operations defined in PublicCloudConnectorsClient. + */ +public interface PublicCloudConnectorsClient { + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 a PublicCloudConnector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String publicCloudConnector, Context context); + + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 PublicCloudConnector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicCloudConnectorInner getByResourceGroup(String resourceGroupName, String publicCloudConnector); + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PublicCloudConnectorInner> + beginCreateOrUpdate(String resourceGroupName, String publicCloudConnector, PublicCloudConnectorInner resource); + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PublicCloudConnectorInner> beginCreateOrUpdate( + String resourceGroupName, String publicCloudConnector, PublicCloudConnectorInner resource, Context context); + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicCloudConnectorInner createOrUpdate(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner resource); + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicCloudConnectorInner createOrUpdate(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner resource, Context context); + + /** + * Update a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner properties, Context context); + + /** + * Update a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PublicCloudConnectorInner update(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner properties); + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceGroupName, String publicCloudConnector, Context context); + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 publicCloudConnector); + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> + beginTestPermissions(String resourceGroupName, String publicCloudConnector); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> + beginTestPermissions(String resourceGroupName, String publicCloudConnector, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner testPermissions(String resourceGroupName, String publicCloudConnector); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner testPermissions(String resourceGroupName, String publicCloudConnector, Context context); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/ServiceConfigurationsClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/ServiceConfigurationsClient.java index a78e41e97562..ca4b20a11775 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/ServiceConfigurationsClient.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/ServiceConfigurationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.fluent; @@ -16,42 +16,10 @@ * An instance of this class provides access to all the operations defined in ServiceConfigurationsClient. */ public interface ServiceConfigurationsClient { - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByEndpointResource(String resourceUri, String endpointName); - - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByEndpointResource(String resourceUri, String endpointName, - Context context); - /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param context The context to associate with this operation. @@ -67,7 +35,7 @@ Response getWithResponse(String resourceUri, /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -81,7 +49,7 @@ Response getWithResponse(String resourceUri, /** * Create or update a service in serviceConfiguration for the endpoint resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -99,7 +67,7 @@ Response createOrupdateWithResponse(String re /** * Create or update a service in serviceConfiguration for the endpoint resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -115,7 +83,7 @@ ServiceConfigurationResourceInner createOrupdate(String resourceUri, String endp /** * Update the service details in the service configurations of the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -133,7 +101,7 @@ Response updateWithResponse(String resourceUr /** * Update the service details in the service configurations of the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -149,7 +117,7 @@ ServiceConfigurationResourceInner update(String resourceUri, String endpointName /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param context The context to associate with this operation. @@ -165,7 +133,7 @@ Response deleteWithResponse(String resourceUri, String endpointName, Strin /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -174,4 +142,36 @@ Response deleteWithResponse(String resourceUri, String endpointName, Strin */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceUri, String endpointName, String serviceConfigurationName); + + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpointResource(String resourceUri, String endpointName); + + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByEndpointResource(String resourceUri, String endpointName, + Context context); } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/SolutionConfigurationsClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/SolutionConfigurationsClient.java new file mode 100644 index 000000000000..d94675e0a2bc --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/SolutionConfigurationsClient.java @@ -0,0 +1,217 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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.hybridconnectivity.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionConfigurationInner; + +/** + * An instance of this class provides access to all the operations defined in SolutionConfigurationsClient. + */ +public interface SolutionConfigurationsClient { + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 a SolutionConfiguration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceUri, String solutionConfiguration, + Context context); + + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 SolutionConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SolutionConfigurationInner get(String resourceUri, String solutionConfiguration); + + /** + * Create a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner resource, Context context); + + /** + * Create a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SolutionConfigurationInner createOrUpdate(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner resource); + + /** + * Update a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner properties, Context context); + + /** + * Update a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SolutionConfigurationInner update(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner properties); + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response deleteWithResponse(String resourceUri, String solutionConfiguration, Context context); + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 resourceUri, String solutionConfiguration); + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri); + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceUri, Context context); + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginSyncNow(String resourceUri, + String solutionConfiguration); + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusResultInner> beginSyncNow(String resourceUri, + String solutionConfiguration, Context context); + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner syncNow(String resourceUri, String solutionConfiguration); + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusResultInner syncNow(String resourceUri, String solutionConfiguration, Context context); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/SolutionTypesClient.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/SolutionTypesClient.java new file mode 100644 index 000000000000..831abca474a4 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/SolutionTypesClient.java @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionTypeResourceInner; + +/** + * An instance of this class provides access to all the operations defined in SolutionTypesClient. + */ +public interface SolutionTypesClient { + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 a SolutionTypeResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String solutionType, + Context context); + + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 SolutionTypeResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SolutionTypeResourceInner getByResourceGroup(String resourceGroupName, String solutionType); + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/AadProfileProperties.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/AadProfileProperties.java index 2ae68ae3d4b2..5baad65e2446 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/AadProfileProperties.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/AadProfileProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -15,7 +15,7 @@ /** * The AAD Profile. */ -@Fluent +@Immutable public final class AadProfileProperties implements JsonSerializable { /* * The arc ingress gateway server app id. @@ -30,7 +30,7 @@ public final class AadProfileProperties implements JsonSerializable { /* * Azure relay hybrid connection access properties @@ -24,7 +24,7 @@ public final class EndpointAccessResourceInner implements JsonSerializable { /* * Azure relay hybrid connection access properties @@ -29,7 +29,7 @@ public final class IngressGatewayResourceInner implements JsonSerializable { /* * The ingress hostname. @@ -25,12 +25,12 @@ public final class IngressProfileProperties implements JsonSerializable { + InventoryResourceInner deserializedInventoryResourceInner = new InventoryResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedInventoryResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedInventoryResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedInventoryResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedInventoryResourceInner.properties = InventoryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedInventoryResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedInventoryResourceInner; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/ManagedProxyResourceInner.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/ManagedProxyResourceInner.java index da4767dd13a4..1dd10e971eef 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/ManagedProxyResourceInner.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/ManagedProxyResourceInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -15,7 +15,7 @@ /** * Managed Proxy. */ -@Fluent +@Immutable public final class ManagedProxyResourceInner implements JsonSerializable { /* * The short lived proxy name. @@ -30,7 +30,7 @@ public final class ManagedProxyResourceInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -28,8 +26,8 @@ public final class OperationInner implements JsonSerializable { private String name; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; @@ -45,14 +43,14 @@ public final class OperationInner implements JsonSerializable { private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ private ActionType actionType; /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -67,7 +65,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -84,17 +82,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: Localized display information for this particular 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: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". @@ -106,8 +93,8 @@ public Origin origin() { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/OperationStatusResultInner.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..4e7c59629b20 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Immutable +public final class OperationStatusResultInner implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Double percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The operations list. + */ + private List operations; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + private OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Double percentComplete() { + return this.percentComplete; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property status in model OperationStatusResultInner")); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getDouble); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResultInner.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/PostResponseInner.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/PostResponseInner.java new file mode 100644 index 000000000000..d27c7840aa58 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/PostResponseInner.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The PostResponse model. + */ +@Immutable +public final class PostResponseInner implements JsonSerializable { + /** + * Creates an instance of PostResponseInner class. + */ + private PostResponseInner() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PostResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PostResponseInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the PostResponseInner. + */ + public static PostResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PostResponseInner deserializedPostResponseInner = new PostResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + reader.skipChildren(); + } + + return deserializedPostResponseInner; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/PublicCloudConnectorInner.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/PublicCloudConnectorInner.java new file mode 100644 index 000000000000..8654efebb8a1 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/PublicCloudConnectorInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Public Cloud Connector. + */ +@Fluent +public final class PublicCloudConnectorInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private PublicCloudConnectorProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of PublicCloudConnectorInner class. + */ + public PublicCloudConnectorInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public PublicCloudConnectorProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the PublicCloudConnectorInner object itself. + */ + public PublicCloudConnectorInner withProperties(PublicCloudConnectorProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public PublicCloudConnectorInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public PublicCloudConnectorInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicCloudConnectorInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicCloudConnectorInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PublicCloudConnectorInner. + */ + public static PublicCloudConnectorInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicCloudConnectorInner deserializedPublicCloudConnectorInner = new PublicCloudConnectorInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPublicCloudConnectorInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPublicCloudConnectorInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPublicCloudConnectorInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPublicCloudConnectorInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPublicCloudConnectorInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedPublicCloudConnectorInner.properties = PublicCloudConnectorProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPublicCloudConnectorInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicCloudConnectorInner; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/RelayNamespaceAccessProperties.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/RelayNamespaceAccessProperties.java index 0a07d209624f..f421fd1ff3c7 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/RelayNamespaceAccessProperties.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/RelayNamespaceAccessProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -15,7 +15,7 @@ /** * Azure relay hybrid connection access properties. */ -@Fluent +@Immutable public final class RelayNamespaceAccessProperties implements JsonSerializable { /* * The namespace name. @@ -50,7 +50,7 @@ public final class RelayNamespaceAccessProperties implements JsonSerializable { + SolutionConfigurationInner deserializedSolutionConfigurationInner = new SolutionConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSolutionConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSolutionConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSolutionConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSolutionConfigurationInner.properties + = SolutionConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSolutionConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSolutionConfigurationInner; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/SolutionTypeResourceInner.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/SolutionTypeResourceInner.java new file mode 100644 index 000000000000..432ff6ea9ac0 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/SolutionTypeResourceInner.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeProperties; +import java.io.IOException; + +/** + * Concrete proxy resource types can be created by aliasing this type using a specific property type. + */ +@Immutable +public final class SolutionTypeResourceInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private SolutionTypeProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of SolutionTypeResourceInner class. + */ + private SolutionTypeResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public SolutionTypeProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SolutionTypeResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SolutionTypeResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SolutionTypeResourceInner. + */ + public static SolutionTypeResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SolutionTypeResourceInner deserializedSolutionTypeResourceInner = new SolutionTypeResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSolutionTypeResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSolutionTypeResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSolutionTypeResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSolutionTypeResourceInner.properties = SolutionTypeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSolutionTypeResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSolutionTypeResourceInner; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/package-info.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/package-info.java index aa6bc5c99f6c..1840f241e629 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/package-info.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for HybridConnectivityManagementApi. - * REST API for Hybrid Connectivity. + * Package containing the inner data models for HybridConnectivity. + * REST API for public clouds. */ package com.azure.resourcemanager.hybridconnectivity.fluent.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/package-info.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/package-info.java index 24f3bcda921c..be29af200175 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/package-info.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for HybridConnectivityManagementApi. - * REST API for Hybrid Connectivity. + * Package containing the service clients for HybridConnectivity. + * REST API for public clouds. */ package com.azure.resourcemanager.hybridconnectivity.fluent; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointAccessResourceImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointAccessResourceImpl.java index 4cc8742ec19f..0fbed932f7cb 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointAccessResourceImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointAccessResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointResourceImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointResourceImpl.java index e699235fc1d8..b7f8f4f7b55f 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointResourceImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointsClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointsClientImpl.java index 8193f5668425..cbaab4192626 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointsClientImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; @@ -35,7 +35,7 @@ import com.azure.resourcemanager.hybridconnectivity.fluent.models.EndpointResourceInner; import com.azure.resourcemanager.hybridconnectivity.fluent.models.IngressGatewayResourceInner; import com.azure.resourcemanager.hybridconnectivity.fluent.models.ManagedProxyResourceInner; -import com.azure.resourcemanager.hybridconnectivity.models.EndpointsList; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.EndpointsList; import com.azure.resourcemanager.hybridconnectivity.models.ListCredentialsRequest; import com.azure.resourcemanager.hybridconnectivity.models.ListIngressGatewayCredentialsRequest; import com.azure.resourcemanager.hybridconnectivity.models.ManagedProxyRequest; @@ -53,235 +53,120 @@ public final class EndpointsClientImpl implements EndpointsClient { /** * The service client containing this operation class. */ - private final HybridConnectivityManagementApiImpl client; + private final HybridConnectivityMgmtClientImpl client; /** * Initializes an instance of EndpointsClientImpl. * * @param client the instance of the service client containing this operation class. */ - EndpointsClientImpl(HybridConnectivityManagementApiImpl client) { + EndpointsClientImpl(HybridConnectivityMgmtClientImpl client) { this.service = RestProxy.create(EndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for HybridConnectivityManagementApiEndpoints to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for HybridConnectivityMgmtClientEndpoints to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "HybridConnectivityMa") + @Host("{endpoint}") + @ServiceInterface(name = "HybridConnectivityMg") public interface EndpointsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, - Context context); - @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, - @BodyParam("application/json") EndpointResourceInner endpointResource, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EndpointResourceInner endpointResource, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Mono> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, - @BodyParam("application/json") EndpointResourceInner endpointResource, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") EndpointResourceInner endpointResource, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Post("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listCredentials") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listCredentials(@HostParam("$host") String endpoint, + Mono> listCredentials(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, - @QueryParam("expiresin") Long expiresin, - @BodyParam("application/json") ListCredentialsRequest listCredentialsRequest, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("expiresin") Long expiresin, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ListCredentialsRequest listCredentialsRequest, Context context); @Headers({ "Content-Type: application/json" }) @Post("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listIngressGatewayCredentials") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listIngressGatewayCredentials(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, + Mono> listIngressGatewayCredentials( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, - @QueryParam("expiresin") Long expiresin, + @QueryParam("expiresin") Long expiresin, @HeaderParam("Accept") String accept, @BodyParam("application/json") ListIngressGatewayCredentialsRequest listIngressGatewayCredentialsRequest, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) @Post("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listManagedProxyDetails") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listManagedProxyDetails(@HostParam("$host") String endpoint, + Mono> listManagedProxyDetails(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, - @BodyParam("application/json") ManagedProxyRequest managedProxyRequest, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ManagedProxyRequest managedProxyRequest, 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 of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceUri) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceUri, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri 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(), resourceUri, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceUri, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri) { - return new PagedIterable<>(listAsync(resourceUri)); - } - - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceUri, Context context) { - return new PagedIterable<>(listAsync(resourceUri, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -310,7 +195,7 @@ private Mono> getWithResponseAsync(String resour /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -340,7 +225,7 @@ private Mono> getWithResponseAsync(String resour /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -355,7 +240,7 @@ private Mono getAsync(String resourceUri, String endpoint /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -371,7 +256,7 @@ public Response getWithResponse(String resourceUri, Strin /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -386,7 +271,7 @@ public EndpointResourceInner get(String resourceUri, String endpointName) { /** * Create or update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -414,17 +299,18 @@ private Mono> createOrUpdateWithResponseAsync(St } else { endpointResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - resourceUri, endpointName, endpointResource, accept, context)) + resourceUri, endpointName, contentType, accept, endpointResource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @param context The context to associate with this operation. @@ -453,16 +339,17 @@ private Mono> createOrUpdateWithResponseAsync(St } else { endpointResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, endpointName, - endpointResource, accept, context); + contentType, accept, endpointResource, context); } /** * Create or update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -480,7 +367,7 @@ private Mono createOrUpdateAsync(String resourceUri, Stri /** * Create or update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @param context The context to associate with this operation. @@ -498,7 +385,7 @@ public Response createOrUpdateWithResponse(String resourc /** * Create or update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -515,7 +402,7 @@ public EndpointResourceInner createOrUpdate(String resourceUri, String endpointN /** * Update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -543,17 +430,18 @@ private Mono> updateWithResponseAsync(String res } else { endpointResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - endpointName, endpointResource, accept, context)) + endpointName, contentType, accept, endpointResource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @param context The context to associate with this operation. @@ -582,16 +470,17 @@ private Mono> updateWithResponseAsync(String res } else { endpointResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, endpointName, - endpointResource, accept, context); + contentType, accept, endpointResource, context); } /** * Update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -609,7 +498,7 @@ private Mono updateAsync(String resourceUri, String endpo /** * Update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @param context The context to associate with this operation. @@ -627,7 +516,7 @@ public Response updateWithResponse(String resourceUri, St /** * Update the endpoint to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param endpointResource Endpoint details. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -644,7 +533,7 @@ public EndpointResourceInner update(String resourceUri, String endpointName, /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -673,7 +562,7 @@ private Mono> deleteWithResponseAsync(String resourceUri, String /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -702,7 +591,7 @@ private Mono> deleteWithResponseAsync(String resourceUri, String /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -717,7 +606,7 @@ private Mono deleteAsync(String resourceUri, String endpointName) { /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -733,7 +622,7 @@ public Response deleteWithResponse(String resourceUri, String endpointName /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -744,10 +633,122 @@ public void delete(String resourceUri, String endpointName) { deleteWithResponse(resourceUri, endpointName, Context.NONE); } + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri 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(), resourceUri, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listCredentialsRequest Object of type ListCredentialsRequest. @@ -776,14 +777,14 @@ private Mono> listCredentialsWithResponseA final String accept = "application/json"; return FluxUtil .withContext(context -> service.listCredentials(this.client.getEndpoint(), this.client.getApiVersion(), - resourceUri, endpointName, expiresin, listCredentialsRequest, accept, context)) + resourceUri, endpointName, expiresin, accept, listCredentialsRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listCredentialsRequest Object of type ListCredentialsRequest. @@ -813,13 +814,13 @@ private Mono> listCredentialsWithResponseA final String accept = "application/json"; context = this.client.mergeContext(context); return service.listCredentials(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - endpointName, expiresin, listCredentialsRequest, accept, context); + endpointName, expiresin, accept, listCredentialsRequest, context); } /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -837,7 +838,7 @@ private Mono listCredentialsAsync(String resourceUr /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listCredentialsRequest Object of type ListCredentialsRequest. @@ -857,7 +858,7 @@ public Response listCredentialsWithResponse(String /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -875,7 +876,7 @@ public EndpointAccessResourceInner listCredentials(String resourceUri, String en /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listIngressGatewayCredentialsRequest Object of type ListIngressGatewayCredentialsRequest. @@ -906,14 +907,14 @@ private Mono> listIngressGatewayCredential return FluxUtil .withContext( context -> service.listIngressGatewayCredentials(this.client.getEndpoint(), this.client.getApiVersion(), - resourceUri, endpointName, expiresin, listIngressGatewayCredentialsRequest, accept, context)) + resourceUri, endpointName, expiresin, accept, listIngressGatewayCredentialsRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listIngressGatewayCredentialsRequest Object of type ListIngressGatewayCredentialsRequest. @@ -944,13 +945,13 @@ private Mono> listIngressGatewayCredential final String accept = "application/json"; context = this.client.mergeContext(context); return service.listIngressGatewayCredentials(this.client.getEndpoint(), this.client.getApiVersion(), - resourceUri, endpointName, expiresin, listIngressGatewayCredentialsRequest, accept, context); + resourceUri, endpointName, expiresin, accept, listIngressGatewayCredentialsRequest, context); } /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -969,7 +970,7 @@ private Mono listIngressGatewayCredentialsAsync(Str /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listIngressGatewayCredentialsRequest Object of type ListIngressGatewayCredentialsRequest. @@ -990,7 +991,7 @@ public Response listIngressGatewayCredentialsWithRe /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1008,7 +1009,7 @@ public IngressGatewayResourceInner listIngressGatewayCredentials(String resource /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1035,17 +1036,19 @@ private Mono> listManagedProxyDetailsWithRes } else { managedProxyRequest.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listManagedProxyDetails(this.client.getEndpoint(), - this.client.getApiVersion(), resourceUri, endpointName, managedProxyRequest, accept, context)) + .withContext( + context -> service.listManagedProxyDetails(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, endpointName, contentType, accept, managedProxyRequest, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @param context The context to associate with this operation. @@ -1073,16 +1076,17 @@ private Mono> listManagedProxyDetailsWithRes } else { managedProxyRequest.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.listManagedProxyDetails(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - endpointName, managedProxyRequest, accept, context); + endpointName, contentType, accept, managedProxyRequest, context); } /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1100,7 +1104,7 @@ private Mono listManagedProxyDetailsAsync(String reso /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @param context The context to associate with this operation. @@ -1119,7 +1123,7 @@ public Response listManagedProxyDetailsWithResponse(S /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointsImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointsImpl.java index 57831e4e540f..29f8477629ab 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointsImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/EndpointsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; @@ -36,16 +36,6 @@ public EndpointsImpl(EndpointsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String resourceUri) { - PagedIterable inner = this.serviceClient().list(resourceUri); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceUri, Context context) { - PagedIterable inner = this.serviceClient().list(resourceUri, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointResourceImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceUri, String endpointName, Context context) { Response inner = this.serviceClient().getWithResponse(resourceUri, endpointName, context); @@ -74,6 +64,16 @@ public void deleteByResourceGroup(String resourceUri, String endpointName) { this.serviceClient().delete(resourceUri, endpointName); } + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EndpointResourceImpl(inner1, this.manager())); + } + public Response listCredentialsWithResponse(String resourceUri, String endpointName, Long expiresin, ListCredentialsRequest listCredentialsRequest, Context context) { Response inner = this.serviceClient() diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/GenerateAwsTemplatesClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/GenerateAwsTemplatesClientImpl.java new file mode 100644 index 000000000000..ca8a9603de6d --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/GenerateAwsTemplatesClientImpl.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hybridconnectivity.fluent.GenerateAwsTemplatesClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PostResponseInner; +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplateRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GenerateAwsTemplatesClient. + */ +public final class GenerateAwsTemplatesClientImpl implements GenerateAwsTemplatesClient { + /** + * The proxy service used to perform REST calls. + */ + private final GenerateAwsTemplatesService service; + + /** + * The service client containing this operation class. + */ + private final HybridConnectivityMgmtClientImpl client; + + /** + * Initializes an instance of GenerateAwsTemplatesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GenerateAwsTemplatesClientImpl(HybridConnectivityMgmtClientImpl client) { + this.service = RestProxy.create(GenerateAwsTemplatesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridConnectivityMgmtClientGenerateAwsTemplates to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HybridConnectivityMg") + public interface GenerateAwsTemplatesService { + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/generateAwsTemplate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> post(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GenerateAwsTemplateRequest generateAwsTemplateRequest, Context context); + } + + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + postWithResponseAsync(GenerateAwsTemplateRequest generateAwsTemplateRequest) { + 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 (generateAwsTemplateRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter generateAwsTemplateRequest is required and cannot be null.")); + } else { + generateAwsTemplateRequest.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, generateAwsTemplateRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + postWithResponseAsync(GenerateAwsTemplateRequest generateAwsTemplateRequest, 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 (generateAwsTemplateRequest == null) { + return Mono.error( + new IllegalArgumentException("Parameter generateAwsTemplateRequest is required and cannot be null.")); + } else { + generateAwsTemplateRequest.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.post(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + contentType, accept, generateAwsTemplateRequest, context); + } + + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono postAsync(GenerateAwsTemplateRequest generateAwsTemplateRequest) { + return postWithResponseAsync(generateAwsTemplateRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postWithResponse(GenerateAwsTemplateRequest generateAwsTemplateRequest, + Context context) { + return postWithResponseAsync(generateAwsTemplateRequest, context).block(); + } + + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PostResponseInner post(GenerateAwsTemplateRequest generateAwsTemplateRequest) { + return postWithResponse(generateAwsTemplateRequest, Context.NONE).getValue(); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/GenerateAwsTemplatesImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/GenerateAwsTemplatesImpl.java new file mode 100644 index 000000000000..c06e80a63fd2 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/GenerateAwsTemplatesImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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.hybridconnectivity.fluent.GenerateAwsTemplatesClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PostResponseInner; +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplateRequest; +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplates; +import com.azure.resourcemanager.hybridconnectivity.models.PostResponse; + +public final class GenerateAwsTemplatesImpl implements GenerateAwsTemplates { + private static final ClientLogger LOGGER = new ClientLogger(GenerateAwsTemplatesImpl.class); + + private final GenerateAwsTemplatesClient innerClient; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + public GenerateAwsTemplatesImpl(GenerateAwsTemplatesClient innerClient, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response postWithResponse(GenerateAwsTemplateRequest generateAwsTemplateRequest, + Context context) { + Response inner = this.serviceClient().postWithResponse(generateAwsTemplateRequest, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PostResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PostResponse post(GenerateAwsTemplateRequest generateAwsTemplateRequest) { + PostResponseInner inner = this.serviceClient().post(generateAwsTemplateRequest); + if (inner != null) { + return new PostResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private GenerateAwsTemplatesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityManagementApiBuilder.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityMgmtClientBuilder.java similarity index 61% rename from sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityManagementApiBuilder.java rename to sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityMgmtClientBuilder.java index b55c5f896862..98c4e5347941 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityManagementApiBuilder.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityMgmtClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; @@ -15,26 +15,42 @@ import java.time.Duration; /** - * A builder for creating a new instance of the HybridConnectivityManagementApiImpl type. + * A builder for creating a new instance of the HybridConnectivityMgmtClientImpl type. */ -@ServiceClientBuilder(serviceClients = { HybridConnectivityManagementApiImpl.class }) -public final class HybridConnectivityManagementApiBuilder { +@ServiceClientBuilder(serviceClients = { HybridConnectivityMgmtClientImpl.class }) +public final class HybridConnectivityMgmtClientBuilder { /* - * server parameter + * Service host */ private String endpoint; /** - * Sets server parameter. + * Sets Service host. * * @param endpoint the endpoint value. - * @return the HybridConnectivityManagementApiBuilder. + * @return the HybridConnectivityMgmtClientBuilder. */ - public HybridConnectivityManagementApiBuilder endpoint(String endpoint) { + public HybridConnectivityMgmtClientBuilder endpoint(String endpoint) { this.endpoint = endpoint; return this; } + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the HybridConnectivityMgmtClientBuilder. + */ + public HybridConnectivityMgmtClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + /* * The environment to connect to */ @@ -44,9 +60,9 @@ public HybridConnectivityManagementApiBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the HybridConnectivityManagementApiBuilder. + * @return the HybridConnectivityMgmtClientBuilder. */ - public HybridConnectivityManagementApiBuilder environment(AzureEnvironment environment) { + public HybridConnectivityMgmtClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -60,9 +76,9 @@ public HybridConnectivityManagementApiBuilder environment(AzureEnvironment envir * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the HybridConnectivityManagementApiBuilder. + * @return the HybridConnectivityMgmtClientBuilder. */ - public HybridConnectivityManagementApiBuilder pipeline(HttpPipeline pipeline) { + public HybridConnectivityMgmtClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -76,9 +92,9 @@ public HybridConnectivityManagementApiBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the HybridConnectivityManagementApiBuilder. + * @return the HybridConnectivityMgmtClientBuilder. */ - public HybridConnectivityManagementApiBuilder defaultPollInterval(Duration defaultPollInterval) { + public HybridConnectivityMgmtClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -92,19 +108,19 @@ public HybridConnectivityManagementApiBuilder defaultPollInterval(Duration defau * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the HybridConnectivityManagementApiBuilder. + * @return the HybridConnectivityMgmtClientBuilder. */ - public HybridConnectivityManagementApiBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public HybridConnectivityMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of HybridConnectivityManagementApiImpl with the provided parameters. + * Builds an instance of HybridConnectivityMgmtClientImpl with the provided parameters. * - * @return an instance of HybridConnectivityManagementApiImpl. + * @return an instance of HybridConnectivityMgmtClientImpl. */ - public HybridConnectivityManagementApiImpl buildClient() { + public HybridConnectivityMgmtClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -115,8 +131,8 @@ public HybridConnectivityManagementApiImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - HybridConnectivityManagementApiImpl client = new HybridConnectivityManagementApiImpl(localPipeline, - localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint); + HybridConnectivityMgmtClientImpl client = new HybridConnectivityMgmtClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityManagementApiImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityMgmtClientImpl.java similarity index 71% rename from sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityManagementApiImpl.java rename to sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityMgmtClientImpl.java index fb5238c63857..f326763b6239 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityManagementApiImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/HybridConnectivityMgmtClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; @@ -24,9 +24,14 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.hybridconnectivity.fluent.EndpointsClient; -import com.azure.resourcemanager.hybridconnectivity.fluent.HybridConnectivityManagementApi; +import com.azure.resourcemanager.hybridconnectivity.fluent.GenerateAwsTemplatesClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.HybridConnectivityMgmtClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.InventoriesClient; import com.azure.resourcemanager.hybridconnectivity.fluent.OperationsClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.PublicCloudConnectorsClient; import com.azure.resourcemanager.hybridconnectivity.fluent.ServiceConfigurationsClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.SolutionConfigurationsClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.SolutionTypesClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -37,17 +42,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the HybridConnectivityManagementApiImpl type. + * Initializes a new instance of the HybridConnectivityMgmtClientImpl type. */ -@ServiceClient(builder = HybridConnectivityManagementApiBuilder.class) -public final class HybridConnectivityManagementApiImpl implements HybridConnectivityManagementApi { +@ServiceClient(builder = HybridConnectivityMgmtClientBuilder.class) +public final class HybridConnectivityMgmtClientImpl implements HybridConnectivityMgmtClient { /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -56,12 +61,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -69,6 +74,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -154,24 +173,101 @@ public ServiceConfigurationsClient getServiceConfigurations() { } /** - * Initializes an instance of HybridConnectivityManagementApi client. + * The GenerateAwsTemplatesClient object to access its operations. + */ + private final GenerateAwsTemplatesClient generateAwsTemplates; + + /** + * Gets the GenerateAwsTemplatesClient object to access its operations. + * + * @return the GenerateAwsTemplatesClient object. + */ + public GenerateAwsTemplatesClient getGenerateAwsTemplates() { + return this.generateAwsTemplates; + } + + /** + * The PublicCloudConnectorsClient object to access its operations. + */ + private final PublicCloudConnectorsClient publicCloudConnectors; + + /** + * Gets the PublicCloudConnectorsClient object to access its operations. + * + * @return the PublicCloudConnectorsClient object. + */ + public PublicCloudConnectorsClient getPublicCloudConnectors() { + return this.publicCloudConnectors; + } + + /** + * The SolutionConfigurationsClient object to access its operations. + */ + private final SolutionConfigurationsClient solutionConfigurations; + + /** + * Gets the SolutionConfigurationsClient object to access its operations. + * + * @return the SolutionConfigurationsClient object. + */ + public SolutionConfigurationsClient getSolutionConfigurations() { + return this.solutionConfigurations; + } + + /** + * The InventoriesClient object to access its operations. + */ + private final InventoriesClient inventories; + + /** + * Gets the InventoriesClient object to access its operations. + * + * @return the InventoriesClient object. + */ + public InventoriesClient getInventories() { + return this.inventories; + } + + /** + * The SolutionTypesClient object to access its operations. + */ + private final SolutionTypesClient solutionTypes; + + /** + * Gets the SolutionTypesClient object to access its operations. + * + * @return the SolutionTypesClient object. + */ + public SolutionTypesClient getSolutionTypes() { + return this.solutionTypes; + } + + /** + * Initializes an instance of HybridConnectivityMgmtClient 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 endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ - HybridConnectivityManagementApiImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String endpoint) { + HybridConnectivityMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; - this.apiVersion = "2023-03-15"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2024-12-01"; this.operations = new OperationsClientImpl(this); this.endpoints = new EndpointsClientImpl(this); this.serviceConfigurations = new ServiceConfigurationsClientImpl(this); + this.generateAwsTemplates = new GenerateAwsTemplatesClientImpl(this); + this.publicCloudConnectors = new PublicCloudConnectorsClientImpl(this); + this.solutionConfigurations = new SolutionConfigurationsClientImpl(this); + this.inventories = new InventoriesClientImpl(this); + this.solutionTypes = new SolutionTypesClientImpl(this); } /** @@ -300,5 +396,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(HybridConnectivityManagementApiImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(HybridConnectivityMgmtClientImpl.class); } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/IngressGatewayResourceImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/IngressGatewayResourceImpl.java index 540f39e91aaf..6dcfe82e8516 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/IngressGatewayResourceImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/IngressGatewayResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoriesClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoriesClientImpl.java new file mode 100644 index 000000000000..dec3d111ce5c --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoriesClientImpl.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hybridconnectivity.fluent.InventoriesClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.InventoryResourceInner; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.InventoryResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in InventoriesClient. + */ +public final class InventoriesClientImpl implements InventoriesClient { + /** + * The proxy service used to perform REST calls. + */ + private final InventoriesService service; + + /** + * The service client containing this operation class. + */ + private final HybridConnectivityMgmtClientImpl client; + + /** + * Initializes an instance of InventoriesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + InventoriesClientImpl(HybridConnectivityMgmtClientImpl client) { + this.service + = RestProxy.create(InventoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridConnectivityMgmtClientInventories to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HybridConnectivityMg") + public interface InventoriesService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory/{inventoryId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("solutionConfiguration") String solutionConfiguration, + @PathParam("inventoryId") String inventoryId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/inventory") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySolutionConfiguration(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("solutionConfiguration") String solutionConfiguration, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySolutionConfigurationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 InventoryResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, + String solutionConfiguration, String inventoryId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + if (inventoryId == null) { + return Mono.error(new IllegalArgumentException("Parameter inventoryId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, inventoryId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 a InventoryResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, + String solutionConfiguration, String inventoryId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + if (inventoryId == null) { + return Mono.error(new IllegalArgumentException("Parameter inventoryId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, solutionConfiguration, + inventoryId, accept, context); + } + + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 InventoryResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri, String solutionConfiguration, + String inventoryId) { + return getWithResponseAsync(resourceUri, solutionConfiguration, inventoryId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 a InventoryResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, String solutionConfiguration, + String inventoryId, Context context) { + return getWithResponseAsync(resourceUri, solutionConfiguration, inventoryId, context).block(); + } + + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 InventoryResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public InventoryResourceInner get(String resourceUri, String solutionConfiguration, String inventoryId) { + return getWithResponse(resourceUri, solutionConfiguration, inventoryId, Context.NONE).getValue(); + } + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySolutionConfigurationSinglePageAsync(String resourceUri, + String solutionConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBySolutionConfiguration(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, solutionConfiguration, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySolutionConfigurationSinglePageAsync(String resourceUri, + String solutionConfiguration, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySolutionConfiguration(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySolutionConfigurationAsync(String resourceUri, + String solutionConfiguration) { + return new PagedFlux<>(() -> listBySolutionConfigurationSinglePageAsync(resourceUri, solutionConfiguration), + nextLink -> listBySolutionConfigurationNextSinglePageAsync(nextLink)); + } + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySolutionConfigurationAsync(String resourceUri, + String solutionConfiguration, Context context) { + return new PagedFlux<>( + () -> listBySolutionConfigurationSinglePageAsync(resourceUri, solutionConfiguration, context), + nextLink -> listBySolutionConfigurationNextSinglePageAsync(nextLink, context)); + } + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySolutionConfiguration(String resourceUri, + String solutionConfiguration) { + return new PagedIterable<>(listBySolutionConfigurationAsync(resourceUri, solutionConfiguration)); + } + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySolutionConfiguration(String resourceUri, + String solutionConfiguration, Context context) { + return new PagedIterable<>(listBySolutionConfigurationAsync(resourceUri, solutionConfiguration, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a InventoryResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listBySolutionConfigurationNextSinglePageAsync(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.listBySolutionConfigurationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a InventoryResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySolutionConfigurationNextSinglePageAsync(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.listBySolutionConfigurationNext(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/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoriesImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoriesImpl.java new file mode 100644 index 000000000000..908f29249791 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoriesImpl.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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.hybridconnectivity.fluent.InventoriesClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.InventoryResourceInner; +import com.azure.resourcemanager.hybridconnectivity.models.Inventories; +import com.azure.resourcemanager.hybridconnectivity.models.InventoryResource; + +public final class InventoriesImpl implements Inventories { + private static final ClientLogger LOGGER = new ClientLogger(InventoriesImpl.class); + + private final InventoriesClient innerClient; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + public InventoriesImpl(InventoriesClient innerClient, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceUri, String solutionConfiguration, + String inventoryId, Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceUri, solutionConfiguration, inventoryId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new InventoryResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public InventoryResource get(String resourceUri, String solutionConfiguration, String inventoryId) { + InventoryResourceInner inner = this.serviceClient().get(resourceUri, solutionConfiguration, inventoryId); + if (inner != null) { + return new InventoryResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listBySolutionConfiguration(String resourceUri, + String solutionConfiguration) { + PagedIterable inner + = this.serviceClient().listBySolutionConfiguration(resourceUri, solutionConfiguration); + return ResourceManagerUtils.mapPage(inner, inner1 -> new InventoryResourceImpl(inner1, this.manager())); + } + + public PagedIterable listBySolutionConfiguration(String resourceUri, + String solutionConfiguration, Context context) { + PagedIterable inner + = this.serviceClient().listBySolutionConfiguration(resourceUri, solutionConfiguration, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new InventoryResourceImpl(inner1, this.manager())); + } + + private InventoriesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoryResourceImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoryResourceImpl.java new file mode 100644 index 000000000000..e99a742182c6 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/InventoryResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.InventoryResourceInner; +import com.azure.resourcemanager.hybridconnectivity.models.InventoryProperties; +import com.azure.resourcemanager.hybridconnectivity.models.InventoryResource; + +public final class InventoryResourceImpl implements InventoryResource { + private InventoryResourceInner innerObject; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + InventoryResourceImpl(InventoryResourceInner innerObject, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager 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 InventoryProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public InventoryResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ManagedProxyResourceImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ManagedProxyResourceImpl.java index 45fea8c5ee05..996553a32722 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ManagedProxyResourceImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ManagedProxyResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationImpl.java index 4635bf6f3a48..7636a86955a1 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationStatusResultImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationStatusResultImpl.java new file mode 100644 index 000000000000..2e428236e92c --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationStatusResultImpl.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.management.exception.ManagementError; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.hybridconnectivity.models.OperationStatusResult; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String status() { + return this.innerModel().status(); + } + + public Double percentComplete() { + return this.innerModel().percentComplete(); + } + + public OffsetDateTime startTime() { + return this.innerModel().startTime(); + } + + public OffsetDateTime endTime() { + return this.innerModel().endTime(); + } + + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagementError error() { + return this.innerModel().error(); + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public OperationStatusResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationsClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationsClientImpl.java index 2db698ca13c8..0a550f841e6f 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationsClientImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.hybridconnectivity.fluent.OperationsClient; import com.azure.resourcemanager.hybridconnectivity.fluent.models.OperationInner; -import com.azure.resourcemanager.hybridconnectivity.models.OperationListResult; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -42,31 +42,31 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final HybridConnectivityManagementApiImpl client; + private final HybridConnectivityMgmtClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(HybridConnectivityManagementApiImpl client) { + OperationsClientImpl(HybridConnectivityMgmtClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for HybridConnectivityManagementApiOperations to be used by the proxy + * The interface defining all the services for HybridConnectivityMgmtClientOperations to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "HybridConnectivityMa") + @Host("{endpoint}") + @ServiceInterface(name = "HybridConnectivityMg") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.HybridConnectivity/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,11 +74,11 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -101,7 +101,7 @@ private Mono> listSinglePageAsync() { } /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -124,7 +124,7 @@ private Mono> listSinglePageAsync(Context context) } /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -137,7 +137,7 @@ private PagedFlux listAsync() { } /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -153,7 +153,7 @@ private PagedFlux listAsync(Context context) { } /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -166,7 +166,7 @@ public PagedIterable list() { } /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationsImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationsImpl.java index 0f09d81cd1e4..c82b2f9fa90d 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationsImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PostResponseImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PostResponseImpl.java new file mode 100644 index 000000000000..73f74d0ef7e6 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PostResponseImpl.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PostResponseInner; +import com.azure.resourcemanager.hybridconnectivity.models.PostResponse; + +public final class PostResponseImpl implements PostResponse { + private PostResponseInner innerObject; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + PostResponseImpl(PostResponseInner innerObject, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public PostResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorImpl.java new file mode 100644 index 000000000000..60d2a6047738 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorImpl.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PublicCloudConnectorInner; +import com.azure.resourcemanager.hybridconnectivity.models.OperationStatusResult; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnector; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.util.Collections; +import java.util.Map; + +public final class PublicCloudConnectorImpl + implements PublicCloudConnector, PublicCloudConnector.Definition, PublicCloudConnector.Update { + private PublicCloudConnectorInner innerObject; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager 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 PublicCloudConnectorProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public PublicCloudConnectorInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String publicCloudConnector; + + public PublicCloudConnectorImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public PublicCloudConnector create() { + this.innerObject = serviceManager.serviceClient() + .getPublicCloudConnectors() + .createOrUpdate(resourceGroupName, publicCloudConnector, this.innerModel(), Context.NONE); + return this; + } + + public PublicCloudConnector create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPublicCloudConnectors() + .createOrUpdate(resourceGroupName, publicCloudConnector, this.innerModel(), context); + return this; + } + + PublicCloudConnectorImpl(String name, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerObject = new PublicCloudConnectorInner(); + this.serviceManager = serviceManager; + this.publicCloudConnector = name; + } + + public PublicCloudConnectorImpl update() { + return this; + } + + public PublicCloudConnector apply() { + this.innerObject = serviceManager.serviceClient() + .getPublicCloudConnectors() + .updateWithResponse(resourceGroupName, publicCloudConnector, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public PublicCloudConnector apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPublicCloudConnectors() + .updateWithResponse(resourceGroupName, publicCloudConnector, this.innerModel(), context) + .getValue(); + return this; + } + + PublicCloudConnectorImpl(PublicCloudConnectorInner innerObject, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.publicCloudConnector + = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "publicCloudConnectors"); + } + + public PublicCloudConnector refresh() { + this.innerObject = serviceManager.serviceClient() + .getPublicCloudConnectors() + .getByResourceGroupWithResponse(resourceGroupName, publicCloudConnector, Context.NONE) + .getValue(); + return this; + } + + public PublicCloudConnector refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getPublicCloudConnectors() + .getByResourceGroupWithResponse(resourceGroupName, publicCloudConnector, context) + .getValue(); + return this; + } + + public OperationStatusResult testPermissions() { + return serviceManager.publicCloudConnectors().testPermissions(resourceGroupName, publicCloudConnector); + } + + public OperationStatusResult testPermissions(Context context) { + return serviceManager.publicCloudConnectors().testPermissions(resourceGroupName, publicCloudConnector, context); + } + + public PublicCloudConnectorImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public PublicCloudConnectorImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public PublicCloudConnectorImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public PublicCloudConnectorImpl withProperties(PublicCloudConnectorProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java new file mode 100644 index 000000000000..ab25daa14f06 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsClientImpl.java @@ -0,0 +1,1339 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridconnectivity.fluent.PublicCloudConnectorsClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PublicCloudConnectorInner; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.PublicCloudConnectorListResult; +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 PublicCloudConnectorsClient. + */ +public final class PublicCloudConnectorsClientImpl implements PublicCloudConnectorsClient { + /** + * The proxy service used to perform REST calls. + */ + private final PublicCloudConnectorsService service; + + /** + * The service client containing this operation class. + */ + private final HybridConnectivityMgmtClientImpl client; + + /** + * Initializes an instance of PublicCloudConnectorsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + PublicCloudConnectorsClientImpl(HybridConnectivityMgmtClientImpl client) { + this.service = RestProxy.create(PublicCloudConnectorsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridConnectivityMgmtClientPublicCloudConnectors to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HybridConnectivityMg") + public interface PublicCloudConnectorsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicCloudConnector") String publicCloudConnector, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicCloudConnector") String publicCloudConnector, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PublicCloudConnectorInner resource, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicCloudConnector") String publicCloudConnector, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PublicCloudConnectorInner properties, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicCloudConnector") String publicCloudConnector, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/publicCloudConnectors") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}/testPermissions") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> testPermissions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("publicCloudConnector") String publicCloudConnector, @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("endpoint") String endpoint, + @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("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 PublicCloudConnector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String publicCloudConnector) { + 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector 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, publicCloudConnector, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 a PublicCloudConnector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String publicCloudConnector, 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector 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, publicCloudConnector, accept, context); + } + + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 PublicCloudConnector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, + String publicCloudConnector) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicCloudConnector) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 a PublicCloudConnector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String publicCloudConnector, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, publicCloudConnector, context).block(); + } + + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 PublicCloudConnector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicCloudConnectorInner getByResourceGroup(String resourceGroupName, String publicCloudConnector) { + return getByResourceGroupWithResponse(resourceGroupName, publicCloudConnector, Context.NONE).getValue(); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String publicCloudConnector, PublicCloudConnectorInner resource) { + 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, publicCloudConnector, contentType, accept, resource, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String publicCloudConnector, PublicCloudConnectorInner resource, 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, publicCloudConnector, contentType, accept, resource, + context); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PublicCloudConnectorInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publicCloudConnector, PublicCloudConnectorInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, publicCloudConnector, resource); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PublicCloudConnectorInner.class, PublicCloudConnectorInner.class, + this.client.getContext()); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, PublicCloudConnectorInner> beginCreateOrUpdateAsync( + String resourceGroupName, String publicCloudConnector, PublicCloudConnectorInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, publicCloudConnector, resource, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), PublicCloudConnectorInner.class, PublicCloudConnectorInner.class, context); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicCloudConnectorInner> + beginCreateOrUpdate(String resourceGroupName, String publicCloudConnector, PublicCloudConnectorInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, publicCloudConnector, resource).getSyncPoller(); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, PublicCloudConnectorInner> beginCreateOrUpdate( + String resourceGroupName, String publicCloudConnector, PublicCloudConnectorInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, publicCloudConnector, resource, context) + .getSyncPoller(); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, publicCloudConnector, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, publicCloudConnector, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicCloudConnectorInner createOrUpdate(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner resource) { + return createOrUpdateAsync(resourceGroupName, publicCloudConnector, resource).block(); + } + + /** + * Create a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicCloudConnectorInner createOrUpdate(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner resource, Context context) { + return createOrUpdateAsync(resourceGroupName, publicCloudConnector, resource, context).block(); + } + + /** + * Update a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String publicCloudConnector, PublicCloudConnectorInner properties) { + 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, publicCloudConnector, contentType, accept, + properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceGroupName, + String publicCloudConnector, PublicCloudConnectorInner properties, 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, publicCloudConnector, contentType, accept, properties, context); + } + + /** + * Update a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner properties) { + return updateWithResponseAsync(resourceGroupName, publicCloudConnector, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner properties, Context context) { + return updateWithResponseAsync(resourceGroupName, publicCloudConnector, properties, context).block(); + } + + /** + * Update a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return public Cloud Connector. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PublicCloudConnectorInner update(String resourceGroupName, String publicCloudConnector, + PublicCloudConnectorInner properties) { + return updateWithResponse(resourceGroupName, publicCloudConnector, properties, Context.NONE).getValue(); + } + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String publicCloudConnector) { + 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector 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, publicCloudConnector, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceGroupName, String publicCloudConnector, + 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector 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, publicCloudConnector, accept, context); + } + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String publicCloudConnector) { + return deleteWithResponseAsync(resourceGroupName, publicCloudConnector).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceGroupName, String publicCloudConnector, Context context) { + return deleteWithResponseAsync(resourceGroupName, publicCloudConnector, context).block(); + } + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 publicCloudConnector) { + deleteWithResponse(resourceGroupName, publicCloudConnector, Context.NONE); + } + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testPermissionsWithResponseAsync(String resourceGroupName, + String publicCloudConnector) { + 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.testPermissions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, publicCloudConnector, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> testPermissionsWithResponseAsync(String resourceGroupName, + String publicCloudConnector, 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 (publicCloudConnector == null) { + return Mono + .error(new IllegalArgumentException("Parameter publicCloudConnector is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.testPermissions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, publicCloudConnector, accept, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginTestPermissionsAsync(String resourceGroupName, String publicCloudConnector) { + Mono>> mono + = testPermissionsWithResponseAsync(resourceGroupName, publicCloudConnector); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginTestPermissionsAsync(String resourceGroupName, String publicCloudConnector, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = testPermissionsWithResponseAsync(resourceGroupName, publicCloudConnector, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> + beginTestPermissions(String resourceGroupName, String publicCloudConnector) { + return this.beginTestPermissionsAsync(resourceGroupName, publicCloudConnector).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> + beginTestPermissions(String resourceGroupName, String publicCloudConnector, Context context) { + return this.beginTestPermissionsAsync(resourceGroupName, publicCloudConnector, context).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testPermissionsAsync(String resourceGroupName, + String publicCloudConnector) { + return beginTestPermissionsAsync(resourceGroupName, publicCloudConnector).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono testPermissionsAsync(String resourceGroupName, String publicCloudConnector, + Context context) { + return beginTestPermissionsAsync(resourceGroupName, publicCloudConnector, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner testPermissions(String resourceGroupName, String publicCloudConnector) { + return testPermissionsAsync(resourceGroupName, publicCloudConnector).block(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner testPermissions(String resourceGroupName, String publicCloudConnector, + Context context) { + return testPermissionsAsync(resourceGroupName, publicCloudConnector, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsImpl.java new file mode 100644 index 000000000000..56c6db377b23 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/PublicCloudConnectorsImpl.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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.hybridconnectivity.fluent.PublicCloudConnectorsClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PublicCloudConnectorInner; +import com.azure.resourcemanager.hybridconnectivity.models.OperationStatusResult; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnector; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectors; + +public final class PublicCloudConnectorsImpl implements PublicCloudConnectors { + private static final ClientLogger LOGGER = new ClientLogger(PublicCloudConnectorsImpl.class); + + private final PublicCloudConnectorsClient innerClient; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + public PublicCloudConnectorsImpl(PublicCloudConnectorsClient innerClient, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, + String publicCloudConnector, Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, publicCloudConnector, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PublicCloudConnectorImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public PublicCloudConnector getByResourceGroup(String resourceGroupName, String publicCloudConnector) { + PublicCloudConnectorInner inner + = this.serviceClient().getByResourceGroup(resourceGroupName, publicCloudConnector); + if (inner != null) { + return new PublicCloudConnectorImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceGroupName, String publicCloudConnector, + Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, publicCloudConnector, context); + } + + public void deleteByResourceGroup(String resourceGroupName, String publicCloudConnector) { + this.serviceClient().delete(resourceGroupName, publicCloudConnector); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicCloudConnectorImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicCloudConnectorImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicCloudConnectorImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new PublicCloudConnectorImpl(inner1, this.manager())); + } + + public OperationStatusResult testPermissions(String resourceGroupName, String publicCloudConnector) { + OperationStatusResultInner inner + = this.serviceClient().testPermissions(resourceGroupName, publicCloudConnector); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult testPermissions(String resourceGroupName, String publicCloudConnector, + Context context) { + OperationStatusResultInner inner + = this.serviceClient().testPermissions(resourceGroupName, publicCloudConnector, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public PublicCloudConnector getById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicCloudConnector = ResourceManagerUtils.getValueFromIdByName(id, "publicCloudConnectors"); + if (publicCloudConnector == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publicCloudConnectors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publicCloudConnector, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicCloudConnector = ResourceManagerUtils.getValueFromIdByName(id, "publicCloudConnectors"); + if (publicCloudConnector == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publicCloudConnectors'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, publicCloudConnector, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicCloudConnector = ResourceManagerUtils.getValueFromIdByName(id, "publicCloudConnectors"); + if (publicCloudConnector == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publicCloudConnectors'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceGroupName, publicCloudConnector, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String publicCloudConnector = ResourceManagerUtils.getValueFromIdByName(id, "publicCloudConnectors"); + if (publicCloudConnector == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'publicCloudConnectors'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceGroupName, publicCloudConnector, context); + } + + private PublicCloudConnectorsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } + + public PublicCloudConnectorImpl define(String name) { + return new PublicCloudConnectorImpl(name, this.manager()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ResourceManagerUtils.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ResourceManagerUtils.java index ec8ed0a60227..19f53f0117a2 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ResourceManagerUtils.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationResourceImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationResourceImpl.java index 477c046eecdd..28e646a82a71 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationResourceImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationResourceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationsClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationsClientImpl.java index 5f42301482e4..ef27fe36707c 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationsClientImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; @@ -31,7 +31,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.hybridconnectivity.fluent.ServiceConfigurationsClient; import com.azure.resourcemanager.hybridconnectivity.fluent.models.ServiceConfigurationResourceInner; -import com.azure.resourcemanager.hybridconnectivity.models.ServiceConfigurationList; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.ServiceConfigurationList; import com.azure.resourcemanager.hybridconnectivity.models.ServiceConfigurationResourcePatch; import reactor.core.publisher.Mono; @@ -47,241 +47,95 @@ public final class ServiceConfigurationsClientImpl implements ServiceConfigurati /** * The service client containing this operation class. */ - private final HybridConnectivityManagementApiImpl client; + private final HybridConnectivityMgmtClientImpl client; /** * Initializes an instance of ServiceConfigurationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ServiceConfigurationsClientImpl(HybridConnectivityManagementApiImpl client) { + ServiceConfigurationsClientImpl(HybridConnectivityMgmtClientImpl client) { this.service = RestProxy.create(ServiceConfigurationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for HybridConnectivityManagementApiServiceConfigurations to be used by - * the proxy service to perform REST calls. + * The interface defining all the services for HybridConnectivityMgmtClientServiceConfigurations to be used by the + * proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "HybridConnectivityMa") + @Host("{endpoint}") + @ServiceInterface(name = "HybridConnectivityMg") public interface ServiceConfigurationsService { - @Headers({ "Content-Type: application/json" }) - @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByEndpointResource(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceUri", encoded = true) String resourceUri, - @PathParam(value = "endpointName", encoded = true) String endpointName, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, @PathParam(value = "serviceConfigurationName", encoded = true) String serviceConfigurationName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrupdate(@HostParam("$host") String endpoint, + Mono> createOrupdate(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, @PathParam(value = "serviceConfigurationName", encoded = true) String serviceConfigurationName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ServiceConfigurationResourceInner serviceConfigurationResource, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, + Mono> update(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, @PathParam(value = "serviceConfigurationName", encoded = true) String serviceConfigurationName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ServiceConfigurationResourcePatch serviceConfigurationResource, - @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Delete("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}") @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam(value = "resourceUri", encoded = true) String resourceUri, @PathParam(value = "endpointName", encoded = true) String endpointName, @PathParam(value = "serviceConfigurationName", encoded = true) String serviceConfigurationName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByEndpointResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam(value = "endpointName", encoded = true) String endpointName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByEndpointResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByEndpointResourceSinglePageAsync(String resourceUri, String endpointName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (endpointName == null) { - return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByEndpointResource(this.client.getEndpoint(), - this.client.getApiVersion(), resourceUri, endpointName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByEndpointResourceSinglePageAsync(String resourceUri, String endpointName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceUri == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); - } - if (endpointName == null) { - return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByEndpointResource(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, endpointName, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByEndpointResourceAsync(String resourceUri, - String endpointName) { - return new PagedFlux<>(() -> listByEndpointResourceSinglePageAsync(resourceUri, endpointName), - nextLink -> listByEndpointResourceNextSinglePageAsync(nextLink)); - } - - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByEndpointResourceAsync(String resourceUri, - String endpointName, Context context) { - return new PagedFlux<>(() -> listByEndpointResourceSinglePageAsync(resourceUri, endpointName, context), - nextLink -> listByEndpointResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByEndpointResource(String resourceUri, - String endpointName) { - return new PagedIterable<>(listByEndpointResourceAsync(resourceUri, endpointName)); - } - - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByEndpointResource(String resourceUri, - String endpointName, Context context) { - return new PagedIterable<>(listByEndpointResourceAsync(resourceUri, endpointName, context)); - } - /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -317,7 +171,7 @@ private Mono> getWithResponseAsync(S /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param context The context to associate with this operation. @@ -353,7 +207,7 @@ private Mono> getWithResponseAsync(S /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -371,7 +225,7 @@ private Mono getAsync(String resourceUri, Str /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param context The context to associate with this operation. @@ -389,7 +243,7 @@ public Response getWithResponse(String resour /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -406,7 +260,7 @@ public ServiceConfigurationResourceInner get(String resourceUri, String endpoint /** * Create or update a service in serviceConfiguration for the endpoint resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -440,17 +294,19 @@ private Mono> createOrupdateWithResp } else { serviceConfigurationResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrupdate(this.client.getEndpoint(), this.client.getApiVersion(), - resourceUri, endpointName, serviceConfigurationName, serviceConfigurationResource, accept, context)) + .withContext( + context -> service.createOrupdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + endpointName, serviceConfigurationName, contentType, accept, serviceConfigurationResource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a service in serviceConfiguration for the endpoint resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -485,16 +341,17 @@ private Mono> createOrupdateWithResp } else { serviceConfigurationResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrupdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, endpointName, - serviceConfigurationName, serviceConfigurationResource, accept, context); + serviceConfigurationName, contentType, accept, serviceConfigurationResource, context); } /** * Create or update a service in serviceConfiguration for the endpoint resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -514,7 +371,7 @@ private Mono createOrupdateAsync(String resou /** * Create or update a service in serviceConfiguration for the endpoint resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -535,7 +392,7 @@ public Response createOrupdateWithResponse(St /** * Create or update a service in serviceConfiguration for the endpoint resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -554,7 +411,7 @@ public ServiceConfigurationResourceInner createOrupdate(String resourceUri, Stri /** * Update the service details in the service configurations of the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -588,17 +445,18 @@ private Mono> updateWithResponseAsyn } else { serviceConfigurationResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, - endpointName, serviceConfigurationName, serviceConfigurationResource, accept, context)) + endpointName, serviceConfigurationName, contentType, accept, serviceConfigurationResource, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update the service details in the service configurations of the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -633,16 +491,17 @@ private Mono> updateWithResponseAsyn } else { serviceConfigurationResource.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, endpointName, - serviceConfigurationName, serviceConfigurationResource, accept, context); + serviceConfigurationName, contentType, accept, serviceConfigurationResource, context); } /** * Update the service details in the service configurations of the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -662,7 +521,7 @@ private Mono updateAsync(String resourceUri, /** * Update the service details in the service configurations of the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -683,7 +542,7 @@ public Response updateWithResponse(String res /** * Update the service details in the service configurations of the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param serviceConfigurationResource Service details. @@ -702,7 +561,7 @@ public ServiceConfigurationResourceInner update(String resourceUri, String endpo /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -737,7 +596,7 @@ private Mono> deleteWithResponseAsync(String resourceUri, String /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param context The context to associate with this operation. @@ -772,7 +631,7 @@ private Mono> deleteWithResponseAsync(String resourceUri, String /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -789,7 +648,7 @@ private Mono deleteAsync(String resourceUri, String endpointName, String s /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param context The context to associate with this operation. @@ -807,7 +666,7 @@ public Response deleteWithResponse(String resourceUri, String endpointName /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -820,6 +679,155 @@ public void delete(String resourceUri, String endpointName, String serviceConfig } /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByEndpointResourceSinglePageAsync(String resourceUri, String endpointName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByEndpointResource(this.client.getEndpoint(), + this.client.getApiVersion(), resourceUri, endpointName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByEndpointResourceSinglePageAsync(String resourceUri, String endpointName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (endpointName == null) { + return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByEndpointResource(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, endpointName, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointResourceAsync(String resourceUri, + String endpointName) { + return new PagedFlux<>(() -> listByEndpointResourceSinglePageAsync(resourceUri, endpointName), + nextLink -> listByEndpointResourceNextSinglePageAsync(nextLink)); + } + + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByEndpointResourceAsync(String resourceUri, + String endpointName, Context context) { + return new PagedFlux<>(() -> listByEndpointResourceSinglePageAsync(resourceUri, endpointName, context), + nextLink -> listByEndpointResourceNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpointResource(String resourceUri, + String endpointName) { + return new PagedIterable<>(listByEndpointResourceAsync(resourceUri, endpointName)); + } + + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByEndpointResource(String resourceUri, + String endpointName, Context context) { + return new PagedIterable<>(listByEndpointResourceAsync(resourceUri, endpointName, context)); + } + + /** + * Lists of all the services associated with endpoint resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. @@ -849,6 +857,8 @@ public void delete(String resourceUri, String endpointName, String serviceConfig } /** + * Lists of all the services associated with endpoint resource. + * * Get the next page of items. * * @param nextLink The URL to get the next list of items. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationsImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationsImpl.java index ff80043d5040..8db1b277d94d 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationsImpl.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/ServiceConfigurationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.implementation; @@ -27,21 +27,6 @@ public ServiceConfigurationsImpl(ServiceConfigurationsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listByEndpointResource(String resourceUri, String endpointName) { - PagedIterable inner - = this.serviceClient().listByEndpointResource(resourceUri, endpointName); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ServiceConfigurationResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByEndpointResource(String resourceUri, String endpointName, - Context context) { - PagedIterable inner - = this.serviceClient().listByEndpointResource(resourceUri, endpointName, context); - return ResourceManagerUtils.mapPage(inner, - inner1 -> new ServiceConfigurationResourceImpl(inner1, this.manager())); - } - public Response getWithResponse(String resourceUri, String endpointName, String serviceConfigurationName, Context context) { Response inner @@ -73,6 +58,21 @@ public void delete(String resourceUri, String endpointName, String serviceConfig this.serviceClient().delete(resourceUri, endpointName, serviceConfigurationName); } + public PagedIterable listByEndpointResource(String resourceUri, String endpointName) { + PagedIterable inner + = this.serviceClient().listByEndpointResource(resourceUri, endpointName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ServiceConfigurationResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByEndpointResource(String resourceUri, String endpointName, + Context context) { + PagedIterable inner + = this.serviceClient().listByEndpointResource(resourceUri, endpointName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ServiceConfigurationResourceImpl(inner1, this.manager())); + } + public ServiceConfigurationResource getById(String id) { String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}", diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationImpl.java new file mode 100644 index 000000000000..60f03dc607c6 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationImpl.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionConfigurationInner; +import com.azure.resourcemanager.hybridconnectivity.models.OperationStatusResult; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfiguration; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationProperties; + +public final class SolutionConfigurationImpl + implements SolutionConfiguration, SolutionConfiguration.Definition, SolutionConfiguration.Update { + private SolutionConfigurationInner innerObject; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SolutionConfigurationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SolutionConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } + + private String resourceUri; + + private String solutionConfiguration; + + public SolutionConfigurationImpl withExistingResourceUri(String resourceUri) { + this.resourceUri = resourceUri; + return this; + } + + public SolutionConfiguration create() { + this.innerObject = serviceManager.serviceClient() + .getSolutionConfigurations() + .createOrUpdateWithResponse(resourceUri, solutionConfiguration, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SolutionConfiguration create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSolutionConfigurations() + .createOrUpdateWithResponse(resourceUri, solutionConfiguration, this.innerModel(), context) + .getValue(); + return this; + } + + SolutionConfigurationImpl(String name, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerObject = new SolutionConfigurationInner(); + this.serviceManager = serviceManager; + this.solutionConfiguration = name; + } + + public SolutionConfigurationImpl update() { + return this; + } + + public SolutionConfiguration apply() { + this.innerObject = serviceManager.serviceClient() + .getSolutionConfigurations() + .updateWithResponse(resourceUri, solutionConfiguration, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public SolutionConfiguration apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSolutionConfigurations() + .updateWithResponse(resourceUri, solutionConfiguration, this.innerModel(), context) + .getValue(); + return this; + } + + SolutionConfigurationImpl(SolutionConfigurationInner innerObject, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "resourceUri"); + this.solutionConfiguration = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "solutionConfiguration"); + } + + public SolutionConfiguration refresh() { + this.innerObject = serviceManager.serviceClient() + .getSolutionConfigurations() + .getWithResponse(resourceUri, solutionConfiguration, Context.NONE) + .getValue(); + return this; + } + + public SolutionConfiguration refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSolutionConfigurations() + .getWithResponse(resourceUri, solutionConfiguration, context) + .getValue(); + return this; + } + + public OperationStatusResult syncNow() { + return serviceManager.solutionConfigurations().syncNow(resourceUri, solutionConfiguration); + } + + public OperationStatusResult syncNow(Context context) { + return serviceManager.solutionConfigurations().syncNow(resourceUri, solutionConfiguration, context); + } + + public SolutionConfigurationImpl withProperties(SolutionConfigurationProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationsClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationsClientImpl.java new file mode 100644 index 000000000000..3f717acb8272 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationsClientImpl.java @@ -0,0 +1,983 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.hybridconnectivity.fluent.SolutionConfigurationsClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionConfigurationInner; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.SolutionConfigurationListResult; +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 SolutionConfigurationsClient. + */ +public final class SolutionConfigurationsClientImpl implements SolutionConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SolutionConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final HybridConnectivityMgmtClientImpl client; + + /** + * Initializes an instance of SolutionConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SolutionConfigurationsClientImpl(HybridConnectivityMgmtClientImpl client) { + this.service = RestProxy.create(SolutionConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridConnectivityMgmtClientSolutionConfigurations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HybridConnectivityMg") + public interface SolutionConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("solutionConfiguration") String solutionConfiguration, @HeaderParam("Accept") String accept, + Context context); + + @Put("/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("solutionConfiguration") String solutionConfiguration, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SolutionConfigurationInner resource, Context context); + + @Patch("/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("solutionConfiguration") String solutionConfiguration, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SolutionConfigurationInner properties, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("solutionConfiguration") String solutionConfiguration, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}/syncNow") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> syncNow(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceUri", encoded = true) String resourceUri, + @PathParam("solutionConfiguration") String solutionConfiguration, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 SolutionConfiguration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, + String solutionConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 a SolutionConfiguration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceUri, + String solutionConfiguration, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, solutionConfiguration, + accept, context); + } + + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 SolutionConfiguration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceUri, String solutionConfiguration) { + return getWithResponseAsync(resourceUri, solutionConfiguration) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 a SolutionConfiguration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceUri, String solutionConfiguration, + Context context) { + return getWithResponseAsync(resourceUri, solutionConfiguration, context).block(); + } + + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 SolutionConfiguration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SolutionConfigurationInner get(String resourceUri, String solutionConfiguration) { + return getWithResponse(resourceUri, solutionConfiguration, Context.NONE).getValue(); + } + + /** + * Create a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceUri, + String solutionConfiguration, SolutionConfigurationInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + resourceUri, solutionConfiguration, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync(String resourceUri, + String solutionConfiguration, SolutionConfigurationInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, contentType, accept, resource, context); + } + + /** + * Create a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner resource) { + return createOrUpdateWithResponseAsync(resourceUri, solutionConfiguration, resource) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse(String resourceUri, + String solutionConfiguration, SolutionConfigurationInner resource, Context context) { + return createOrUpdateWithResponseAsync(resourceUri, solutionConfiguration, resource, context).block(); + } + + /** + * Create a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SolutionConfigurationInner createOrUpdate(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner resource) { + return createOrUpdateWithResponse(resourceUri, solutionConfiguration, resource, Context.NONE).getValue(); + } + + /** + * Update a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceUri, + String solutionConfiguration, SolutionConfigurationInner properties) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, contentType, accept, properties, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync(String resourceUri, + String solutionConfiguration, SolutionConfigurationInner properties, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, contentType, accept, properties, context); + } + + /** + * Update a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner properties) { + return updateWithResponseAsync(resourceUri, solutionConfiguration, properties) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Update a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param properties The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner properties, Context context) { + return updateWithResponseAsync(resourceUri, solutionConfiguration, properties, context).block(); + } + + /** + * Update a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param properties The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return solution Configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SolutionConfigurationInner update(String resourceUri, String solutionConfiguration, + SolutionConfigurationInner properties) { + return updateWithResponse(resourceUri, solutionConfiguration, properties, Context.NONE).getValue(); + } + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceUri, String solutionConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> deleteWithResponseAsync(String resourceUri, String solutionConfiguration, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration 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(), resourceUri, + solutionConfiguration, accept, context); + } + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceUri, String solutionConfiguration) { + return deleteWithResponseAsync(resourceUri, solutionConfiguration).flatMap(ignored -> Mono.empty()); + } + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteWithResponse(String resourceUri, String solutionConfiguration, Context context) { + return deleteWithResponseAsync(resourceUri, solutionConfiguration, context).block(); + } + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 resourceUri, String solutionConfiguration) { + deleteWithResponse(resourceUri, solutionConfiguration, Context.NONE); + } + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceUri, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri 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(), resourceUri, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceUri, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceUri, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri) { + return new PagedIterable<>(listAsync(resourceUri)); + } + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceUri, Context context) { + return new PagedIterable<>(listAsync(resourceUri, context)); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> syncNowWithResponseAsync(String resourceUri, + String solutionConfiguration) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.syncNow(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> syncNowWithResponseAsync(String resourceUri, String solutionConfiguration, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceUri == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceUri is required and cannot be null.")); + } + if (solutionConfiguration == null) { + return Mono + .error(new IllegalArgumentException("Parameter solutionConfiguration is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.syncNow(this.client.getEndpoint(), this.client.getApiVersion(), resourceUri, + solutionConfiguration, accept, context); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginSyncNowAsync(String resourceUri, String solutionConfiguration) { + Mono>> mono = syncNowWithResponseAsync(resourceUri, solutionConfiguration); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, + this.client.getContext()); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusResultInner> + beginSyncNowAsync(String resourceUri, String solutionConfiguration, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = syncNowWithResponseAsync(resourceUri, solutionConfiguration, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), OperationStatusResultInner.class, OperationStatusResultInner.class, context); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> + beginSyncNow(String resourceUri, String solutionConfiguration) { + return this.beginSyncNowAsync(resourceUri, solutionConfiguration).getSyncPoller(); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusResultInner> + beginSyncNow(String resourceUri, String solutionConfiguration, Context context) { + return this.beginSyncNowAsync(resourceUri, solutionConfiguration, context).getSyncPoller(); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono syncNowAsync(String resourceUri, String solutionConfiguration) { + return beginSyncNowAsync(resourceUri, solutionConfiguration).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono syncNowAsync(String resourceUri, String solutionConfiguration, + Context context) { + return beginSyncNowAsync(resourceUri, solutionConfiguration, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner syncNow(String resourceUri, String solutionConfiguration) { + return syncNowAsync(resourceUri, solutionConfiguration).block(); + } + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusResultInner syncNow(String resourceUri, String solutionConfiguration, Context context) { + return syncNowAsync(resourceUri, solutionConfiguration, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionConfiguration list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationsImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationsImpl.java new file mode 100644 index 000000000000..811f5575d394 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionConfigurationsImpl.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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.hybridconnectivity.fluent.SolutionConfigurationsClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionConfigurationInner; +import com.azure.resourcemanager.hybridconnectivity.models.OperationStatusResult; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfiguration; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurations; + +public final class SolutionConfigurationsImpl implements SolutionConfigurations { + private static final ClientLogger LOGGER = new ClientLogger(SolutionConfigurationsImpl.class); + + private final SolutionConfigurationsClient innerClient; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + public SolutionConfigurationsImpl(SolutionConfigurationsClient innerClient, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getWithResponse(String resourceUri, String solutionConfiguration, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceUri, solutionConfiguration, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SolutionConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SolutionConfiguration get(String resourceUri, String solutionConfiguration) { + SolutionConfigurationInner inner = this.serviceClient().get(resourceUri, solutionConfiguration); + if (inner != null) { + return new SolutionConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response deleteByResourceGroupWithResponse(String resourceUri, String solutionConfiguration, + Context context) { + return this.serviceClient().deleteWithResponse(resourceUri, solutionConfiguration, context); + } + + public void deleteByResourceGroup(String resourceUri, String solutionConfiguration) { + this.serviceClient().delete(resourceUri, solutionConfiguration); + } + + public PagedIterable list(String resourceUri) { + PagedIterable inner = this.serviceClient().list(resourceUri); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceUri, Context context) { + PagedIterable inner = this.serviceClient().list(resourceUri, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionConfigurationImpl(inner1, this.manager())); + } + + public OperationStatusResult syncNow(String resourceUri, String solutionConfiguration) { + OperationStatusResultInner inner = this.serviceClient().syncNow(resourceUri, solutionConfiguration); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatusResult syncNow(String resourceUri, String solutionConfiguration, Context context) { + OperationStatusResultInner inner = this.serviceClient().syncNow(resourceUri, solutionConfiguration, context); + if (inner != null) { + return new OperationStatusResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public SolutionConfiguration getById(String id) { + String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "resourceUri"); + if (resourceUri == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); + } + String solutionConfiguration = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "solutionConfiguration"); + if (solutionConfiguration == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'solutionConfigurations'.", id))); + } + return this.getWithResponse(resourceUri, solutionConfiguration, Context.NONE).getValue(); + } + + public Response getByIdWithResponse(String id, Context context) { + String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "resourceUri"); + if (resourceUri == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); + } + String solutionConfiguration = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "solutionConfiguration"); + if (solutionConfiguration == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'solutionConfigurations'.", id))); + } + return this.getWithResponse(resourceUri, solutionConfiguration, context); + } + + public void deleteById(String id) { + String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "resourceUri"); + if (resourceUri == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); + } + String solutionConfiguration = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "solutionConfiguration"); + if (solutionConfiguration == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'solutionConfigurations'.", id))); + } + this.deleteByResourceGroupWithResponse(resourceUri, solutionConfiguration, Context.NONE); + } + + public Response deleteByIdWithResponse(String id, Context context) { + String resourceUri = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "resourceUri"); + if (resourceUri == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceUri'.", id))); + } + String solutionConfiguration = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}", + "solutionConfiguration"); + if (solutionConfiguration == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException(String + .format("The resource ID '%s' is not valid. Missing path segment 'solutionConfigurations'.", id))); + } + return this.deleteByResourceGroupWithResponse(resourceUri, solutionConfiguration, context); + } + + private SolutionConfigurationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } + + public SolutionConfigurationImpl define(String name) { + return new SolutionConfigurationImpl(name, this.manager()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypeResourceImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypeResourceImpl.java new file mode 100644 index 000000000000..fc77725ee5c1 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypeResourceImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionTypeResourceInner; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeResource; + +public final class SolutionTypeResourceImpl implements SolutionTypeResource { + private SolutionTypeResourceInner innerObject; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + SolutionTypeResourceImpl(SolutionTypeResourceInner innerObject, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager 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 SolutionTypeProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SolutionTypeResourceInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypesClientImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypesClientImpl.java new file mode 100644 index 000000000000..056bfb8dad00 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypesClientImpl.java @@ -0,0 +1,576 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.hybridconnectivity.fluent.SolutionTypesClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionTypeResourceInner; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.SolutionTypeResourceListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SolutionTypesClient. + */ +public final class SolutionTypesClientImpl implements SolutionTypesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SolutionTypesService service; + + /** + * The service client containing this operation class. + */ + private final HybridConnectivityMgmtClientImpl client; + + /** + * Initializes an instance of SolutionTypesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SolutionTypesClientImpl(HybridConnectivityMgmtClientImpl client) { + this.service + = RestProxy.create(SolutionTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for HybridConnectivityMgmtClientSolutionTypes to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "HybridConnectivityMg") + public interface SolutionTypesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes/{solutionType}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("solutionType") String solutionType, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/solutionTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") 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" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/solutionTypes") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @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> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 SolutionTypeResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String solutionType) { + 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 (solutionType == null) { + return Mono.error(new IllegalArgumentException("Parameter solutionType 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, solutionType, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 a SolutionTypeResource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String solutionType, 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 (solutionType == null) { + return Mono.error(new IllegalArgumentException("Parameter solutionType 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, solutionType, accept, context); + } + + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 SolutionTypeResource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String solutionType) { + return getByResourceGroupWithResponseAsync(resourceGroupName, solutionType) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 a SolutionTypeResource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String solutionType, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, solutionType, context).block(); + } + + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 SolutionTypeResource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SolutionTypeResourceInner getByResourceGroup(String resourceGroupName, String solutionType) { + return getByResourceGroupWithResponse(resourceGroupName, solutionType, Context.NONE).getValue(); + } + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypesImpl.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypesImpl.java new file mode 100644 index 000000000000..a85fbbf3e57b --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/SolutionTypesImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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.hybridconnectivity.fluent.SolutionTypesClient; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionTypeResourceInner; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeResource; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypes; + +public final class SolutionTypesImpl implements SolutionTypes { + private static final ClientLogger LOGGER = new ClientLogger(SolutionTypesImpl.class); + + private final SolutionTypesClient innerClient; + + private final com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager; + + public SolutionTypesImpl(SolutionTypesClient innerClient, + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getByResourceGroupWithResponse(String resourceGroupName, String solutionType, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, solutionType, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SolutionTypeResourceImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SolutionTypeResource getByResourceGroup(String resourceGroupName, String solutionType) { + SolutionTypeResourceInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, solutionType); + if (inner != null) { + return new SolutionTypeResourceImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionTypeResourceImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner + = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionTypeResourceImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionTypeResourceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SolutionTypeResourceImpl(inner1, this.manager())); + } + + private SolutionTypesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointsList.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/EndpointsList.java similarity index 75% rename from sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointsList.java rename to sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/EndpointsList.java index 1943bc757109..d1643e9ed988 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointsList.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/EndpointsList.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.hybridconnectivity.models; +package com.azure.resourcemanager.hybridconnectivity.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,42 +17,22 @@ /** * The list of endpoints. */ -@Fluent +@Immutable public final class EndpointsList implements JsonSerializable { - /* - * The link used to get the next page of endpoints list. - */ - private String nextLink; - /* * The list of endpoint. */ private List value; - /** - * Creates an instance of EndpointsList class. - */ - public EndpointsList() { - } - - /** - * Get the nextLink property: The link used to get the next page of endpoints list. - * - * @return the nextLink value. + /* + * The link used to get the next page of endpoints list. */ - public String nextLink() { - return this.nextLink; - } + private String nextLink; /** - * Set the nextLink property: The link used to get the next page of endpoints list. - * - * @param nextLink the nextLink value to set. - * @return the EndpointsList object itself. + * Creates an instance of EndpointsList class. */ - public EndpointsList withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; + private EndpointsList() { } /** @@ -64,14 +45,12 @@ public List value() { } /** - * Set the value property: The list of endpoint. + * Get the nextLink property: The link used to get the next page of endpoints list. * - * @param value the value value to set. - * @return the EndpointsList object itself. + * @return the nextLink value. */ - public EndpointsList withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -80,19 +59,24 @@ public EndpointsList withValue(List value) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model EndpointsList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(EndpointsList.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -102,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of EndpointsList if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the EndpointsList. */ public static EndpointsList fromJson(JsonReader jsonReader) throws IOException { @@ -111,12 +96,12 @@ public static EndpointsList fromJson(JsonReader jsonReader) throws IOException { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("nextLink".equals(fieldName)) { - deserializedEndpointsList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { + if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> EndpointResourceInner.fromJson(reader1)); deserializedEndpointsList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedEndpointsList.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/InventoryResourceListResult.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/InventoryResourceListResult.java new file mode 100644 index 000000000000..c53e4feb5313 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/InventoryResourceListResult.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.InventoryResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a InventoryResource list operation. + */ +@Immutable +public final class InventoryResourceListResult implements JsonSerializable { + /* + * The InventoryResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of InventoryResourceListResult class. + */ + private InventoryResourceListResult() { + } + + /** + * Get the value property: The InventoryResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model InventoryResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(InventoryResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InventoryResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InventoryResourceListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InventoryResourceListResult. + */ + public static InventoryResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InventoryResourceListResult deserializedInventoryResourceListResult = new InventoryResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> InventoryResourceInner.fromJson(reader1)); + deserializedInventoryResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedInventoryResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedInventoryResourceListResult; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/OperationListResult.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/OperationListResult.java similarity index 73% rename from sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/OperationListResult.java rename to sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/OperationListResult.java index 555950e006a9..32d044e0057b 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/OperationListResult.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/OperationListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.hybridconnectivity.models; +package com.azure.resourcemanager.hybridconnectivity.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -20,23 +21,23 @@ @Immutable public final class OperationListResult implements JsonSerializable { /* - * List of operations supported by the resource provider + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,7 +46,7 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -59,17 +60,24 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/PublicCloudConnectorListResult.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/PublicCloudConnectorListResult.java new file mode 100644 index 000000000000..f092aa82d9e3 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/PublicCloudConnectorListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PublicCloudConnectorInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a PublicCloudConnector list operation. + */ +@Immutable +public final class PublicCloudConnectorListResult implements JsonSerializable { + /* + * The PublicCloudConnector items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of PublicCloudConnectorListResult class. + */ + private PublicCloudConnectorListResult() { + } + + /** + * Get the value property: The PublicCloudConnector items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model PublicCloudConnectorListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PublicCloudConnectorListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicCloudConnectorListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicCloudConnectorListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PublicCloudConnectorListResult. + */ + public static PublicCloudConnectorListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicCloudConnectorListResult deserializedPublicCloudConnectorListResult + = new PublicCloudConnectorListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> PublicCloudConnectorInner.fromJson(reader1)); + deserializedPublicCloudConnectorListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPublicCloudConnectorListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicCloudConnectorListResult; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationList.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/ServiceConfigurationList.java similarity index 78% rename from sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationList.java rename to sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/ServiceConfigurationList.java index a4b5dd767d6e..80d3a20f6611 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationList.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/ServiceConfigurationList.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.hybridconnectivity.models; +package com.azure.resourcemanager.hybridconnectivity.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +17,7 @@ /** * The paginated list of serviceConfigurations. */ -@Fluent +@Immutable public final class ServiceConfigurationList implements JsonSerializable { /* * The list of service configuration @@ -31,7 +32,7 @@ public final class ServiceConfigurationList implements JsonSerializable value() { return this.value; } - /** - * Set the value property: The list of service configuration. - * - * @param value the value value to set. - * @return the ServiceConfigurationList object itself. - */ - public ServiceConfigurationList withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: The link to fetch the next page of connected cluster. * @@ -63,28 +53,22 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The link to fetch the next page of connected cluster. - * - * @param nextLink the nextLink value to set. - * @return the ServiceConfigurationList object itself. - */ - public ServiceConfigurationList 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) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ServiceConfigurationList")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ServiceConfigurationList.class); + /** * {@inheritDoc} */ @@ -102,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ServiceConfigurationList if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ServiceConfigurationList. */ public static ServiceConfigurationList fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/SolutionConfigurationListResult.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/SolutionConfigurationListResult.java new file mode 100644 index 000000000000..4af9ad13ce70 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/SolutionConfigurationListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SolutionConfiguration list operation. + */ +@Immutable +public final class SolutionConfigurationListResult implements JsonSerializable { + /* + * The SolutionConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SolutionConfigurationListResult class. + */ + private SolutionConfigurationListResult() { + } + + /** + * Get the value property: The SolutionConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SolutionConfigurationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SolutionConfigurationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SolutionConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SolutionConfigurationListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SolutionConfigurationListResult. + */ + public static SolutionConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SolutionConfigurationListResult deserializedSolutionConfigurationListResult + = new SolutionConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SolutionConfigurationInner.fromJson(reader1)); + deserializedSolutionConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSolutionConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSolutionConfigurationListResult; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/SolutionTypeResourceListResult.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/SolutionTypeResourceListResult.java new file mode 100644 index 000000000000..c6ddc761018c --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/models/SolutionTypeResourceListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionTypeResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a SolutionTypeResource list operation. + */ +@Immutable +public final class SolutionTypeResourceListResult implements JsonSerializable { + /* + * The SolutionTypeResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of SolutionTypeResourceListResult class. + */ + private SolutionTypeResourceListResult() { + } + + /** + * Get the value property: The SolutionTypeResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model SolutionTypeResourceListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SolutionTypeResourceListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SolutionTypeResourceListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SolutionTypeResourceListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SolutionTypeResourceListResult. + */ + public static SolutionTypeResourceListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SolutionTypeResourceListResult deserializedSolutionTypeResourceListResult + = new SolutionTypeResourceListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> SolutionTypeResourceInner.fromJson(reader1)); + deserializedSolutionTypeResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSolutionTypeResourceListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSolutionTypeResourceListResult; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/package-info.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/package-info.java index fc14fa0d3394..9d23737ce4e8 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/package-info.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for HybridConnectivityManagementApi. - * REST API for Hybrid Connectivity. + * Package containing the implementations for HybridConnectivity. + * REST API for public clouds. */ package com.azure.resourcemanager.hybridconnectivity.implementation; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ActionType.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ActionType.java index 96ce075f4c5a..59e2b0b56e32 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ActionType.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ActionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** - * Static value Internal for ActionType. + * Actions are for internal-only APIs. */ public static final ActionType INTERNAL = fromString("Internal"); diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/AwsCloudProfile.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/AwsCloudProfile.java new file mode 100644 index 000000000000..c185fdd0e5ea --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/AwsCloudProfile.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * cloud profile for AWS. + */ +@Fluent +public final class AwsCloudProfile implements JsonSerializable { + /* + * Account id for the AWS account. + */ + private String accountId; + + /* + * List of AWS accounts which need to be excluded. + */ + private List excludedAccounts; + + /* + * Boolean value that indicates whether the account is organizational or not. True represents organization account, + * whereas false represents a single account. + */ + private Boolean isOrganizationalAccount; + + /** + * Creates an instance of AwsCloudProfile class. + */ + public AwsCloudProfile() { + } + + /** + * Get the accountId property: Account id for the AWS account. + * + * @return the accountId value. + */ + public String accountId() { + return this.accountId; + } + + /** + * Set the accountId property: Account id for the AWS account. + * + * @param accountId the accountId value to set. + * @return the AwsCloudProfile object itself. + */ + public AwsCloudProfile withAccountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Get the excludedAccounts property: List of AWS accounts which need to be excluded. + * + * @return the excludedAccounts value. + */ + public List excludedAccounts() { + return this.excludedAccounts; + } + + /** + * Set the excludedAccounts property: List of AWS accounts which need to be excluded. + * + * @param excludedAccounts the excludedAccounts value to set. + * @return the AwsCloudProfile object itself. + */ + public AwsCloudProfile withExcludedAccounts(List excludedAccounts) { + this.excludedAccounts = excludedAccounts; + return this; + } + + /** + * Get the isOrganizationalAccount property: Boolean value that indicates whether the account is organizational or + * not. True represents organization account, whereas false represents a single account. + * + * @return the isOrganizationalAccount value. + */ + public Boolean isOrganizationalAccount() { + return this.isOrganizationalAccount; + } + + /** + * Set the isOrganizationalAccount property: Boolean value that indicates whether the account is organizational or + * not. True represents organization account, whereas false represents a single account. + * + * @param isOrganizationalAccount the isOrganizationalAccount value to set. + * @return the AwsCloudProfile object itself. + */ + public AwsCloudProfile withIsOrganizationalAccount(Boolean isOrganizationalAccount) { + this.isOrganizationalAccount = isOrganizationalAccount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accountId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property accountId in model AwsCloudProfile")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AwsCloudProfile.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountId", this.accountId); + jsonWriter.writeArrayField("excludedAccounts", this.excludedAccounts, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isOrganizationalAccount", this.isOrganizationalAccount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AwsCloudProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AwsCloudProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AwsCloudProfile. + */ + public static AwsCloudProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AwsCloudProfile deserializedAwsCloudProfile = new AwsCloudProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountId".equals(fieldName)) { + deserializedAwsCloudProfile.accountId = reader.getString(); + } else if ("excludedAccounts".equals(fieldName)) { + List excludedAccounts = reader.readArray(reader1 -> reader1.getString()); + deserializedAwsCloudProfile.excludedAccounts = excludedAccounts; + } else if ("isOrganizationalAccount".equals(fieldName)) { + deserializedAwsCloudProfile.isOrganizationalAccount = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedAwsCloudProfile; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/CloudNativeType.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/CloudNativeType.java new file mode 100644 index 000000000000..7da3af6e30cb --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/CloudNativeType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Cloud Native Type enum. + */ +public final class CloudNativeType extends ExpandableStringEnum { + /** + * ec2 enum. + */ + public static final CloudNativeType EC2 = fromString("ec2"); + + /** + * Creates a new instance of CloudNativeType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CloudNativeType() { + } + + /** + * Creates or finds a CloudNativeType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CloudNativeType. + */ + public static CloudNativeType fromString(String name) { + return fromString(name, CloudNativeType.class); + } + + /** + * Gets known CloudNativeType values. + * + * @return known CloudNativeType values. + */ + public static Collection values() { + return values(CloudNativeType.class); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointAccessResource.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointAccessResource.java index 12b9ad84f7aa..95952b9bcf92 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointAccessResource.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointAccessResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointProperties.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointProperties.java index 3f23a147a9a6..5b28d6c7f8f2 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointProperties.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointResource.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointResource.java index 4a121639230b..72e1d305f860 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointResource.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/EndpointResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -78,7 +78,7 @@ interface WithScope { /** * Specifies resourceUri. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @return the next definition stage. */ WithCreate withExistingResourceUri(String resourceUri); diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Endpoints.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Endpoints.java index 4b75fbfabae6..76e23c8a9c15 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Endpoints.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Endpoints.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -12,33 +12,10 @@ * Resource collection API of Endpoints. */ public interface Endpoints { - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceUri); - - /** - * List of endpoints to the target resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of endpoints as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceUri, Context context); - /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -51,7 +28,7 @@ public interface Endpoints { /** * Gets the endpoint to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -63,7 +40,7 @@ public interface Endpoints { /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -76,7 +53,7 @@ public interface Endpoints { /** * Deletes the endpoint access to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -84,10 +61,33 @@ public interface Endpoints { */ void deleteByResourceGroup(String resourceUri, String endpointName); + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * List of endpoints to the target resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 list of endpoints as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); + /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listCredentialsRequest Object of type ListCredentialsRequest. @@ -103,7 +103,7 @@ Response listCredentialsWithResponse(String resourceUri, /** * Gets the endpoint access credentials to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -115,7 +115,7 @@ Response listCredentialsWithResponse(String resourceUri, /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param expiresin The is how long the endpoint access token is valid (in seconds). * @param listIngressGatewayCredentialsRequest Object of type ListIngressGatewayCredentialsRequest. @@ -131,7 +131,7 @@ Response listIngressGatewayCredentialsWithResponse(Strin /** * Gets the ingress gateway endpoint credentials. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -143,7 +143,7 @@ Response listIngressGatewayCredentialsWithResponse(Strin /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @param context The context to associate with this operation. @@ -158,7 +158,7 @@ Response listManagedProxyDetailsWithResponse(String resour /** * Fetches the managed proxy details. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param managedProxyRequest Object of type ManagedProxyRequest. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/GenerateAwsTemplateRequest.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/GenerateAwsTemplateRequest.java new file mode 100644 index 000000000000..6622b09eadb3 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/GenerateAwsTemplateRequest.java @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + */ +@Fluent +public final class GenerateAwsTemplateRequest implements JsonSerializable { + /* + * The name of public cloud connector + */ + private String connectorId; + + /* + * The list of solution types and their settings + */ + private List solutionTypes; + + /** + * Creates an instance of GenerateAwsTemplateRequest class. + */ + public GenerateAwsTemplateRequest() { + } + + /** + * Get the connectorId property: The name of public cloud connector. + * + * @return the connectorId value. + */ + public String connectorId() { + return this.connectorId; + } + + /** + * Set the connectorId property: The name of public cloud connector. + * + * @param connectorId the connectorId value to set. + * @return the GenerateAwsTemplateRequest object itself. + */ + public GenerateAwsTemplateRequest withConnectorId(String connectorId) { + this.connectorId = connectorId; + return this; + } + + /** + * Get the solutionTypes property: The list of solution types and their settings. + * + * @return the solutionTypes value. + */ + public List solutionTypes() { + return this.solutionTypes; + } + + /** + * Set the solutionTypes property: The list of solution types and their settings. + * + * @param solutionTypes the solutionTypes value to set. + * @return the GenerateAwsTemplateRequest object itself. + */ + public GenerateAwsTemplateRequest withSolutionTypes(List solutionTypes) { + this.solutionTypes = solutionTypes; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (connectorId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property connectorId in model GenerateAwsTemplateRequest")); + } + if (solutionTypes() != null) { + solutionTypes().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GenerateAwsTemplateRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connectorId", this.connectorId); + jsonWriter.writeArrayField("solutionTypes", this.solutionTypes, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GenerateAwsTemplateRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GenerateAwsTemplateRequest if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GenerateAwsTemplateRequest. + */ + public static GenerateAwsTemplateRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GenerateAwsTemplateRequest deserializedGenerateAwsTemplateRequest = new GenerateAwsTemplateRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("connectorId".equals(fieldName)) { + deserializedGenerateAwsTemplateRequest.connectorId = reader.getString(); + } else if ("solutionTypes".equals(fieldName)) { + List solutionTypes + = reader.readArray(reader1 -> SolutionTypeSettings.fromJson(reader1)); + deserializedGenerateAwsTemplateRequest.solutionTypes = solutionTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedGenerateAwsTemplateRequest; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/GenerateAwsTemplates.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/GenerateAwsTemplates.java new file mode 100644 index 000000000000..e06ad7fbd618 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/GenerateAwsTemplates.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of GenerateAwsTemplates. + */ +public interface GenerateAwsTemplates { + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response}. + */ + Response postWithResponse(GenerateAwsTemplateRequest generateAwsTemplateRequest, Context context); + + /** + * Retrieve AWS Cloud Formation template. + * + * @param generateAwsTemplateRequest ConnectorId and SolutionTypes and their properties to Generate AWS CFT + * Template. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + PostResponse post(GenerateAwsTemplateRequest generateAwsTemplateRequest); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/HostType.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/HostType.java new file mode 100644 index 000000000000..ea835bda3691 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/HostType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum of host cloud the public cloud connector is referencing. + */ +public final class HostType extends ExpandableStringEnum { + /** + * AWS state. + */ + public static final HostType AWS = fromString("AWS"); + + /** + * Creates a new instance of HostType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public HostType() { + } + + /** + * Creates or finds a HostType from its string representation. + * + * @param name a name to look for. + * @return the corresponding HostType. + */ + public static HostType fromString(String name) { + return fromString(name, HostType.class); + } + + /** + * Gets known HostType values. + * + * @return known HostType values. + */ + public static Collection values() { + return values(HostType.class); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/IngressGatewayResource.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/IngressGatewayResource.java index 397fc18e31e8..112f2f038acd 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/IngressGatewayResource.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/IngressGatewayResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Inventories.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Inventories.java new file mode 100644 index 000000000000..05b02f65b483 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Inventories.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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 Inventories. + */ +public interface Inventories { + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 a InventoryResource along with {@link Response}. + */ + Response getWithResponse(String resourceUri, String solutionConfiguration, String inventoryId, + Context context); + + /** + * Get a InventoryResource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param inventoryId Inventory 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 InventoryResource. + */ + InventoryResource get(String resourceUri, String solutionConfiguration, String inventoryId); + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySolutionConfiguration(String resourceUri, String solutionConfiguration); + + /** + * List InventoryResource resources by SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response of a InventoryResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listBySolutionConfiguration(String resourceUri, String solutionConfiguration, + Context context); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/InventoryProperties.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/InventoryProperties.java new file mode 100644 index 000000000000..ed726c4727db --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/InventoryProperties.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Definition of inventory. + */ +@Immutable +public final class InventoryProperties implements JsonSerializable { + /* + * Gets or sets the cloud native resource type. + */ + private CloudNativeType cloudNativeType; + + /* + * Gets or sets the cloud native resource name. + */ + private String cloudNativeResourceId; + + /* + * Gets or sets the mapped azure resource id. + */ + private String azureResourceId; + + /* + * Gets or sets the status of the inventory. + */ + private SolutionConfigurationStatus status; + + /* + * Gets or sets the status details. + */ + private String statusDetails; + + /* + * The resource provisioning state. + */ + private ResourceProvisioningState provisioningState; + + /** + * Creates an instance of InventoryProperties class. + */ + private InventoryProperties() { + } + + /** + * Get the cloudNativeType property: Gets or sets the cloud native resource type. + * + * @return the cloudNativeType value. + */ + public CloudNativeType cloudNativeType() { + return this.cloudNativeType; + } + + /** + * Get the cloudNativeResourceId property: Gets or sets the cloud native resource name. + * + * @return the cloudNativeResourceId value. + */ + public String cloudNativeResourceId() { + return this.cloudNativeResourceId; + } + + /** + * Get the azureResourceId property: Gets or sets the mapped azure resource id. + * + * @return the azureResourceId value. + */ + public String azureResourceId() { + return this.azureResourceId; + } + + /** + * Get the status property: Gets or sets the status of the inventory. + * + * @return the status value. + */ + public SolutionConfigurationStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: Gets or sets the status details. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the provisioningState property: The resource provisioning state. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cloudNativeType", + this.cloudNativeType == null ? null : this.cloudNativeType.toString()); + jsonWriter.writeStringField("cloudNativeResourceId", this.cloudNativeResourceId); + jsonWriter.writeStringField("azureResourceId", this.azureResourceId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("statusDetails", this.statusDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InventoryProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InventoryProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the InventoryProperties. + */ + public static InventoryProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InventoryProperties deserializedInventoryProperties = new InventoryProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("cloudNativeType".equals(fieldName)) { + deserializedInventoryProperties.cloudNativeType = CloudNativeType.fromString(reader.getString()); + } else if ("cloudNativeResourceId".equals(fieldName)) { + deserializedInventoryProperties.cloudNativeResourceId = reader.getString(); + } else if ("azureResourceId".equals(fieldName)) { + deserializedInventoryProperties.azureResourceId = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedInventoryProperties.status = SolutionConfigurationStatus.fromString(reader.getString()); + } else if ("statusDetails".equals(fieldName)) { + deserializedInventoryProperties.statusDetails = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedInventoryProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedInventoryProperties; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/InventoryResource.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/InventoryResource.java new file mode 100644 index 000000000000..331692e93ab9 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/InventoryResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.InventoryResourceInner; + +/** + * An immutable client-side representation of InventoryResource. + */ +public interface InventoryResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + InventoryProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hybridconnectivity.fluent.models.InventoryResourceInner object. + * + * @return the inner object. + */ + InventoryResourceInner innerModel(); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ListCredentialsRequest.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ListCredentialsRequest.java index e2cb16ff1270..4bbaee69830d 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ListCredentialsRequest.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ListCredentialsRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ListIngressGatewayCredentialsRequest.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ListIngressGatewayCredentialsRequest.java index ce8cb9ee6f29..ba5b13ee6568 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ListIngressGatewayCredentialsRequest.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ListIngressGatewayCredentialsRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -18,7 +18,7 @@ public final class ListIngressGatewayCredentialsRequest implements JsonSerializable { /* - * The name of the service. + * The name of the service. If not provided, the request will by pass the generation of service configuration token. */ private ServiceName serviceName; @@ -29,7 +29,8 @@ public ListIngressGatewayCredentialsRequest() { } /** - * Get the serviceName property: The name of the service. + * Get the serviceName property: The name of the service. If not provided, the request will by pass the generation + * of service configuration token. * * @return the serviceName value. */ @@ -38,7 +39,8 @@ public ServiceName serviceName() { } /** - * Set the serviceName property: The name of the service. + * Set the serviceName property: The name of the service. If not provided, the request will by pass the generation + * of service configuration token. * * @param serviceName the serviceName value to set. * @return the ListIngressGatewayCredentialsRequest object itself. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ManagedProxyRequest.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ManagedProxyRequest.java index 531420c8987b..887d8936d9b8 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ManagedProxyRequest.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ManagedProxyRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ManagedProxyResource.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ManagedProxyResource.java index ad8629e9f987..2ea83d8da64a 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ManagedProxyResource.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ManagedProxyResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Operation.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Operation.java index 72dc659c428b..aeae2217e2b9 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Operation.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -20,7 +20,7 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -42,8 +42,8 @@ public interface Operation { Origin origin(); /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/OperationDisplay.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/OperationDisplay.java index 2de9eeff3e6c..01a140813039 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/OperationDisplay.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/OperationDisplay.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for and operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable operations(); + + /** + * Gets the error property: If present, details of the operation error. + * + * @return the error value. + */ + ManagementError error(); + + /** + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the inner com.azure.resourcemanager.hybridconnectivity.fluent.models.OperationStatusResultInner object. + * + * @return the inner object. + */ + OperationStatusResultInner innerModel(); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Operations.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Operations.java index a1ce9526b738..c9ffebf25698 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Operations.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -12,7 +12,7 @@ */ public interface Operations { /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -22,7 +22,7 @@ public interface Operations { PagedIterable list(); /** - * Lists the available Hybrid Connectivity REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Origin.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Origin.java index ad108562cafc..9d24ff5fbfa3 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Origin.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Origin.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -13,17 +13,17 @@ */ public final class Origin extends ExpandableStringEnum { /** - * Static value user for Origin. + * Indicates the operation is initiated by a user. */ public static final Origin USER = fromString("user"); /** - * Static value system for Origin. + * Indicates the operation is initiated by a system. */ public static final Origin SYSTEM = fromString("system"); /** - * Static value user,system for Origin. + * Indicates the operation is initiated by a user or system. */ public static final Origin USER_SYSTEM = fromString("user,system"); diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PostResponse.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PostResponse.java new file mode 100644 index 000000000000..59d400102ccc --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PostResponse.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PostResponseInner; + +/** + * An immutable client-side representation of PostResponse. + */ +public interface PostResponse { + /** + * Gets the inner com.azure.resourcemanager.hybridconnectivity.fluent.models.PostResponseInner object. + * + * @return the inner object. + */ + PostResponseInner innerModel(); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ProvisioningState.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ProvisioningState.java index 90f8a04ac62b..45dbc52a5141 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ProvisioningState.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java new file mode 100644 index 000000000000..db2895033391 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnector.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PublicCloudConnectorInner; +import java.util.Map; + +/** + * An immutable client-side representation of PublicCloudConnector. + */ +public interface PublicCloudConnector { + /** + * 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 properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + PublicCloudConnectorProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.hybridconnectivity.fluent.models.PublicCloudConnectorInner object. + * + * @return the inner object. + */ + PublicCloudConnectorInner innerModel(); + + /** + * The entirety of the PublicCloudConnector definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The PublicCloudConnector definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the PublicCloudConnector definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the PublicCloudConnector 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 PublicCloudConnector definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the PublicCloudConnector 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + PublicCloudConnector create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + PublicCloudConnector create(Context context); + } + + /** + * The stage of the PublicCloudConnector 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 PublicCloudConnector definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(PublicCloudConnectorProperties properties); + } + } + + /** + * Begins update for the PublicCloudConnector resource. + * + * @return the stage of resource update. + */ + PublicCloudConnector.Update update(); + + /** + * The template for PublicCloudConnector update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + PublicCloudConnector apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + PublicCloudConnector apply(Context context); + } + + /** + * The PublicCloudConnector update stages. + */ + interface UpdateStages { + /** + * The stage of the PublicCloudConnector 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 PublicCloudConnector update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(PublicCloudConnectorProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + PublicCloudConnector refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + PublicCloudConnector refresh(Context context); + + /** + * A long-running resource action. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationStatusResult testPermissions(); + + /** + * A long-running resource action. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationStatusResult testPermissions(Context context); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectorProperties.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectorProperties.java new file mode 100644 index 000000000000..56074ea114e4 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectorProperties.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Properties of public cloud connectors. + */ +@Fluent +public final class PublicCloudConnectorProperties implements JsonSerializable { + /* + * Cloud profile for AWS. + */ + private AwsCloudProfile awsCloudProfile; + + /* + * Host cloud the public cloud connector. + */ + private HostType hostType; + + /* + * The resource provisioning state. + */ + private ResourceProvisioningState provisioningState; + + /* + * Connector primary identifier. + */ + private String connectorPrimaryIdentifier; + + /** + * Creates an instance of PublicCloudConnectorProperties class. + */ + public PublicCloudConnectorProperties() { + } + + /** + * Get the awsCloudProfile property: Cloud profile for AWS. + * + * @return the awsCloudProfile value. + */ + public AwsCloudProfile awsCloudProfile() { + return this.awsCloudProfile; + } + + /** + * Set the awsCloudProfile property: Cloud profile for AWS. + * + * @param awsCloudProfile the awsCloudProfile value to set. + * @return the PublicCloudConnectorProperties object itself. + */ + public PublicCloudConnectorProperties withAwsCloudProfile(AwsCloudProfile awsCloudProfile) { + this.awsCloudProfile = awsCloudProfile; + return this; + } + + /** + * Get the hostType property: Host cloud the public cloud connector. + * + * @return the hostType value. + */ + public HostType hostType() { + return this.hostType; + } + + /** + * Set the hostType property: Host cloud the public cloud connector. + * + * @param hostType the hostType value to set. + * @return the PublicCloudConnectorProperties object itself. + */ + public PublicCloudConnectorProperties withHostType(HostType hostType) { + this.hostType = hostType; + return this; + } + + /** + * Get the provisioningState property: The resource provisioning state. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the connectorPrimaryIdentifier property: Connector primary identifier. + * + * @return the connectorPrimaryIdentifier value. + */ + public String connectorPrimaryIdentifier() { + return this.connectorPrimaryIdentifier; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (awsCloudProfile() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property awsCloudProfile in model PublicCloudConnectorProperties")); + } else { + awsCloudProfile().validate(); + } + if (hostType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property hostType in model PublicCloudConnectorProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PublicCloudConnectorProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("awsCloudProfile", this.awsCloudProfile); + jsonWriter.writeStringField("hostType", this.hostType == null ? null : this.hostType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PublicCloudConnectorProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PublicCloudConnectorProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PublicCloudConnectorProperties. + */ + public static PublicCloudConnectorProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PublicCloudConnectorProperties deserializedPublicCloudConnectorProperties + = new PublicCloudConnectorProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("awsCloudProfile".equals(fieldName)) { + deserializedPublicCloudConnectorProperties.awsCloudProfile = AwsCloudProfile.fromJson(reader); + } else if ("hostType".equals(fieldName)) { + deserializedPublicCloudConnectorProperties.hostType = HostType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedPublicCloudConnectorProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else if ("connectorPrimaryIdentifier".equals(fieldName)) { + deserializedPublicCloudConnectorProperties.connectorPrimaryIdentifier = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPublicCloudConnectorProperties; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java new file mode 100644 index 000000000000..b6d42a98c902 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/PublicCloudConnectors.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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 PublicCloudConnectors. + */ +public interface PublicCloudConnectors { + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 a PublicCloudConnector along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String publicCloudConnector, + Context context); + + /** + * Get a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 PublicCloudConnector. + */ + PublicCloudConnector getByResourceGroup(String resourceGroupName, String publicCloudConnector); + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceGroupName, String publicCloudConnector, + Context context); + + /** + * Delete a PublicCloudConnector. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 publicCloudConnector); + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List PublicCloudConnector resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List PublicCloudConnector resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a PublicCloudConnector list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response. + */ + OperationStatusResult testPermissions(String resourceGroupName, String publicCloudConnector); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param publicCloudConnector Represent public cloud connectors 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 response. + */ + OperationStatusResult testPermissions(String resourceGroupName, String publicCloudConnector, Context context); + + /** + * Get a PublicCloudConnector. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a PublicCloudConnector along with {@link Response}. + */ + PublicCloudConnector getById(String id); + + /** + * Get a PublicCloudConnector. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a PublicCloudConnector along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a PublicCloudConnector. + * + * @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); + + /** + * Delete a PublicCloudConnector. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new PublicCloudConnector resource. + * + * @param name resource name. + * @return the first stage of the new PublicCloudConnector definition. + */ + PublicCloudConnector.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ResourceProvisioningState.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ResourceProvisioningState.java new file mode 100644 index 000000000000..ce44995603e1 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ResourceProvisioningState.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of a resource type. + */ +public final class ResourceProvisioningState extends ExpandableStringEnum { + /** + * Resource has been created. + */ + public static final ResourceProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Resource creation failed. + */ + public static final ResourceProvisioningState FAILED = fromString("Failed"); + + /** + * Resource creation was canceled. + */ + public static final ResourceProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ResourceProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceProvisioningState() { + } + + /** + * Creates or finds a ResourceProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceProvisioningState. + */ + public static ResourceProvisioningState fromString(String name) { + return fromString(name, ResourceProvisioningState.class); + } + + /** + * Gets known ResourceProvisioningState values. + * + * @return known ResourceProvisioningState values. + */ + public static Collection values() { + return values(ResourceProvisioningState.class); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationResource.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationResource.java index f0d58fa10827..2b4b8dbe2486 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationResource.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -100,7 +100,7 @@ interface WithParentResource { /** * Specifies resourceUri, endpointName. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @return the next definition stage. */ diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationResourcePatch.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationResourcePatch.java index da4c2d78c342..ba2d0de21722 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationResourcePatch.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurationResourcePatch.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurations.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurations.java index 8140846203fd..a74f543bafce 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurations.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceConfigurations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; @@ -12,40 +12,10 @@ * Resource collection API of ServiceConfigurations. */ public interface ServiceConfigurations { - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. - */ - PagedIterable listByEndpointResource(String resourceUri, String endpointName); - - /** - * Lists of all the services associated with endpoint resource. - * - * API to enumerate registered services in service configurations under a Endpoint Resource. - * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. - * @param endpointName The endpoint name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. - */ - PagedIterable listByEndpointResource(String resourceUri, String endpointName, - Context context); - /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param context The context to associate with this operation. @@ -60,7 +30,7 @@ Response getWithResponse(String resourceUri, Strin /** * Gets the details about the service to the resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -73,7 +43,7 @@ Response getWithResponse(String resourceUri, Strin /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @param context The context to associate with this operation. @@ -88,7 +58,7 @@ Response deleteWithResponse(String resourceUri, String endpointName, Strin /** * Deletes the service details to the target resource. * - * @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be connected. + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. * @param endpointName The endpoint name. * @param serviceConfigurationName The service name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -97,6 +67,36 @@ Response deleteWithResponse(String resourceUri, String endpointName, Strin */ void delete(String resourceUri, String endpointName, String serviceConfigurationName); + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpointResource(String resourceUri, String endpointName); + + /** + * Lists of all the services associated with endpoint resource. + * + * API to enumerate registered services in service configurations under a Endpoint Resource. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param endpointName The endpoint name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the paginated list of serviceConfigurations as paginated response with {@link PagedIterable}. + */ + PagedIterable listByEndpointResource(String resourceUri, String endpointName, + Context context); + /** * Gets the details about the service to the resource. * diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceName.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceName.java index 19087d431d0d..4e5092b859cb 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceName.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/ServiceName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfiguration.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfiguration.java new file mode 100644 index 000000000000..751cdfb555e2 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfiguration.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionConfigurationInner; + +/** + * An immutable client-side representation of SolutionConfiguration. + */ +public interface SolutionConfiguration { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SolutionConfigurationProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionConfigurationInner object. + * + * @return the inner object. + */ + SolutionConfigurationInner innerModel(); + + /** + * The entirety of the SolutionConfiguration definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { + } + + /** + * The SolutionConfiguration definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SolutionConfiguration definition. + */ + interface Blank extends WithScope { + } + + /** + * The stage of the SolutionConfiguration definition allowing to specify parent resource. + */ + interface WithScope { + /** + * Specifies resourceUri. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @return the next definition stage. + */ + WithCreate withExistingResourceUri(String resourceUri); + } + + /** + * The stage of the SolutionConfiguration 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.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + SolutionConfiguration create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SolutionConfiguration create(Context context); + } + + /** + * The stage of the SolutionConfiguration definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(SolutionConfigurationProperties properties); + } + } + + /** + * Begins update for the SolutionConfiguration resource. + * + * @return the stage of resource update. + */ + SolutionConfiguration.Update update(); + + /** + * The template for SolutionConfiguration update. + */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SolutionConfiguration apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SolutionConfiguration apply(Context context); + } + + /** + * The SolutionConfiguration update stages. + */ + interface UpdateStages { + /** + * The stage of the SolutionConfiguration update allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + Update withProperties(SolutionConfigurationProperties properties); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SolutionConfiguration refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SolutionConfiguration refresh(Context context); + + /** + * Trigger immediate sync with source cloud. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationStatusResult syncNow(); + + /** + * Trigger immediate sync with source cloud. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + OperationStatusResult syncNow(Context context); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurationProperties.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurationProperties.java new file mode 100644 index 000000000000..1438050d85a1 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurationProperties.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Solution configuration resource. + */ +@Fluent +public final class SolutionConfigurationProperties implements JsonSerializable { + /* + * The resource provisioning state. + */ + private ResourceProvisioningState provisioningState; + + /* + * The type of the solution + */ + private String solutionType; + + /* + * Solution settings + */ + private SolutionSettings solutionSettings; + + /* + * The status of solution configurations + */ + private SolutionConfigurationStatus status; + + /* + * The detailed message of status details + */ + private String statusDetails; + + /* + * The last time resources were inventoried + */ + private OffsetDateTime lastSyncTime; + + /** + * Creates an instance of SolutionConfigurationProperties class. + */ + public SolutionConfigurationProperties() { + } + + /** + * Get the provisioningState property: The resource provisioning state. + * + * @return the provisioningState value. + */ + public ResourceProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the solutionType property: The type of the solution. + * + * @return the solutionType value. + */ + public String solutionType() { + return this.solutionType; + } + + /** + * Set the solutionType property: The type of the solution. + * + * @param solutionType the solutionType value to set. + * @return the SolutionConfigurationProperties object itself. + */ + public SolutionConfigurationProperties withSolutionType(String solutionType) { + this.solutionType = solutionType; + return this; + } + + /** + * Get the solutionSettings property: Solution settings. + * + * @return the solutionSettings value. + */ + public SolutionSettings solutionSettings() { + return this.solutionSettings; + } + + /** + * Set the solutionSettings property: Solution settings. + * + * @param solutionSettings the solutionSettings value to set. + * @return the SolutionConfigurationProperties object itself. + */ + public SolutionConfigurationProperties withSolutionSettings(SolutionSettings solutionSettings) { + this.solutionSettings = solutionSettings; + return this; + } + + /** + * Get the status property: The status of solution configurations. + * + * @return the status value. + */ + public SolutionConfigurationStatus status() { + return this.status; + } + + /** + * Get the statusDetails property: The detailed message of status details. + * + * @return the statusDetails value. + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the lastSyncTime property: The last time resources were inventoried. + * + * @return the lastSyncTime value. + */ + public OffsetDateTime lastSyncTime() { + return this.lastSyncTime; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (solutionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property solutionType in model SolutionConfigurationProperties")); + } + if (solutionSettings() != null) { + solutionSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SolutionConfigurationProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("solutionType", this.solutionType); + jsonWriter.writeJsonField("solutionSettings", this.solutionSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SolutionConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SolutionConfigurationProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SolutionConfigurationProperties. + */ + public static SolutionConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SolutionConfigurationProperties deserializedSolutionConfigurationProperties + = new SolutionConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("solutionType".equals(fieldName)) { + deserializedSolutionConfigurationProperties.solutionType = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSolutionConfigurationProperties.provisioningState + = ResourceProvisioningState.fromString(reader.getString()); + } else if ("solutionSettings".equals(fieldName)) { + deserializedSolutionConfigurationProperties.solutionSettings = SolutionSettings.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedSolutionConfigurationProperties.status + = SolutionConfigurationStatus.fromString(reader.getString()); + } else if ("statusDetails".equals(fieldName)) { + deserializedSolutionConfigurationProperties.statusDetails = reader.getString(); + } else if ("lastSyncTime".equals(fieldName)) { + deserializedSolutionConfigurationProperties.lastSyncTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSolutionConfigurationProperties; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurationStatus.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurationStatus.java new file mode 100644 index 000000000000..35eae393ccd9 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurationStatus.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Solution Configuration Status. + */ +public final class SolutionConfigurationStatus extends ExpandableStringEnum { + /** + * New status. + */ + public static final SolutionConfigurationStatus NEW = fromString("New"); + + /** + * InProgress status. + */ + public static final SolutionConfigurationStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Canceled status. + */ + public static final SolutionConfigurationStatus COMPLETED = fromString("Completed"); + + /** + * Failed status. + */ + public static final SolutionConfigurationStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of SolutionConfigurationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SolutionConfigurationStatus() { + } + + /** + * Creates or finds a SolutionConfigurationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding SolutionConfigurationStatus. + */ + public static SolutionConfigurationStatus fromString(String name) { + return fromString(name, SolutionConfigurationStatus.class); + } + + /** + * Gets known SolutionConfigurationStatus values. + * + * @return known SolutionConfigurationStatus values. + */ + public static Collection values() { + return values(SolutionConfigurationStatus.class); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurations.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurations.java new file mode 100644 index 000000000000..ad412bb72983 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionConfigurations.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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 SolutionConfigurations. + */ +public interface SolutionConfigurations { + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 a SolutionConfiguration along with {@link Response}. + */ + Response getWithResponse(String resourceUri, String solutionConfiguration, Context context); + + /** + * Get a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 SolutionConfiguration. + */ + SolutionConfiguration get(String resourceUri, String solutionConfiguration); + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration Resource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByResourceGroupWithResponse(String resourceUri, String solutionConfiguration, Context context); + + /** + * Delete a SolutionConfiguration. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 resourceUri, String solutionConfiguration); + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri); + + /** + * List SolutionConfiguration resources by parent. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the 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 response of a SolutionConfiguration list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String resourceUri, Context context); + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response. + */ + OperationStatusResult syncNow(String resourceUri, String solutionConfiguration); + + /** + * Trigger immediate sync with source cloud. + * + * @param resourceUri The fully qualified Azure Resource manager identifier of the resource. + * @param solutionConfiguration Represent Solution Configuration 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 response. + */ + OperationStatusResult syncNow(String resourceUri, String solutionConfiguration, Context context); + + /** + * Get a SolutionConfiguration. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SolutionConfiguration along with {@link Response}. + */ + SolutionConfiguration getById(String id); + + /** + * Get a SolutionConfiguration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a SolutionConfiguration along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a SolutionConfiguration. + * + * @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); + + /** + * Delete a SolutionConfiguration. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. + */ + Response deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SolutionConfiguration resource. + * + * @param name resource name. + * @return the first stage of the new SolutionConfiguration definition. + */ + SolutionConfiguration.DefinitionStages.Blank define(String name); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionSettings.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionSettings.java new file mode 100644 index 000000000000..2e82aa6a1a68 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionSettings.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * Solution settings. + */ +@Fluent +public final class SolutionSettings implements JsonSerializable { + /* + * Solution settings + */ + private Map additionalProperties; + + /** + * Creates an instance of SolutionSettings class. + */ + public SolutionSettings() { + } + + /** + * Get the additionalProperties property: Solution settings. + * + * @return the additionalProperties value. + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: Solution settings. + * + * @param additionalProperties the additionalProperties value to set. + * @return the SolutionSettings object itself. + */ + public SolutionSettings withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (additionalProperties != null) { + for (Map.Entry additionalProperty : additionalProperties.entrySet()) { + jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SolutionSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SolutionSettings if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the SolutionSettings. + */ + public static SolutionSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SolutionSettings deserializedSolutionSettings = new SolutionSettings(); + Map additionalProperties = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if (additionalProperties == null) { + additionalProperties = new LinkedHashMap<>(); + } + + additionalProperties.put(fieldName, reader.getString()); + } + deserializedSolutionSettings.additionalProperties = additionalProperties; + + return deserializedSolutionSettings; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeProperties.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeProperties.java new file mode 100644 index 000000000000..f492a05e0b09 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Definition of Solution type resource. + */ +@Immutable +public final class SolutionTypeProperties implements JsonSerializable { + /* + * The name of the solution type. + */ + private String solutionType; + + /* + * Short description of solution type. + */ + private String description; + + /* + * The locations this solution is supported in. + */ + private List supportedAzureRegions; + + /* + * Array of solution settings and its description. + */ + private List solutionSettings; + + /** + * Creates an instance of SolutionTypeProperties class. + */ + private SolutionTypeProperties() { + } + + /** + * Get the solutionType property: The name of the solution type. + * + * @return the solutionType value. + */ + public String solutionType() { + return this.solutionType; + } + + /** + * Get the description property: Short description of solution type. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the supportedAzureRegions property: The locations this solution is supported in. + * + * @return the supportedAzureRegions value. + */ + public List supportedAzureRegions() { + return this.supportedAzureRegions; + } + + /** + * Get the solutionSettings property: Array of solution settings and its description. + * + * @return the solutionSettings value. + */ + public List solutionSettings() { + return this.solutionSettings; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (solutionSettings() != null) { + solutionSettings().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("solutionType", this.solutionType); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("supportedAzureRegions", this.supportedAzureRegions, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("solutionSettings", this.solutionSettings, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SolutionTypeProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SolutionTypeProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the SolutionTypeProperties. + */ + public static SolutionTypeProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SolutionTypeProperties deserializedSolutionTypeProperties = new SolutionTypeProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("solutionType".equals(fieldName)) { + deserializedSolutionTypeProperties.solutionType = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedSolutionTypeProperties.description = reader.getString(); + } else if ("supportedAzureRegions".equals(fieldName)) { + List supportedAzureRegions = reader.readArray(reader1 -> reader1.getString()); + deserializedSolutionTypeProperties.supportedAzureRegions = supportedAzureRegions; + } else if ("solutionSettings".equals(fieldName)) { + List solutionSettings + = reader.readArray(reader1 -> SolutionTypeSettingsProperties.fromJson(reader1)); + deserializedSolutionTypeProperties.solutionSettings = solutionSettings; + } else { + reader.skipChildren(); + } + } + + return deserializedSolutionTypeProperties; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeResource.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeResource.java new file mode 100644 index 000000000000..b22e39274215 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeResource.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionTypeResourceInner; + +/** + * An immutable client-side representation of SolutionTypeResource. + */ +public interface SolutionTypeResource { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + SolutionTypeProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionTypeResourceInner object. + * + * @return the inner object. + */ + SolutionTypeResourceInner innerModel(); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeSettings.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeSettings.java new file mode 100644 index 000000000000..fe552bcc02e5 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeSettings.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of Solution Type. + */ +@Fluent +public final class SolutionTypeSettings implements JsonSerializable { + /* + * The type of the solution + */ + private String solutionType; + + /* + * Solution settings + */ + private SolutionSettings solutionSettings; + + /** + * Creates an instance of SolutionTypeSettings class. + */ + public SolutionTypeSettings() { + } + + /** + * Get the solutionType property: The type of the solution. + * + * @return the solutionType value. + */ + public String solutionType() { + return this.solutionType; + } + + /** + * Set the solutionType property: The type of the solution. + * + * @param solutionType the solutionType value to set. + * @return the SolutionTypeSettings object itself. + */ + public SolutionTypeSettings withSolutionType(String solutionType) { + this.solutionType = solutionType; + return this; + } + + /** + * Get the solutionSettings property: Solution settings. + * + * @return the solutionSettings value. + */ + public SolutionSettings solutionSettings() { + return this.solutionSettings; + } + + /** + * Set the solutionSettings property: Solution settings. + * + * @param solutionSettings the solutionSettings value to set. + * @return the SolutionTypeSettings object itself. + */ + public SolutionTypeSettings withSolutionSettings(SolutionSettings solutionSettings) { + this.solutionSettings = solutionSettings; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (solutionType() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property solutionType in model SolutionTypeSettings")); + } + if (solutionSettings() != null) { + solutionSettings().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SolutionTypeSettings.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("solutionType", this.solutionType); + jsonWriter.writeJsonField("solutionSettings", this.solutionSettings); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SolutionTypeSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SolutionTypeSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SolutionTypeSettings. + */ + public static SolutionTypeSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SolutionTypeSettings deserializedSolutionTypeSettings = new SolutionTypeSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("solutionType".equals(fieldName)) { + deserializedSolutionTypeSettings.solutionType = reader.getString(); + } else if ("solutionSettings".equals(fieldName)) { + deserializedSolutionTypeSettings.solutionSettings = SolutionSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSolutionTypeSettings; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeSettingsProperties.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeSettingsProperties.java new file mode 100644 index 000000000000..53c36b2085e6 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypeSettingsProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Represent Solution settings properties description array. + */ +@Immutable +public final class SolutionTypeSettingsProperties implements JsonSerializable { + /* + * The name of the solution setting property. + */ + private String name; + + /* + * The UI friendly name of the solution setting property. + */ + private String displayName; + + /* + * Type of the solution setting property, represented as a string. + */ + private String type; + + /* + * Description of solution setting property. + */ + private String description; + + /* + * Array of allowed values for this solution settings property. + */ + private List allowedValues; + + /* + * Default value for this solution settings property. + */ + private String defaultValue; + + /** + * Creates an instance of SolutionTypeSettingsProperties class. + */ + private SolutionTypeSettingsProperties() { + } + + /** + * Get the name property: The name of the solution setting property. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the displayName property: The UI friendly name of the solution setting property. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Get the type property: Type of the solution setting property, represented as a string. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Get the description property: Description of solution setting property. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the allowedValues property: Array of allowed values for this solution settings property. + * + * @return the allowedValues value. + */ + public List allowedValues() { + return this.allowedValues; + } + + /** + * Get the defaultValue property: Default value for this solution settings property. + * + * @return the defaultValue value. + */ + public String defaultValue() { + return this.defaultValue; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (name() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property name in model SolutionTypeSettingsProperties")); + } + if (displayName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model SolutionTypeSettingsProperties")); + } + if (type() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property type in model SolutionTypeSettingsProperties")); + } + if (description() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property description in model SolutionTypeSettingsProperties")); + } + if (allowedValues() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property allowedValues in model SolutionTypeSettingsProperties")); + } + if (defaultValue() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property defaultValue in model SolutionTypeSettingsProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SolutionTypeSettingsProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("allowedValues", this.allowedValues, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("defaultValue", this.defaultValue); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SolutionTypeSettingsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SolutionTypeSettingsProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SolutionTypeSettingsProperties. + */ + public static SolutionTypeSettingsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SolutionTypeSettingsProperties deserializedSolutionTypeSettingsProperties + = new SolutionTypeSettingsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedSolutionTypeSettingsProperties.name = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedSolutionTypeSettingsProperties.displayName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSolutionTypeSettingsProperties.type = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedSolutionTypeSettingsProperties.description = reader.getString(); + } else if ("allowedValues".equals(fieldName)) { + List allowedValues = reader.readArray(reader1 -> reader1.getString()); + deserializedSolutionTypeSettingsProperties.allowedValues = allowedValues; + } else if ("defaultValue".equals(fieldName)) { + deserializedSolutionTypeSettingsProperties.defaultValue = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSolutionTypeSettingsProperties; + }); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypes.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypes.java new file mode 100644 index 000000000000..5b192d7219dc --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/SolutionTypes.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.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 SolutionTypes. + */ +public interface SolutionTypes { + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 a SolutionTypeResource along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String solutionType, + Context context); + + /** + * Get a SolutionTypeResource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param solutionType Solution Type 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 SolutionTypeResource. + */ + SolutionTypeResource getByResourceGroup(String resourceGroupName, String solutionType); + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List SolutionTypeResource resources by resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * List SolutionTypeResource resources by subscription ID. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response of a SolutionTypeResource list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable list(Context context); +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Type.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Type.java index f8763a4cd4e2..9a0ac44b1c92 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Type.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/Type.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/package-info.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/package-info.java index 14ddfc473818..6ce6280d6a1e 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/package-info.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for HybridConnectivityManagementApi. - * REST API for Hybrid Connectivity. + * Package containing the data models for HybridConnectivity. + * REST API for public clouds. */ package com.azure.resourcemanager.hybridconnectivity.models; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/package-info.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/package-info.java index 1bd401a1fd87..c3ee3f0630f7 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/package-info.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/com/azure/resourcemanager/hybridconnectivity/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for HybridConnectivityManagementApi. - * REST API for Hybrid Connectivity. + * Package containing the classes for HybridConnectivity. + * REST API for public clouds. */ package com.azure.resourcemanager.hybridconnectivity; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/module-info.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/module-info.java index a95a678626d6..eaa43c9c09d3 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/module-info.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/java/module-info.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.hybridconnectivity { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.hybridconnectivity.fluent.models to com.azure.core; opens com.azure.resourcemanager.hybridconnectivity.models to com.azure.core; + opens com.azure.resourcemanager.hybridconnectivity.implementation.models to com.azure.core; } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridconnectivity/proxy-config.json b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridconnectivity/proxy-config.json index 505c27f4c42c..958c91562fd4 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridconnectivity/proxy-config.json +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-hybridconnectivity/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.hybridconnectivity.implementation.EndpointsClientImpl$EndpointsService"],["com.azure.resourcemanager.hybridconnectivity.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.hybridconnectivity.implementation.ServiceConfigurationsClientImpl$ServiceConfigurationsService"]] \ No newline at end of file +[["com.azure.resourcemanager.hybridconnectivity.implementation.EndpointsClientImpl$EndpointsService"],["com.azure.resourcemanager.hybridconnectivity.implementation.GenerateAwsTemplatesClientImpl$GenerateAwsTemplatesService"],["com.azure.resourcemanager.hybridconnectivity.implementation.InventoriesClientImpl$InventoriesService"],["com.azure.resourcemanager.hybridconnectivity.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.hybridconnectivity.implementation.PublicCloudConnectorsClientImpl$PublicCloudConnectorsService"],["com.azure.resourcemanager.hybridconnectivity.implementation.ServiceConfigurationsClientImpl$ServiceConfigurationsService"],["com.azure.resourcemanager.hybridconnectivity.implementation.SolutionConfigurationsClientImpl$SolutionConfigurationsService"],["com.azure.resourcemanager.hybridconnectivity.implementation.SolutionTypesClientImpl$SolutionTypesService"]] \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/resources/azure-resourcemanager-hybridconnectivity.properties b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/resources/azure-resourcemanager-hybridconnectivity.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/main/resources/azure-resourcemanager-hybridconnectivity.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsCreateOrUpdateSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsCreateOrUpdateSamples.java index 88f45fa82310..837987915a58 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsCreateOrUpdateSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsCreateOrUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -12,9 +12,7 @@ */ public final class EndpointsCreateOrUpdateSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPutCustom.json + * x-ms-original-file: 2024-12-01/EndpointsPutCustom.json */ /** * Sample code: HybridConnectivityEndpointsPutCustom. @@ -34,9 +32,7 @@ public static void hybridConnectivityEndpointsPutCustom( } /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPutDefault.json + * x-ms-original-file: 2024-12-01/EndpointsPutDefault.json */ /** * Sample code: HybridConnectivityEndpointsPutDefault. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsDeleteSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsDeleteSamples.java index 58ac0a4832bf..737a26f35ab4 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsDeleteSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -9,9 +9,7 @@ */ public final class EndpointsDeleteSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsDeleteDefault.json + * x-ms-original-file: 2024-12-01/EndpointsDeleteDefault.json */ /** * Sample code: HybridConnectivityEndpointsDeleteDefault. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsGetSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsGetSamples.java index 70daa2ec4327..f11d469cdad0 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsGetSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -9,9 +9,7 @@ */ public final class EndpointsGetSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsGetDefault.json + * x-ms-original-file: 2024-12-01/EndpointsGetDefault.json */ /** * Sample code: HybridConnectivityEndpointsGetDefault. @@ -27,9 +25,7 @@ public static void hybridConnectivityEndpointsGetDefault( } /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsGetCustom.json + * x-ms-original-file: 2024-12-01/EndpointsGetCustom.json */ /** * Sample code: HybridConnectivityEndpointsGetCustom. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListCredentialsSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListCredentialsSamples.java index ec0144f177ec..3e158198d7f9 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListCredentialsSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListCredentialsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -12,9 +12,7 @@ */ public final class EndpointsListCredentialsSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPostListCredentials.json + * x-ms-original-file: 2024-12-01/EndpointsPostListCredentials.json */ /** * Sample code: HybridConnectivityEndpointsPostListCredentials. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListIngressGatewayCredentialsSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListIngressGatewayCredentialsSamples.java index 22071a54731f..cdddb542c6f0 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListIngressGatewayCredentialsSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListIngressGatewayCredentialsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -9,9 +9,7 @@ */ public final class EndpointsListIngressGatewayCredentialsSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPostListIngressGatewayCredentials.json + * x-ms-original-file: 2024-12-01/EndpointsPostListIngressGatewayCredentials.json */ /** * Sample code: HybridConnectivityEndpointsPostListIngressGatewayCredentials. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListManagedProxyDetailsSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListManagedProxyDetailsSamples.java index 6b5f35c1a9af..056d89afc5bd 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListManagedProxyDetailsSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListManagedProxyDetailsSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -12,9 +12,7 @@ */ public final class EndpointsListManagedProxyDetailsSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPostListManagedProxyDetails.json + * x-ms-original-file: 2024-12-01/EndpointsPostListManagedProxyDetails.json */ /** * Sample code: HybridConnectivityEndpointsPostListManagedProxyDetails. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListSamples.java index 7fa3d4eee27f..1f4d9cda0acf 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -9,9 +9,7 @@ */ public final class EndpointsListSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsList.json + * x-ms-original-file: 2024-12-01/EndpointsList.json */ /** * Sample code: HybridConnectivityEndpointsGet. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsUpdateSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsUpdateSamples.java index 1da067d9da22..c669efc228b7 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsUpdateSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -13,9 +13,7 @@ */ public final class EndpointsUpdateSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * EndpointsPatchDefault.json + * x-ms-original-file: 2024-12-01/EndpointsPatchDefault.json */ /** * Sample code: HybridConnectivityEndpointsPatchDefault. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplatePostSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplatePostSamples.java new file mode 100644 index 000000000000..8f569a8db86e --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplatePostSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplateRequest; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeSettings; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for GenerateAwsTemplate Post. + */ +public final class GenerateAwsTemplatePostSamples { + /* + * x-ms-original-file: 2024-12-01/GenerateAwsTemplate_Post.json + */ + /** + * Sample code: GenerateAwsTemplate_Post. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + generateAwsTemplatePost(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.generateAwsTemplates() + .postWithResponse( + new GenerateAwsTemplateRequest().withConnectorId("pnxcfjidglabnwxit") + .withSolutionTypes(Arrays.asList(new SolutionTypeSettings().withSolutionType("hjyownzpfxwiufmd") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf())))), + com.azure.core.util.Context.NONE); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryGetSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryGetSamples.java new file mode 100644 index 000000000000..0ac2cc657b5a --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for Inventory Get. + */ +public final class InventoryGetSamples { + /* + * x-ms-original-file: 2024-12-01/Inventory_Get.json + */ + /** + * Sample code: Inventory_Get. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void inventoryGet(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.inventories() + .getWithResponse("ymuj", "zarfsraogroxlaqjjnwixtn", "xofprmcboosrbd", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryListBySolutionConfigurationSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryListBySolutionConfigurationSamples.java new file mode 100644 index 000000000000..d721efdc05fe --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryListBySolutionConfigurationSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for Inventory ListBySolutionConfiguration. + */ +public final class InventoryListBySolutionConfigurationSamples { + /* + * x-ms-original-file: 2024-12-01/Inventory_ListBySolutionConfiguration.json + */ + /** + * Sample code: Inventory_ListBySolutionConfiguration. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void inventoryListBySolutionConfiguration( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.inventories().listBySolutionConfiguration("ymuj", "wsxt", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationsListSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationsListSamples.java index d4978d29e288..cf13aad39e93 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationsListSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationsListSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * OperationsList.json + * x-ms-original-file: 2024-12-01/OperationsList.json */ /** * Sample code: HybridConnectivityOperationsList. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsCreateOrUpdateSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..c549e8bc5cf3 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsCreateOrUpdateSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.resourcemanager.hybridconnectivity.models.AwsCloudProfile; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PublicCloudConnectors CreateOrUpdate. + */ +public final class PublicCloudConnectorsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_CreateOrUpdate.json + */ + /** + * Sample code: PublicCloudConnectors_CreateOrUpdate. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void publicCloudConnectorsCreateOrUpdate( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors() + .define("advjwoakdusalamomg") + .withRegion("jpiglusfxynfcewcjwvvnn") + .withExistingResourceGroup("rgpublicCloud") + .withTags(mapOf()) + .withProperties(new PublicCloudConnectorProperties() + .withAwsCloudProfile(new AwsCloudProfile().withAccountId("snbnuxckevyqpm") + .withExcludedAccounts(Arrays.asList("rwgqpukglvbqmogqcliqolucp")) + .withIsOrganizationalAccount(true)) + .withHostType(HostType.AWS)) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsDeleteSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsDeleteSamples.java new file mode 100644 index 000000000000..46016a19193e --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for PublicCloudConnectors Delete. + */ +public final class PublicCloudConnectorsDeleteSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_Delete.json + */ + /** + * Sample code: PublicCloudConnectors_Delete. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + publicCloudConnectorsDelete(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors() + .deleteByResourceGroupWithResponse("rgpublicCloud", "skcfyjvflkhibdywjay", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsGetByResourceGroupSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4fd95a71ce04 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsGetByResourceGroupSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for PublicCloudConnectors GetByResourceGroup. + */ +public final class PublicCloudConnectorsGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_Get.json + */ + /** + * Sample code: PublicCloudConnectors_Get. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + publicCloudConnectorsGet(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors() + .getByResourceGroupWithResponse("rgpublicCloud", "rzygvnpsnrdylwzdbsscjazvamyxmh", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListByResourceGroupSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListByResourceGroupSamples.java new file mode 100644 index 000000000000..1576b5aa647f --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for PublicCloudConnectors ListByResourceGroup. + */ +public final class PublicCloudConnectorsListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_ListByResourceGroup.json + */ + /** + * Sample code: PublicCloudConnectors_ListByResourceGroup. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void publicCloudConnectorsListByResourceGroup( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors().listByResourceGroup("rgpublicCloud", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListSamples.java new file mode 100644 index 000000000000..d9a4b2f7f823 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for PublicCloudConnectors List. + */ +public final class PublicCloudConnectorsListSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_ListBySubscription.json + */ + /** + * Sample code: PublicCloudConnectors_ListBySubscription. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void publicCloudConnectorsListBySubscription( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsTestPermissionsSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsTestPermissionsSamples.java new file mode 100644 index 000000000000..19344a13dc02 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsTestPermissionsSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for PublicCloudConnectors TestPermissions. + */ +public final class PublicCloudConnectorsTestPermissionsSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_TestPermissions.json + */ + /** + * Sample code: PublicCloudConnectors_TestPermissions. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void publicCloudConnectorsTestPermissions( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.publicCloudConnectors() + .testPermissions("rgpublicCloud", "rzygvnpsnrdylwzdbsscjazvamyxmh", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsUpdateSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsUpdateSamples.java new file mode 100644 index 000000000000..073c11dadca0 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsUpdateSamples.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.resourcemanager.hybridconnectivity.models.AwsCloudProfile; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnector; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for PublicCloudConnectors Update. + */ +public final class PublicCloudConnectorsUpdateSamples { + /* + * x-ms-original-file: 2024-12-01/PublicCloudConnectors_Update.json + */ + /** + * Sample code: PublicCloudConnectors_Update. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + publicCloudConnectorsUpdate(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + PublicCloudConnector resource = manager.publicCloudConnectors() + .getByResourceGroupWithResponse("rgpublicCloud", "svtirlbyqpepbzyessjenlueeznhg", + com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withTags(mapOf()) + .withProperties(new PublicCloudConnectorProperties() + .withAwsCloudProfile(new AwsCloudProfile().withExcludedAccounts(Arrays.asList("zrbtd")))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsCreateOrupdateSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsCreateOrupdateSamples.java index fc090aeb1a18..1290ee2e619c 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsCreateOrupdateSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsCreateOrupdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -11,9 +11,7 @@ */ public final class ServiceConfigurationsCreateOrupdateSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsPutWAC.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsPutWAC.json */ /** * Sample code: ServiceConfigurationsPutWAC. @@ -33,9 +31,7 @@ public final class ServiceConfigurationsCreateOrupdateSamples { } /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsPutSSH.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsPutSSH.json */ /** * Sample code: ServiceConfigurationsPutSSH. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsDeleteSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsDeleteSamples.java index 14c076621920..0b049de5ce74 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsDeleteSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsDeleteSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -9,9 +9,7 @@ */ public final class ServiceConfigurationsDeleteSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsDeleteSSH.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsDeleteSSH.json */ /** * Sample code: ServiceConfigurationsDeleteSSH. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsGetSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsGetSamples.java index c4823ce4012d..5ad94fa877eb 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsGetSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsGetSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -9,9 +9,7 @@ */ public final class ServiceConfigurationsGetSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsGetWAC.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsGetWAC.json */ /** * Sample code: HybridConnectivityEndpointsServiceconfigurationsGetWAC. @@ -27,9 +25,7 @@ public static void hybridConnectivityEndpointsServiceconfigurationsGetWAC( } /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsGetSSH.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsGetSSH.json */ /** * Sample code: HybridConnectivityEndpointsServiceconfigurationsGetSSH. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsListByEndpointResourceSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsListByEndpointResourceSamples.java index c7ef7257e311..4cb4db565bfc 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsListByEndpointResourceSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsListByEndpointResourceSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -9,9 +9,7 @@ */ public final class ServiceConfigurationsListByEndpointResourceSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsList.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsList.json */ /** * Sample code: GetClustersExample. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsUpdateSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsUpdateSamples.java index bb5d73c521fc..892ed1ebbca2 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsUpdateSamples.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsUpdateSamples.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -11,9 +11,7 @@ */ public final class ServiceConfigurationsUpdateSamples { /* - * x-ms-original-file: - * specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ - * ServiceConfigurationsPatchSSH.json + * x-ms-original-file: 2024-12-01/ServiceConfigurationsPatchSSH.json */ /** * Sample code: ServiceConfigurationsPatchSSH. diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsCreateOrUpdateSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsCreateOrUpdateSamples.java new file mode 100644 index 000000000000..0844d06be360 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsCreateOrUpdateSamples.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SolutionConfigurations CreateOrUpdate. + */ +public final class SolutionConfigurationsCreateOrUpdateSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_CreateOrUpdate.json + */ + /** + * Sample code: SolutionConfigurations_CreateOrUpdate. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void solutionConfigurationsCreateOrUpdate( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations() + .define("keebwujt") + .withExistingResourceUri("ymuj") + .withProperties(new SolutionConfigurationProperties().withSolutionType("nmtqllkyohwtsthxaimsye") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf()))) + .create(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsDeleteSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsDeleteSamples.java new file mode 100644 index 000000000000..aec4a6ef13dd --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for SolutionConfigurations Delete. + */ +public final class SolutionConfigurationsDeleteSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_Delete.json + */ + /** + * Sample code: SolutionConfigurations_Delete. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsDelete(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations() + .deleteByResourceGroupWithResponse("ymuj", "stu", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsGetSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsGetSamples.java new file mode 100644 index 000000000000..32cebf524f6b --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsGetSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for SolutionConfigurations Get. + */ +public final class SolutionConfigurationsGetSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_Get.json + */ + /** + * Sample code: SolutionConfigurations_Get. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsGet(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations().getWithResponse("ymuj", "tks", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsListSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsListSamples.java new file mode 100644 index 000000000000..6f560d2c5063 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for SolutionConfigurations List. + */ +public final class SolutionConfigurationsListSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_List.json + */ + /** + * Sample code: SolutionConfigurations_List. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsList(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations().list("ymuj", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsSyncNowSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsSyncNowSamples.java new file mode 100644 index 000000000000..769eab60830f --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsSyncNowSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for SolutionConfigurations SyncNow. + */ +public final class SolutionConfigurationsSyncNowSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_SyncNow.json + */ + /** + * Sample code: SolutionConfigurations_SyncNow. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsSyncNow(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionConfigurations().syncNow("ymuj", "tks", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsUpdateSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsUpdateSamples.java new file mode 100644 index 000000000000..09d8cb028cc0 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsUpdateSamples.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfiguration; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for SolutionConfigurations Update. + */ +public final class SolutionConfigurationsUpdateSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionConfigurations_Update.json + */ + /** + * Sample code: SolutionConfigurations_Update. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionConfigurationsUpdate(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + SolutionConfiguration resource = manager.solutionConfigurations() + .getWithResponse("ymuj", "dxt", com.azure.core.util.Context.NONE) + .getValue(); + resource.update() + .withProperties(new SolutionConfigurationProperties().withSolutionType("myzljlstvmgkp") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf()))) + .apply(); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesGetByResourceGroupSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesGetByResourceGroupSamples.java new file mode 100644 index 000000000000..4f2a63534989 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for SolutionTypes GetByResourceGroup. + */ +public final class SolutionTypesGetByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionTypes_Get.json + */ + /** + * Sample code: SolutionTypes_Get. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void + solutionTypesGet(com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionTypes() + .getByResourceGroupWithResponse("rgpublicCloud", "lulzqllpu", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListByResourceGroupSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListByResourceGroupSamples.java new file mode 100644 index 000000000000..a074bba19d9e --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for SolutionTypes ListByResourceGroup. + */ +public final class SolutionTypesListByResourceGroupSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionTypes_ListByResourceGroup.json + */ + /** + * Sample code: SolutionTypes_ListByResourceGroup. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void solutionTypesListByResourceGroup( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionTypes().listByResourceGroup("rgpublicCloud", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListSamples.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListSamples.java new file mode 100644 index 000000000000..c9d34cfc970e --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/samples/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +/** + * Samples for SolutionTypes List. + */ +public final class SolutionTypesListSamples { + /* + * x-ms-original-file: 2024-12-01/SolutionTypes_ListBySubscription.json + */ + /** + * Sample code: SolutionTypes_ListBySubscription. + * + * @param manager Entry point to HybridConnectivityManager. + */ + public static void solutionTypesListBySubscription( + com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager manager) { + manager.solutionTypes().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/AadProfilePropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/AadProfilePropertiesTests.java index 792e5f976820..82d5c63dc1be 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/AadProfilePropertiesTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/AadProfilePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -11,17 +11,9 @@ public final class AadProfilePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AadProfileProperties model = BinaryData.fromString("{\"serverId\":\"czdzev\",\"tenantId\":\"dhkrwpdappdsbdk\"}") + AadProfileProperties model = BinaryData.fromString("{\"serverId\":\"qtrgqjbpfzfsinzg\",\"tenantId\":\"f\"}") .toObject(AadProfileProperties.class); - Assertions.assertEquals("czdzev", model.serverId()); - Assertions.assertEquals("dhkrwpdappdsbdk", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadProfileProperties model = new AadProfileProperties().withServerId("czdzev").withTenantId("dhkrwpdappdsbdk"); - model = BinaryData.fromObject(model).toObject(AadProfileProperties.class); - Assertions.assertEquals("czdzev", model.serverId()); - Assertions.assertEquals("dhkrwpdappdsbdk", model.tenantId()); + Assertions.assertEquals("qtrgqjbpfzfsinzg", model.serverId()); + Assertions.assertEquals("f", model.tenantId()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/AwsCloudProfileTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/AwsCloudProfileTests.java new file mode 100644 index 000000000000..d1ae9384eb7d --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/AwsCloudProfileTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.AwsCloudProfile; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class AwsCloudProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AwsCloudProfile model = BinaryData.fromString( + "{\"accountId\":\"i\",\"excludedAccounts\":[\"npvswjdkirso\",\"dqxhcrmnohjtckwh\",\"soifiyipjxsqw\",\"gr\"],\"isOrganizationalAccount\":false}") + .toObject(AwsCloudProfile.class); + Assertions.assertEquals("i", model.accountId()); + Assertions.assertEquals("npvswjdkirso", model.excludedAccounts().get(0)); + Assertions.assertEquals(false, model.isOrganizationalAccount()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AwsCloudProfile model = new AwsCloudProfile().withAccountId("i") + .withExcludedAccounts(Arrays.asList("npvswjdkirso", "dqxhcrmnohjtckwh", "soifiyipjxsqw", "gr")) + .withIsOrganizationalAccount(false); + model = BinaryData.fromObject(model).toObject(AwsCloudProfile.class); + Assertions.assertEquals("i", model.accountId()); + Assertions.assertEquals("npvswjdkirso", model.excludedAccounts().get(0)); + Assertions.assertEquals(false, model.isOrganizationalAccount()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointPropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointPropertiesTests.java index a8cbb6504127..bb9a5493dff4 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointPropertiesTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -13,17 +13,17 @@ public final class EndpointPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EndpointProperties model = BinaryData - .fromString("{\"type\":\"custom\",\"resourceId\":\"dmailzydehojw\",\"provisioningState\":\"huxinpmqnj\"}") + .fromString("{\"type\":\"default\",\"resourceId\":\"ithxqhabifpi\",\"provisioningState\":\"wczbys\"}") .toObject(EndpointProperties.class); - Assertions.assertEquals(Type.CUSTOM, model.type()); - Assertions.assertEquals("dmailzydehojw", model.resourceId()); + Assertions.assertEquals(Type.DEFAULT, model.type()); + Assertions.assertEquals("ithxqhabifpi", model.resourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - EndpointProperties model = new EndpointProperties().withType(Type.CUSTOM).withResourceId("dmailzydehojw"); + EndpointProperties model = new EndpointProperties().withType(Type.DEFAULT).withResourceId("ithxqhabifpi"); model = BinaryData.fromObject(model).toObject(EndpointProperties.class); - Assertions.assertEquals(Type.CUSTOM, model.type()); - Assertions.assertEquals("dmailzydehojw", model.resourceId()); + Assertions.assertEquals(Type.DEFAULT, model.type()); + Assertions.assertEquals("ithxqhabifpi", model.resourceId()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointResourceInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointResourceInnerTests.java index 9ce9b62810d0..996b570e8239 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointResourceInnerTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -14,18 +14,18 @@ public final class EndpointResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EndpointResourceInner model = BinaryData.fromString( - "{\"properties\":{\"type\":\"custom\",\"resourceId\":\"s\",\"provisioningState\":\"nyejhkryhtnap\"},\"id\":\"wlokjyem\",\"name\":\"kvnipjoxz\",\"type\":\"nchgej\"}") + "{\"properties\":{\"type\":\"custom\",\"resourceId\":\"bpzvgn\",\"provisioningState\":\"symglzufcyz\"},\"id\":\"hdbihan\",\"name\":\"fhfcb\",\"type\":\"y\"}") .toObject(EndpointResourceInner.class); Assertions.assertEquals(Type.CUSTOM, model.properties().type()); - Assertions.assertEquals("s", model.properties().resourceId()); + Assertions.assertEquals("bpzvgn", model.properties().resourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { EndpointResourceInner model = new EndpointResourceInner() - .withProperties(new EndpointProperties().withType(Type.CUSTOM).withResourceId("s")); + .withProperties(new EndpointProperties().withType(Type.CUSTOM).withResourceId("bpzvgn")); model = BinaryData.fromObject(model).toObject(EndpointResourceInner.class); Assertions.assertEquals(Type.CUSTOM, model.properties().type()); - Assertions.assertEquals("s", model.properties().resourceId()); + Assertions.assertEquals("bpzvgn", model.properties().resourceId()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsCreateOrUpdateWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsCreateOrUpdateWithResponseMockTests.java index 950d6f9abf6b..98713cc83b98 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsCreateOrUpdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import com.azure.resourcemanager.hybridconnectivity.models.EndpointProperties; @@ -23,22 +23,22 @@ public final class EndpointsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"type\":\"default\",\"resourceId\":\"qrimzinpv\",\"provisioningState\":\"jdkirsoodqx\"},\"id\":\"rmnohj\",\"name\":\"ckwhds\",\"type\":\"ifiyipjxsqwpgrj\"}"; + = "{\"properties\":{\"type\":\"custom\",\"resourceId\":\"dowwquuvxzxclvit\",\"provisioningState\":\"qzonosggbhcohf\"},\"id\":\"sjnkal\",\"name\":\"utiiswacf\",\"type\":\"gdkz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); EndpointResource response = manager.endpoints() - .define("opvkmijcm") - .withExistingResourceUri("isdkfthwxmnteiw") - .withProperties(new EndpointProperties().withType(Type.DEFAULT).withResourceId("ufufsrp")) + .define("zxb") + .withExistingResourceUri("uwz") + .withProperties(new EndpointProperties().withType(Type.DEFAULT).withResourceId("jefuzmuvpbttdumo")) .create(); - Assertions.assertEquals(Type.DEFAULT, response.properties().type()); - Assertions.assertEquals("qrimzinpv", response.properties().resourceId()); + Assertions.assertEquals(Type.CUSTOM, response.properties().type()); + Assertions.assertEquals("dowwquuvxzxclvit", response.properties().resourceId()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsDeleteByResourceGroupWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsDeleteByResourceGroupWithResponseMockTests.java index 834c8bbf5c57..8be41c9a9812 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsDeleteByResourceGroupWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteWithResponse() throws Exception { HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.endpoints() - .deleteByResourceGroupWithResponse("rtumkdosvq", "hbmdgbbjfdd", com.azure.core.util.Context.NONE); + manager.endpoints().deleteByResourceGroupWithResponse("lqlfm", "dnbbglzps", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsGetWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsGetWithResponseMockTests.java index ad192a748b6c..9d435d324443 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsGetWithResponseMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import com.azure.resourcemanager.hybridconnectivity.models.EndpointResource; @@ -22,19 +22,19 @@ public final class EndpointsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"type\":\"custom\",\"resourceId\":\"dqytbciqfouflmm\",\"provisioningState\":\"zsm\"},\"id\":\"mglougpbkw\",\"name\":\"mutduqktaps\",\"type\":\"wgcu\"}"; + = "{\"properties\":{\"type\":\"default\",\"resourceId\":\"ndoygmifthnzdnd\",\"provisioningState\":\"gnayqigynduh\"},\"id\":\"hqlkthumaqo\",\"name\":\"bgycduiertgccym\",\"type\":\"aolps\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); EndpointResource response - = manager.endpoints().getWithResponse("gakeqsr", "yb", com.azure.core.util.Context.NONE).getValue(); + = manager.endpoints().getWithResponse("ewgdrjervn", "enq", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(Type.CUSTOM, response.properties().type()); - Assertions.assertEquals("dqytbciqfouflmm", response.properties().resourceId()); + Assertions.assertEquals(Type.DEFAULT, response.properties().type()); + Assertions.assertEquals("ndoygmifthnzdnd", response.properties().resourceId()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListManagedProxyDetailsWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListManagedProxyDetailsWithResponseMockTests.java index 7f4399eb9c28..bddc696233b3 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListManagedProxyDetailsWithResponseMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListManagedProxyDetailsWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import com.azure.resourcemanager.hybridconnectivity.models.ManagedProxyRequest; @@ -22,24 +22,24 @@ public final class EndpointsListManagedProxyDetailsWithResponseMockTests { @Test public void testListManagedProxyDetailsWithResponse() throws Exception { - String responseStr = "{\"proxy\":\"uht\",\"expiresOn\":6116347242940995661}"; + String responseStr = "{\"proxy\":\"otgqrlltmu\",\"expiresOn\":8105546637199671811}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ManagedProxyResource response = manager.endpoints() - .listManagedProxyDetailsWithResponse("uitnwuiz", "a", - new ManagedProxyRequest().withService("x") - .withHostname("izuckyfihrfidfvz") - .withServiceName(ServiceName.WAC), + .listManagedProxyDetailsWithResponse("dlkzgxhuri", "lbpodxunk", + new ManagedProxyRequest().withService("ebxmubyynt") + .withHostname("rbqtkoie") + .withServiceName(ServiceName.SSH), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("uht", response.proxy()); - Assertions.assertEquals(6116347242940995661L, response.expiresOn()); + Assertions.assertEquals("otgqrlltmu", response.proxy()); + Assertions.assertEquals(8105546637199671811L, response.expiresOn()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListMockTests.java index a8b9ff8e3b44..3b1632886f9e 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import com.azure.resourcemanager.hybridconnectivity.models.EndpointResource; @@ -23,19 +23,19 @@ public final class EndpointsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"type\":\"custom\",\"resourceId\":\"kgiawxklryplwck\",\"provisioningState\":\"syyp\"},\"id\":\"dhsgcba\",\"name\":\"phejkotynqgoulz\",\"type\":\"dlikwyqkgfgibma\"}]}"; + = "{\"value\":[{\"properties\":{\"type\":\"default\",\"resourceId\":\"zmnvdfznudaod\",\"provisioningState\":\"zbn\"},\"id\":\"lylpstdb\",\"name\":\"hxsrzdzucersc\",\"type\":\"ntnev\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.endpoints().list("tyxolniwpwc", com.azure.core.util.Context.NONE); + = manager.endpoints().list("iydmcwyhzdxs", com.azure.core.util.Context.NONE); - Assertions.assertEquals(Type.CUSTOM, response.iterator().next().properties().type()); - Assertions.assertEquals("kgiawxklryplwck", response.iterator().next().properties().resourceId()); + Assertions.assertEquals(Type.DEFAULT, response.iterator().next().properties().type()); + Assertions.assertEquals("zmnvdfznudaod", response.iterator().next().properties().resourceId()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListTests.java index c3d889a3345e..022b9958bc41 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/EndpointsListTests.java @@ -1,36 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridconnectivity.fluent.models.EndpointResourceInner; -import com.azure.resourcemanager.hybridconnectivity.models.EndpointProperties; -import com.azure.resourcemanager.hybridconnectivity.models.EndpointsList; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.EndpointsList; import com.azure.resourcemanager.hybridconnectivity.models.Type; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class EndpointsListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { EndpointsList model = BinaryData.fromString( - "{\"nextLink\":\"a\",\"value\":[{\"properties\":{\"type\":\"default\",\"resourceId\":\"hab\",\"provisioningState\":\"pikxwczbyscnpqxu\"},\"id\":\"vyq\",\"name\":\"iwbybrkxvdumjg\",\"type\":\"tfwvukxgaudc\"}]}") + "{\"value\":[{\"properties\":{\"type\":\"default\",\"resourceId\":\"uhivyqniw\",\"provisioningState\":\"br\"},\"id\":\"vd\",\"name\":\"mjgr\",\"type\":\"fwvuk\"},{\"properties\":{\"type\":\"custom\",\"resourceId\":\"dcc\",\"provisioningState\":\"h\"},\"id\":\"cnyejhkryhtnapcz\",\"name\":\"lokjyemkk\",\"type\":\"ni\"}],\"nextLink\":\"oxzjnchgejspod\"}") .toObject(EndpointsList.class); - Assertions.assertEquals("a", model.nextLink()); Assertions.assertEquals(Type.DEFAULT, model.value().get(0).properties().type()); - Assertions.assertEquals("hab", model.value().get(0).properties().resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EndpointsList model = new EndpointsList().withNextLink("a") - .withValue(Arrays.asList(new EndpointResourceInner() - .withProperties(new EndpointProperties().withType(Type.DEFAULT).withResourceId("hab")))); - model = BinaryData.fromObject(model).toObject(EndpointsList.class); - Assertions.assertEquals("a", model.nextLink()); - Assertions.assertEquals(Type.DEFAULT, model.value().get(0).properties().type()); - Assertions.assertEquals("hab", model.value().get(0).properties().resourceId()); + Assertions.assertEquals("uhivyqniw", model.value().get(0).properties().resourceId()); + Assertions.assertEquals("oxzjnchgejspod", model.nextLink()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplateRequestTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplateRequestTests.java new file mode 100644 index 000000000000..c0ad8f77b6e4 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplateRequestTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplateRequest; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeSettings; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class GenerateAwsTemplateRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GenerateAwsTemplateRequest model = BinaryData.fromString( + "{\"connectorId\":\"dhkrwpdappdsbdk\",\"solutionTypes\":[{\"solutionType\":\"wjfeusnhutjel\",\"solutionSettings\":{\"\":{\"eablg\":\"dhugjzzdatqxhocd\",\"wyiftyhxhur\":\"huticndvkao\",\"tyxolniwpwc\":\"k\",\"awxklr\":\"kjfkg\"}}},{\"solutionType\":\"plwckbas\",\"solutionSettings\":{\"\":{\"koty\":\"ddhsgcbacphe\",\"i\":\"qgoulznd\",\"dgak\":\"wyqkgfgibm\"}}}]}") + .toObject(GenerateAwsTemplateRequest.class); + Assertions.assertEquals("dhkrwpdappdsbdk", model.connectorId()); + Assertions.assertEquals("wjfeusnhutjel", model.solutionTypes().get(0).solutionType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GenerateAwsTemplateRequest model = new GenerateAwsTemplateRequest().withConnectorId("dhkrwpdappdsbdk") + .withSolutionTypes(Arrays.asList( + new SolutionTypeSettings().withSolutionType("wjfeusnhutjel") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf())), + new SolutionTypeSettings().withSolutionType("plwckbas") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf())))); + model = BinaryData.fromObject(model).toObject(GenerateAwsTemplateRequest.class); + Assertions.assertEquals("dhkrwpdappdsbdk", model.connectorId()); + Assertions.assertEquals("wjfeusnhutjel", model.solutionTypes().get(0).solutionType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplatesPostWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplatesPostWithResponseMockTests.java new file mode 100644 index 000000000000..8a07985d12fd --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/GenerateAwsTemplatesPostWithResponseMockTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.GenerateAwsTemplateRequest; +import com.azure.resourcemanager.hybridconnectivity.models.PostResponse; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeSettings; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class GenerateAwsTemplatesPostWithResponseMockTests { + @Test + public void testPostWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PostResponse response = manager.generateAwsTemplates() + .postWithResponse( + new GenerateAwsTemplateRequest().withConnectorId("qyib") + .withSolutionTypes(Arrays.asList( + new SolutionTypeSettings().withSolutionType("fluszdtm") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf())), + new SolutionTypeSettings().withSolutionType("dbutauvfbtkuwhh") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf())))), + com.azure.core.util.Context.NONE) + .getValue(); + + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/IngressProfilePropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/IngressProfilePropertiesTests.java index a008cdad5068..6e176a177b3c 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/IngressProfilePropertiesTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/IngressProfilePropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -11,22 +11,11 @@ public final class IngressProfilePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - IngressProfileProperties model = BinaryData - .fromString( - "{\"hostname\":\"fmppe\",\"aadProfile\":{\"serverId\":\"bvmgxsabkyqduuji\",\"tenantId\":\"c\"}}") + IngressProfileProperties model = BinaryData.fromString( + "{\"hostname\":\"dfdosygexp\",\"aadProfile\":{\"serverId\":\"ojakhmsbzjhcrze\",\"tenantId\":\"dphlxaolt\"}}") .toObject(IngressProfileProperties.class); - Assertions.assertEquals("fmppe", model.hostname()); - Assertions.assertEquals("bvmgxsabkyqduuji", model.serverId()); - Assertions.assertEquals("c", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngressProfileProperties model - = new IngressProfileProperties().withHostname("fmppe").withServerId("bvmgxsabkyqduuji").withTenantId("c"); - model = BinaryData.fromObject(model).toObject(IngressProfileProperties.class); - Assertions.assertEquals("fmppe", model.hostname()); - Assertions.assertEquals("bvmgxsabkyqduuji", model.serverId()); - Assertions.assertEquals("c", model.tenantId()); + Assertions.assertEquals("dfdosygexp", model.hostname()); + Assertions.assertEquals("ojakhmsbzjhcrze", model.serverId()); + Assertions.assertEquals("dphlxaolt", model.tenantId()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoriesGetWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoriesGetWithResponseMockTests.java new file mode 100644 index 000000000000..a4856c144669 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoriesGetWithResponseMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.CloudNativeType; +import com.azure.resourcemanager.hybridconnectivity.models.InventoryResource; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class InventoriesGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"cloudNativeType\":\"ec2\",\"cloudNativeResourceId\":\"tqs\",\"azureResourceId\":\"qxujxukndxd\",\"status\":\"Failed\",\"statusDetails\":\"guufzd\",\"provisioningState\":\"Succeeded\"},\"id\":\"tfih\",\"name\":\"hbotzingamvppho\",\"type\":\"zqzudph\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + InventoryResource response = manager.inventories() + .getWithResponse("hfkvtvsexsowuel", "qhhahhxvrhmzkwpj", "wws", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(CloudNativeType.EC2, response.properties().cloudNativeType()); + Assertions.assertEquals("tqs", response.properties().cloudNativeResourceId()); + Assertions.assertEquals("qxujxukndxd", response.properties().azureResourceId()); + Assertions.assertEquals(SolutionConfigurationStatus.FAILED, response.properties().status()); + Assertions.assertEquals("guufzd", response.properties().statusDetails()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoriesListBySolutionConfigurationMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoriesListBySolutionConfigurationMockTests.java new file mode 100644 index 000000000000..b819da5b8f28 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoriesListBySolutionConfigurationMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.CloudNativeType; +import com.azure.resourcemanager.hybridconnectivity.models.InventoryResource; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationStatus; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class InventoriesListBySolutionConfigurationMockTests { + @Test + public void testListBySolutionConfiguration() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"cloudNativeType\":\"ec2\",\"cloudNativeResourceId\":\"wzcjaesgvvsccy\",\"azureResourceId\":\"g\",\"status\":\"Failed\",\"statusDetails\":\"wygzlvdnkfxusem\",\"provisioningState\":\"Canceled\"},\"id\":\"muhapfcqdpsqxqv\",\"name\":\"svuo\",\"type\":\"mgccelvezrypq\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.inventories() + .listBySolutionConfiguration("amvdkfwynwcvtbv", "ayhmtnvyqiatkz", com.azure.core.util.Context.NONE); + + Assertions.assertEquals(CloudNativeType.EC2, response.iterator().next().properties().cloudNativeType()); + Assertions.assertEquals("wzcjaesgvvsccy", response.iterator().next().properties().cloudNativeResourceId()); + Assertions.assertEquals("g", response.iterator().next().properties().azureResourceId()); + Assertions.assertEquals(SolutionConfigurationStatus.FAILED, response.iterator().next().properties().status()); + Assertions.assertEquals("wygzlvdnkfxusem", response.iterator().next().properties().statusDetails()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryPropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryPropertiesTests.java new file mode 100644 index 000000000000..2250a3e4c95c --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryPropertiesTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.CloudNativeType; +import com.azure.resourcemanager.hybridconnectivity.models.InventoryProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationStatus; +import org.junit.jupiter.api.Assertions; + +public final class InventoryPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InventoryProperties model = BinaryData.fromString( + "{\"cloudNativeType\":\"ec2\",\"cloudNativeResourceId\":\"jzicwifsjt\",\"azureResourceId\":\"zfbishcbkhaj\",\"status\":\"Failed\",\"statusDetails\":\"a\",\"provisioningState\":\"Failed\"}") + .toObject(InventoryProperties.class); + Assertions.assertEquals(CloudNativeType.EC2, model.cloudNativeType()); + Assertions.assertEquals("jzicwifsjt", model.cloudNativeResourceId()); + Assertions.assertEquals("zfbishcbkhaj", model.azureResourceId()); + Assertions.assertEquals(SolutionConfigurationStatus.FAILED, model.status()); + Assertions.assertEquals("a", model.statusDetails()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryResourceInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryResourceInnerTests.java new file mode 100644 index 000000000000..a0701f40dfcf --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryResourceInnerTests.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.InventoryResourceInner; +import com.azure.resourcemanager.hybridconnectivity.models.CloudNativeType; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationStatus; +import org.junit.jupiter.api.Assertions; + +public final class InventoryResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InventoryResourceInner model = BinaryData.fromString( + "{\"properties\":{\"cloudNativeType\":\"ec2\",\"cloudNativeResourceId\":\"rvjx\",\"azureResourceId\":\"nspydptkoenkoukn\",\"status\":\"Failed\",\"statusDetails\":\"tiukbldngkpoci\",\"provisioningState\":\"Succeeded\"},\"id\":\"xoegukgjnpiucgy\",\"name\":\"evqzntypmrbp\",\"type\":\"zcdrqjsdpydnfyhx\"}") + .toObject(InventoryResourceInner.class); + Assertions.assertEquals(CloudNativeType.EC2, model.properties().cloudNativeType()); + Assertions.assertEquals("rvjx", model.properties().cloudNativeResourceId()); + Assertions.assertEquals("nspydptkoenkoukn", model.properties().azureResourceId()); + Assertions.assertEquals(SolutionConfigurationStatus.FAILED, model.properties().status()); + Assertions.assertEquals("tiukbldngkpoci", model.properties().statusDetails()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryResourceListResultTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryResourceListResultTests.java new file mode 100644 index 000000000000..5775e062360e --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/InventoryResourceListResultTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.InventoryResourceListResult; +import com.azure.resourcemanager.hybridconnectivity.models.CloudNativeType; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationStatus; +import org.junit.jupiter.api.Assertions; + +public final class InventoryResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + InventoryResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"cloudNativeType\":\"ec2\",\"cloudNativeResourceId\":\"pbuxwgipwhon\",\"azureResourceId\":\"kgshwa\",\"status\":\"Failed\",\"statusDetails\":\"zbinjeputtm\",\"provisioningState\":\"Succeeded\"},\"id\":\"uzoqft\",\"name\":\"yqzrnkcqvyxlw\",\"type\":\"zlsico\"},{\"properties\":{\"cloudNativeType\":\"ec2\",\"cloudNativeResourceId\":\"wvl\",\"azureResourceId\":\"avwhheunm\",\"status\":\"Completed\",\"statusDetails\":\"yxzk\",\"provisioningState\":\"Failed\"},\"id\":\"uko\",\"name\":\"lyaxuc\",\"type\":\"nuqszfkbey\"},{\"properties\":{\"cloudNativeType\":\"ec2\",\"cloudNativeResourceId\":\"jmwvvj\",\"azureResourceId\":\"tcxsenhwlrs\",\"status\":\"Failed\",\"statusDetails\":\"pwvlqdq\",\"provisioningState\":\"Failed\"},\"id\":\"ylihkaetckt\",\"name\":\"fcivfsnkym\",\"type\":\"ctq\"},{\"properties\":{\"cloudNativeType\":\"ec2\",\"cloudNativeResourceId\":\"brjcxe\",\"azureResourceId\":\"uwutttxfvjrbi\",\"status\":\"Failed\",\"statusDetails\":\"epcyvahfnlj\",\"provisioningState\":\"Canceled\"},\"id\":\"j\",\"name\":\"uujqgidokgjljyo\",\"type\":\"gvcl\"}],\"nextLink\":\"gsncghkjeszz\"}") + .toObject(InventoryResourceListResult.class); + Assertions.assertEquals(CloudNativeType.EC2, model.value().get(0).properties().cloudNativeType()); + Assertions.assertEquals("pbuxwgipwhon", model.value().get(0).properties().cloudNativeResourceId()); + Assertions.assertEquals("kgshwa", model.value().get(0).properties().azureResourceId()); + Assertions.assertEquals(SolutionConfigurationStatus.FAILED, model.value().get(0).properties().status()); + Assertions.assertEquals("zbinjeputtm", model.value().get(0).properties().statusDetails()); + Assertions.assertEquals("gsncghkjeszz", model.nextLink()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ListCredentialsRequestTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ListCredentialsRequestTests.java index b5ad3864bbac..ce8e831a57a4 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ListCredentialsRequestTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ListCredentialsRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -13,14 +13,14 @@ public final class ListCredentialsRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ListCredentialsRequest model - = BinaryData.fromString("{\"serviceName\":\"WAC\"}").toObject(ListCredentialsRequest.class); - Assertions.assertEquals(ServiceName.WAC, model.serviceName()); + = BinaryData.fromString("{\"serviceName\":\"SSH\"}").toObject(ListCredentialsRequest.class); + Assertions.assertEquals(ServiceName.SSH, model.serviceName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ListCredentialsRequest model = new ListCredentialsRequest().withServiceName(ServiceName.WAC); + ListCredentialsRequest model = new ListCredentialsRequest().withServiceName(ServiceName.SSH); model = BinaryData.fromObject(model).toObject(ListCredentialsRequest.class); - Assertions.assertEquals(ServiceName.WAC, model.serviceName()); + Assertions.assertEquals(ServiceName.SSH, model.serviceName()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ListIngressGatewayCredentialsRequestTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ListIngressGatewayCredentialsRequestTests.java index 611edb84ef9f..450478ee041e 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ListIngressGatewayCredentialsRequestTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ListIngressGatewayCredentialsRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ManagedProxyRequestTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ManagedProxyRequestTests.java index c43504b29b39..c08c16e67060 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ManagedProxyRequestTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ManagedProxyRequestTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -13,20 +13,20 @@ public final class ManagedProxyRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedProxyRequest model - = BinaryData.fromString("{\"service\":\"wrwjfeu\",\"hostname\":\"hutje\",\"serviceName\":\"SSH\"}") + = BinaryData.fromString("{\"service\":\"jrwzox\",\"hostname\":\"tfell\",\"serviceName\":\"SSH\"}") .toObject(ManagedProxyRequest.class); - Assertions.assertEquals("wrwjfeu", model.service()); - Assertions.assertEquals("hutje", model.hostname()); + Assertions.assertEquals("jrwzox", model.service()); + Assertions.assertEquals("tfell", model.hostname()); Assertions.assertEquals(ServiceName.SSH, model.serviceName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ManagedProxyRequest model - = new ManagedProxyRequest().withService("wrwjfeu").withHostname("hutje").withServiceName(ServiceName.SSH); + = new ManagedProxyRequest().withService("jrwzox").withHostname("tfell").withServiceName(ServiceName.SSH); model = BinaryData.fromObject(model).toObject(ManagedProxyRequest.class); - Assertions.assertEquals("wrwjfeu", model.service()); - Assertions.assertEquals("hutje", model.hostname()); + Assertions.assertEquals("jrwzox", model.service()); + Assertions.assertEquals("tfell", model.hostname()); Assertions.assertEquals(ServiceName.SSH, model.serviceName()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ManagedProxyResourceInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ManagedProxyResourceInnerTests.java index 25be04a9ab64..889507d61efa 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ManagedProxyResourceInnerTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ManagedProxyResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -11,18 +11,10 @@ public final class ManagedProxyResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ManagedProxyResourceInner model = BinaryData.fromString("{\"proxy\":\"rl\",\"expiresOn\":6676746623961683086}") - .toObject(ManagedProxyResourceInner.class); - Assertions.assertEquals("rl", model.proxy()); - Assertions.assertEquals(6676746623961683086L, model.expiresOn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { ManagedProxyResourceInner model - = new ManagedProxyResourceInner().withProxy("rl").withExpiresOn(6676746623961683086L); - model = BinaryData.fromObject(model).toObject(ManagedProxyResourceInner.class); - Assertions.assertEquals("rl", model.proxy()); - Assertions.assertEquals(6676746623961683086L, model.expiresOn()); + = BinaryData.fromString("{\"proxy\":\"zitonpeqfpjkjl\",\"expiresOn\":6527642903227935685}") + .toObject(ManagedProxyResourceInner.class); + Assertions.assertEquals("zitonpeqfpjkjl", model.proxy()); + Assertions.assertEquals(6527642903227935685L, model.expiresOn()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationDisplayTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationDisplayTests.java index 210d226a0b04..14ce8816d32d 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationDisplayTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -11,13 +11,7 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") .toObject(OperationDisplay.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationInnerTests.java index 6fb0af2c2ef0..08e0ecb5d7df 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationInnerTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.hybridconnectivity.fluent.models.OperationInner; -import com.azure.resourcemanager.hybridconnectivity.models.OperationDisplay; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationListResultTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationListResultTests.java index e62601c805de..9633098ef96a 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationListResultTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationListResultTests.java @@ -1,23 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridconnectivity.models.OperationListResult; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationsListMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationsListMockTests.java index e63c9072dd17..9991765683e6 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationsListMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/OperationsListMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import com.azure.resourcemanager.hybridconnectivity.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"jzzd\",\"isDataAction\":true,\"display\":{\"provider\":\"oc\",\"resource\":\"eablg\",\"operation\":\"uticndvkaozwyif\",\"description\":\"hxh\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; + = "{\"value\":[{\"name\":\"l\",\"isDataAction\":false,\"display\":{\"provider\":\"q\",\"resource\":\"wpmqt\",\"operation\":\"uoujmkcjhwqy\",\"description\":\"r\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PostResponseInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PostResponseInnerTests.java new file mode 100644 index 000000000000..5da017d32257 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PostResponseInnerTests.java @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PostResponseInner; + +public final class PostResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PostResponseInner model = BinaryData.fromString("{}").toObject(PostResponseInner.class); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorInnerTests.java new file mode 100644 index 000000000000..7646113e1afc --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorInnerTests.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.PublicCloudConnectorInner; +import com.azure.resourcemanager.hybridconnectivity.models.AwsCloudProfile; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class PublicCloudConnectorInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PublicCloudConnectorInner model = BinaryData.fromString( + "{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"lgbquxig\",\"excludedAccounts\":[\"gzjaoyfhrtxilne\",\"kujysvlejuvfq\",\"wrlyxwjkcprb\"],\"isOrganizationalAccount\":false},\"hostType\":\"AWS\",\"provisioningState\":\"Canceled\",\"connectorPrimaryIdentifier\":\"tbvpysszdnru\"},\"location\":\"guhmuouqfpr\",\"tags\":{\"nwui\":\"bngui\",\"zuckyfi\":\"gazxuf\",\"htymw\":\"rfidfvzwdz\"},\"id\":\"sdkf\",\"name\":\"hwxmnteiwa\",\"type\":\"pvkmijcmmxdcuf\"}") + .toObject(PublicCloudConnectorInner.class); + Assertions.assertEquals("guhmuouqfpr", model.location()); + Assertions.assertEquals("bngui", model.tags().get("nwui")); + Assertions.assertEquals("lgbquxig", model.properties().awsCloudProfile().accountId()); + Assertions.assertEquals("gzjaoyfhrtxilne", model.properties().awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(false, model.properties().awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, model.properties().hostType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PublicCloudConnectorInner model + = new PublicCloudConnectorInner().withLocation("guhmuouqfpr") + .withTags(mapOf("nwui", "bngui", "zuckyfi", "gazxuf", "htymw", "rfidfvzwdz")) + .withProperties(new PublicCloudConnectorProperties() + .withAwsCloudProfile(new AwsCloudProfile().withAccountId("lgbquxig") + .withExcludedAccounts(Arrays.asList("gzjaoyfhrtxilne", "kujysvlejuvfq", "wrlyxwjkcprb")) + .withIsOrganizationalAccount(false)) + .withHostType(HostType.AWS)); + model = BinaryData.fromObject(model).toObject(PublicCloudConnectorInner.class); + Assertions.assertEquals("guhmuouqfpr", model.location()); + Assertions.assertEquals("bngui", model.tags().get("nwui")); + Assertions.assertEquals("lgbquxig", model.properties().awsCloudProfile().accountId()); + Assertions.assertEquals("gzjaoyfhrtxilne", model.properties().awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(false, model.properties().awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, model.properties().hostType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorListResultTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorListResultTests.java new file mode 100644 index 000000000000..cf76ff22e7d4 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorListResultTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.PublicCloudConnectorListResult; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import org.junit.jupiter.api.Assertions; + +public final class PublicCloudConnectorListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PublicCloudConnectorListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"rcjxvsnbyxqabn\",\"excludedAccounts\":[\"pcyshu\"],\"isOrganizationalAccount\":true},\"hostType\":\"AWS\",\"provisioningState\":\"Canceled\",\"connectorPrimaryIdentifier\":\"j\"},\"location\":\"btoqcjmkljavbqid\",\"tags\":{\"dj\":\"jzyulpk\",\"xzlocxscp\":\"rlkhbzhfepgzgq\"},\"id\":\"ierhhbcsglummaj\",\"name\":\"j\",\"type\":\"odxobnbdxkqpxok\"},{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"ionpimexg\",\"excludedAccounts\":[\"gcpo\"],\"isOrganizationalAccount\":true},\"hostType\":\"AWS\",\"provisioningState\":\"Canceled\",\"connectorPrimaryIdentifier\":\"mvdjwzrlovmc\"},\"location\":\"hijco\",\"tags\":{\"ukdkexxppofmxa\":\"tbzaqsqsycbkbfk\",\"jpgd\":\"c\"},\"id\":\"toc\",\"name\":\"j\",\"type\":\"hvpmoue\"},{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"dzxibqeojnxqbzvd\",\"excludedAccounts\":[\"wndeicbtwnp\"],\"isOrganizationalAccount\":false},\"hostType\":\"AWS\",\"provisioningState\":\"Succeeded\",\"connectorPrimaryIdentifier\":\"rhcffcydd\"},\"location\":\"mjthjqkwp\",\"tags\":{\"igdtopbob\":\"cxmqciwqvhkhix\"},\"id\":\"og\",\"name\":\"m\",\"type\":\"w\"},{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"m\",\"excludedAccounts\":[\"rzayv\",\"t\",\"gvdfgiotkftutq\",\"ln\"],\"isOrganizationalAccount\":true},\"hostType\":\"AWS\",\"provisioningState\":\"Canceled\",\"connectorPrimaryIdentifier\":\"gnxkrxdqmidtth\"},\"location\":\"vqdra\",\"tags\":{\"gehoqfbowskany\":\"yb\",\"rvynhzgpph\":\"tzlcuiywgqywgn\"},\"id\":\"cgyncocpecf\",\"name\":\"m\",\"type\":\"coofsxlzev\"}],\"nextLink\":\"m\"}") + .toObject(PublicCloudConnectorListResult.class); + Assertions.assertEquals("btoqcjmkljavbqid", model.value().get(0).location()); + Assertions.assertEquals("jzyulpk", model.value().get(0).tags().get("dj")); + Assertions.assertEquals("rcjxvsnbyxqabn", model.value().get(0).properties().awsCloudProfile().accountId()); + Assertions.assertEquals("pcyshu", + model.value().get(0).properties().awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(true, model.value().get(0).properties().awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, model.value().get(0).properties().hostType()); + Assertions.assertEquals("m", model.nextLink()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorPropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorPropertiesTests.java new file mode 100644 index 000000000000..a270d2e37618 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorPropertiesTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.AwsCloudProfile; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class PublicCloudConnectorPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PublicCloudConnectorProperties model = BinaryData.fromString( + "{\"awsCloudProfile\":{\"accountId\":\"fsrpymzidnse\",\"excludedAccounts\":[\"tbzsgfyccs\",\"ewmdw\",\"jeiachboosfl\",\"ro\"],\"isOrganizationalAccount\":false},\"hostType\":\"AWS\",\"provisioningState\":\"Canceled\",\"connectorPrimaryIdentifier\":\"hzzvypyq\"}") + .toObject(PublicCloudConnectorProperties.class); + Assertions.assertEquals("fsrpymzidnse", model.awsCloudProfile().accountId()); + Assertions.assertEquals("tbzsgfyccs", model.awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(false, model.awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, model.hostType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PublicCloudConnectorProperties model = new PublicCloudConnectorProperties() + .withAwsCloudProfile(new AwsCloudProfile().withAccountId("fsrpymzidnse") + .withExcludedAccounts(Arrays.asList("tbzsgfyccs", "ewmdw", "jeiachboosfl", "ro")) + .withIsOrganizationalAccount(false)) + .withHostType(HostType.AWS); + model = BinaryData.fromObject(model).toObject(PublicCloudConnectorProperties.class); + Assertions.assertEquals("fsrpymzidnse", model.awsCloudProfile().accountId()); + Assertions.assertEquals("tbzsgfyccs", model.awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(false, model.awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, model.hostType()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsCreateOrUpdateMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsCreateOrUpdateMockTests.java new file mode 100644 index 000000000000..3512a49f0e34 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsCreateOrUpdateMockTests.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.AwsCloudProfile; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnector; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnectorProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PublicCloudConnectorsCreateOrUpdateMockTests { + @Test + public void testCreateOrUpdate() throws Exception { + String responseStr + = "{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"twwaezkojvdcpzf\",\"excludedAccounts\":[\"uicybxarzgszuf\",\"x\",\"iqopidoamciod\",\"khazxkhnzbonlwn\"],\"isOrganizationalAccount\":true},\"hostType\":\"AWS\",\"provisioningState\":\"Succeeded\",\"connectorPrimaryIdentifier\":\"wbw\"},\"location\":\"szzcmrvexztv\",\"tags\":{\"lmnguxaw\":\"gsfraoyzkoow\",\"uximerqfobw\":\"aldsy\",\"r\":\"znkbykutwpfhpagm\",\"kkze\":\"kdsnfdsdoakgtdl\"},\"id\":\"dlhewp\",\"name\":\"sdsttwvog\",\"type\":\"bbejdcngqqm\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PublicCloudConnector response = manager.publicCloudConnectors() + .define("or") + .withRegion("f") + .withExistingResourceGroup("ppriol") + .withTags(mapOf("bgdknnqv", "gj", "sgsahmkycgr", "aznqntoru", "s", "uwjuetaeburuvdmo", "tpuqujmq", + "zlxwabmqoefkifr")) + .withProperties( + new PublicCloudConnectorProperties().withAwsCloudProfile(new AwsCloudProfile().withAccountId("lt") + .withExcludedAccounts(Arrays.asList("ncwsob", "wcsdbnwdcfhucq", "pfuvglsbjjca", "vxb")) + .withIsOrganizationalAccount(true)).withHostType(HostType.AWS)) + .create(); + + Assertions.assertEquals("szzcmrvexztv", response.location()); + Assertions.assertEquals("gsfraoyzkoow", response.tags().get("lmnguxaw")); + Assertions.assertEquals("twwaezkojvdcpzf", response.properties().awsCloudProfile().accountId()); + Assertions.assertEquals("uicybxarzgszuf", response.properties().awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(true, response.properties().awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, response.properties().hostType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsDeleteByResourceGroupWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsDeleteByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..5d191c166fa8 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsDeleteByResourceGroupWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PublicCloudConnectorsDeleteByResourceGroupWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.publicCloudConnectors() + .deleteByResourceGroupWithResponse("rwyhqmibzyhwitsm", "pyy", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsGetByResourceGroupWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..1063091b4c33 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnector; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PublicCloudConnectorsGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"xywsuws\",\"excludedAccounts\":[\"ndsytgadg\"],\"isOrganizationalAccount\":true},\"hostType\":\"AWS\",\"provisioningState\":\"Succeeded\",\"connectorPrimaryIdentifier\":\"e\"},\"location\":\"zar\",\"tags\":{\"uijfqk\":\"q\",\"ibwwiftohqkv\":\"cewiipfpub\",\"ljphuopxodl\":\"uvksgplsaknynfsy\",\"sjswsrms\":\"iyntorzihle\"},\"id\":\"yzrpzbchckqqzq\",\"name\":\"ox\",\"type\":\"ysuiizynkedya\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PublicCloudConnector response = manager.publicCloudConnectors() + .getByResourceGroupWithResponse("pkkpw", "reqnovvqfov", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("zar", response.location()); + Assertions.assertEquals("q", response.tags().get("uijfqk")); + Assertions.assertEquals("xywsuws", response.properties().awsCloudProfile().accountId()); + Assertions.assertEquals("ndsytgadg", response.properties().awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(true, response.properties().awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, response.properties().hostType()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListByResourceGroupMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListByResourceGroupMockTests.java new file mode 100644 index 000000000000..7da1767258e8 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListByResourceGroupMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnector; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PublicCloudConnectorsListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"wznm\",\"excludedAccounts\":[\"knso\",\"gj\",\"xbldtlwwrlkdmtn\"],\"isOrganizationalAccount\":false},\"hostType\":\"AWS\",\"provisioningState\":\"Failed\",\"connectorPrimaryIdentifier\":\"lxdy\"},\"location\":\"syocogjltdtbnnha\",\"tags\":{\"amqgxqquezikyw\":\"crkvcikhnv\",\"lla\":\"gxk\",\"z\":\"melwuipiccjz\"},\"id\":\"v\",\"name\":\"vvcnayr\",\"type\":\"yrnxxmueedn\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.publicCloudConnectors().listByResourceGroup("pcdpumnz", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("syocogjltdtbnnha", response.iterator().next().location()); + Assertions.assertEquals("crkvcikhnv", response.iterator().next().tags().get("amqgxqquezikyw")); + Assertions.assertEquals("wznm", response.iterator().next().properties().awsCloudProfile().accountId()); + Assertions.assertEquals("knso", + response.iterator().next().properties().awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(false, + response.iterator().next().properties().awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, response.iterator().next().properties().hostType()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListMockTests.java new file mode 100644 index 000000000000..a5bc209d22eb --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/PublicCloudConnectorsListMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.HostType; +import com.azure.resourcemanager.hybridconnectivity.models.PublicCloudConnector; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class PublicCloudConnectorsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"awsCloudProfile\":{\"accountId\":\"dvstkw\",\"excludedAccounts\":[\"chea\",\"mfmtdaaygdvw\"],\"isOrganizationalAccount\":true},\"hostType\":\"AWS\",\"provisioningState\":\"Succeeded\",\"connectorPrimaryIdentifier\":\"wxrt\"},\"location\":\"dxepxgyq\",\"tags\":{\"wi\":\"rvmnpkukghimdblx\",\"rey\":\"fnjhfjxwmszkkfo\",\"elpcirelsfeaenwa\":\"kzikfjawneaivxwc\",\"xbjhwuaanozjosph\":\"fatkld\"},\"id\":\"oulpjrv\",\"name\":\"ag\",\"type\":\"rvimjwosytxitcsk\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.publicCloudConnectors().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("dxepxgyq", response.iterator().next().location()); + Assertions.assertEquals("rvmnpkukghimdblx", response.iterator().next().tags().get("wi")); + Assertions.assertEquals("dvstkw", response.iterator().next().properties().awsCloudProfile().accountId()); + Assertions.assertEquals("chea", + response.iterator().next().properties().awsCloudProfile().excludedAccounts().get(0)); + Assertions.assertEquals(true, + response.iterator().next().properties().awsCloudProfile().isOrganizationalAccount()); + Assertions.assertEquals(HostType.AWS, response.iterator().next().properties().hostType()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationListTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationListTests.java index 4ed33dcfacbc..e0b2688a4d4a 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationListTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationListTests.java @@ -1,45 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.hybridconnectivity.fluent.models.ServiceConfigurationResourceInner; -import com.azure.resourcemanager.hybridconnectivity.models.ServiceConfigurationList; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.ServiceConfigurationList; import com.azure.resourcemanager.hybridconnectivity.models.ServiceName; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ServiceConfigurationListTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceConfigurationList model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"serviceName\":\"SSH\",\"resourceId\":\"sprozvcput\",\"port\":7394887039726775075,\"provisioningState\":\"Creating\"},\"id\":\"datscmd\",\"name\":\"pjhulsuuvmkj\",\"type\":\"zkrwfn\"},{\"properties\":{\"serviceName\":\"WAC\",\"resourceId\":\"jpslwejd\",\"port\":2711659806667039097,\"provisioningState\":\"Succeeded\"},\"id\":\"psoacctazakljl\",\"name\":\"hbcryffdfdosyge\",\"type\":\"paojakhmsbzjh\"},{\"properties\":{\"serviceName\":\"SSH\",\"resourceId\":\"vdphlxaolthqtr\",\"port\":2607282935918519139,\"provisioningState\":\"Failed\"},\"id\":\"fsinzgvfcjrwzoxx\",\"name\":\"tfell\",\"type\":\"wfzitonpeqfpjk\"}],\"nextLink\":\"xofpdvhpfxxypi\"}") + "{\"value\":[{\"properties\":{\"serviceName\":\"WAC\",\"resourceId\":\"gxg\",\"port\":8990974861860259667,\"provisioningState\":\"Failed\"},\"id\":\"zfkufubljofx\",\"name\":\"eofjaeqjh\",\"type\":\"jbasvmsmjqulngs\"},{\"properties\":{\"serviceName\":\"WAC\",\"resourceId\":\"ybkzgcwr\",\"port\":4988388139114001122,\"provisioningState\":\"Failed\"},\"id\":\"ljdousk\",\"name\":\"qvkoc\",\"type\":\"cjdkwtnhxbnjbi\"},{\"properties\":{\"serviceName\":\"WAC\",\"resourceId\":\"gls\",\"port\":1203415892502867376,\"provisioningState\":\"Failed\"},\"id\":\"wnzlljfmppeeb\",\"name\":\"mgxsab\",\"type\":\"yqduujit\"}],\"nextLink\":\"czdzev\"}") .toObject(ServiceConfigurationList.class); - Assertions.assertEquals(ServiceName.SSH, model.value().get(0).serviceName()); - Assertions.assertEquals("sprozvcput", model.value().get(0).resourceId()); - Assertions.assertEquals(7394887039726775075L, model.value().get(0).port()); - Assertions.assertEquals("xofpdvhpfxxypi", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceConfigurationList model = new ServiceConfigurationList().withValue(Arrays.asList( - new ServiceConfigurationResourceInner().withServiceName(ServiceName.SSH) - .withResourceId("sprozvcput") - .withPort(7394887039726775075L), - new ServiceConfigurationResourceInner().withServiceName(ServiceName.WAC) - .withResourceId("jpslwejd") - .withPort(2711659806667039097L), - new ServiceConfigurationResourceInner().withServiceName(ServiceName.SSH) - .withResourceId("vdphlxaolthqtr") - .withPort(2607282935918519139L))) - .withNextLink("xofpdvhpfxxypi"); - model = BinaryData.fromObject(model).toObject(ServiceConfigurationList.class); - Assertions.assertEquals(ServiceName.SSH, model.value().get(0).serviceName()); - Assertions.assertEquals("sprozvcput", model.value().get(0).resourceId()); - Assertions.assertEquals(7394887039726775075L, model.value().get(0).port()); - Assertions.assertEquals("xofpdvhpfxxypi", model.nextLink()); + Assertions.assertEquals(ServiceName.WAC, model.value().get(0).serviceName()); + Assertions.assertEquals("gxg", model.value().get(0).resourceId()); + Assertions.assertEquals(8990974861860259667L, model.value().get(0).port()); + Assertions.assertEquals("czdzev", model.nextLink()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationPropertiesPatchTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationPropertiesPatchTests.java index 53f7d0410a1e..e01f9a809542 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationPropertiesPatchTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationPropertiesPatchTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -11,16 +11,16 @@ public final class ServiceConfigurationPropertiesPatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServiceConfigurationPropertiesPatch model = BinaryData.fromString("{\"port\":9010569490634453588}") + ServiceConfigurationPropertiesPatch model = BinaryData.fromString("{\"port\":5507217577010646686}") .toObject(ServiceConfigurationPropertiesPatch.class); - Assertions.assertEquals(9010569490634453588L, model.port()); + Assertions.assertEquals(5507217577010646686L, model.port()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceConfigurationPropertiesPatch model - = new ServiceConfigurationPropertiesPatch().withPort(9010569490634453588L); + = new ServiceConfigurationPropertiesPatch().withPort(5507217577010646686L); model = BinaryData.fromObject(model).toObject(ServiceConfigurationPropertiesPatch.class); - Assertions.assertEquals(9010569490634453588L, model.port()); + Assertions.assertEquals(5507217577010646686L, model.port()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationPropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationPropertiesTests.java index 171b11d8e77e..4935f4e64e0e 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationPropertiesTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationPropertiesTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -13,21 +13,21 @@ public final class ServiceConfigurationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceConfigurationProperties model = BinaryData.fromString( - "{\"serviceName\":\"WAC\",\"resourceId\":\"evcciqihnhun\",\"port\":4957035002722095413,\"provisioningState\":\"Failed\"}") + "{\"serviceName\":\"SSH\",\"resourceId\":\"zxtheotusivyevcc\",\"port\":6538190661575268065,\"provisioningState\":\"Creating\"}") .toObject(ServiceConfigurationProperties.class); - Assertions.assertEquals(ServiceName.WAC, model.serviceName()); - Assertions.assertEquals("evcciqihnhun", model.resourceId()); - Assertions.assertEquals(4957035002722095413L, model.port()); + Assertions.assertEquals(ServiceName.SSH, model.serviceName()); + Assertions.assertEquals("zxtheotusivyevcc", model.resourceId()); + Assertions.assertEquals(6538190661575268065L, model.port()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceConfigurationProperties model = new ServiceConfigurationProperties().withServiceName(ServiceName.WAC) - .withResourceId("evcciqihnhun") - .withPort(4957035002722095413L); + ServiceConfigurationProperties model = new ServiceConfigurationProperties().withServiceName(ServiceName.SSH) + .withResourceId("zxtheotusivyevcc") + .withPort(6538190661575268065L); model = BinaryData.fromObject(model).toObject(ServiceConfigurationProperties.class); - Assertions.assertEquals(ServiceName.WAC, model.serviceName()); - Assertions.assertEquals("evcciqihnhun", model.resourceId()); - Assertions.assertEquals(4957035002722095413L, model.port()); + Assertions.assertEquals(ServiceName.SSH, model.serviceName()); + Assertions.assertEquals("zxtheotusivyevcc", model.resourceId()); + Assertions.assertEquals(6538190661575268065L, model.port()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationResourceInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationResourceInnerTests.java index ad07d89aae4e..a186c50ac29f 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationResourceInnerTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationResourceInnerTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -13,22 +13,22 @@ public final class ServiceConfigurationResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceConfigurationResourceInner model = BinaryData.fromString( - "{\"properties\":{\"serviceName\":\"WAC\",\"resourceId\":\"ayhuy\",\"port\":5121116175733126512,\"provisioningState\":\"Canceled\"},\"id\":\"po\",\"name\":\"ginuvamih\",\"type\":\"ognarxzxtheotus\"}") + "{\"properties\":{\"serviceName\":\"WAC\",\"resourceId\":\"hpf\",\"port\":7217061435098836741,\"provisioningState\":\"Creating\"},\"id\":\"nmayhuybb\",\"name\":\"podepoo\",\"type\":\"inuvamiheogn\"}") .toObject(ServiceConfigurationResourceInner.class); Assertions.assertEquals(ServiceName.WAC, model.serviceName()); - Assertions.assertEquals("ayhuy", model.resourceId()); - Assertions.assertEquals(5121116175733126512L, model.port()); + Assertions.assertEquals("hpf", model.resourceId()); + Assertions.assertEquals(7217061435098836741L, model.port()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceConfigurationResourceInner model = new ServiceConfigurationResourceInner().withServiceName(ServiceName.WAC) - .withResourceId("ayhuy") - .withPort(5121116175733126512L); + .withResourceId("hpf") + .withPort(7217061435098836741L); model = BinaryData.fromObject(model).toObject(ServiceConfigurationResourceInner.class); Assertions.assertEquals(ServiceName.WAC, model.serviceName()); - Assertions.assertEquals("ayhuy", model.resourceId()); - Assertions.assertEquals(5121116175733126512L, model.port()); + Assertions.assertEquals("hpf", model.resourceId()); + Assertions.assertEquals(7217061435098836741L, model.port()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationResourcePatchTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationResourcePatchTests.java index 9d852c08a1c5..01c33c4d75c7 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationResourcePatchTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationResourcePatchTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; @@ -12,16 +12,16 @@ public final class ServiceConfigurationResourcePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceConfigurationResourcePatch model - = BinaryData.fromString("{\"properties\":{\"port\":4533506116683097889}}") + = BinaryData.fromString("{\"properties\":{\"port\":8475415208772100172}}") .toObject(ServiceConfigurationResourcePatch.class); - Assertions.assertEquals(4533506116683097889L, model.port()); + Assertions.assertEquals(8475415208772100172L, model.port()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ServiceConfigurationResourcePatch model - = new ServiceConfigurationResourcePatch().withPort(4533506116683097889L); + = new ServiceConfigurationResourcePatch().withPort(8475415208772100172L); model = BinaryData.fromObject(model).toObject(ServiceConfigurationResourcePatch.class); - Assertions.assertEquals(4533506116683097889L, model.port()); + Assertions.assertEquals(8475415208772100172L, model.port()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsCreateOrupdateWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsCreateOrupdateWithResponseMockTests.java index ba2a1c732d37..27b0c5a9c889 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsCreateOrupdateWithResponseMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsCreateOrupdateWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import com.azure.resourcemanager.hybridconnectivity.models.ServiceConfigurationResource; @@ -22,25 +22,25 @@ public final class ServiceConfigurationsCreateOrupdateWithResponseMockTests { @Test public void testCreateOrupdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"serviceName\":\"WAC\",\"resourceId\":\"jjxhvpmo\",\"port\":5563523584093599698,\"provisioningState\":\"Failed\"},\"id\":\"i\",\"name\":\"qeojnxqbzvddntw\",\"type\":\"deicbtwnpzao\"}"; + = "{\"properties\":{\"serviceName\":\"SSH\",\"resourceId\":\"kcbcue\",\"port\":1999500267063441667,\"provisioningState\":\"Succeeded\"},\"id\":\"qibrhosxsdqrhzoy\",\"name\":\"i\",\"type\":\"m\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ServiceConfigurationResource response = manager.serviceConfigurations() - .define("jctbza") - .withExistingEndpoint("mcl", "hijco") + .define("quxvypomgkop") + .withExistingEndpoint("nubexk", "zksmondj") .withServiceName(ServiceName.WAC) - .withResourceId("y") - .withPort(5593632114623401437L) + .withResourceId("jvp") + .withPort(4279032137659144852L) .create(); - Assertions.assertEquals(ServiceName.WAC, response.serviceName()); - Assertions.assertEquals("jjxhvpmo", response.resourceId()); - Assertions.assertEquals(5563523584093599698L, response.port()); + Assertions.assertEquals(ServiceName.SSH, response.serviceName()); + Assertions.assertEquals("kcbcue", response.resourceId()); + Assertions.assertEquals(1999500267063441667L, response.port()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsDeleteWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsDeleteWithResponseMockTests.java index 94b73dff5725..e045a8428e4a 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsDeleteWithResponseMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsDeleteWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import java.nio.charset.StandardCharsets; @@ -25,11 +25,10 @@ public void testDeleteWithResponse() throws Exception { HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.serviceConfigurations() - .deleteWithResponse("bnbdxkqpxokajion", "imexgstxgcpodgma", "jrmvdjwzrlo", - com.azure.core.util.Context.NONE); + .deleteWithResponse("pcjwv", "hdldwmgxcxrsl", "mutwuoe", com.azure.core.util.Context.NONE); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsGetWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsGetWithResponseMockTests.java index 4b995fa958bb..1b390842024a 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsGetWithResponseMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsGetWithResponseMockTests.java @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import com.azure.resourcemanager.hybridconnectivity.models.ServiceConfigurationResource; @@ -22,21 +22,21 @@ public final class ServiceConfigurationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"serviceName\":\"SSH\",\"resourceId\":\"c\",\"port\":643106143486636349,\"provisioningState\":\"Creating\"},\"id\":\"rhhbcs\",\"name\":\"l\",\"type\":\"mmajtjaodx\"}"; + = "{\"properties\":{\"serviceName\":\"SSH\",\"resourceId\":\"xyjrxsagafcnih\",\"port\":3130876298104392093,\"provisioningState\":\"Failed\"},\"id\":\"dgfbcvkcvqvpke\",\"name\":\"dcvd\",\"type\":\"hvoodsotbobzd\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ServiceConfigurationResource response = manager.serviceConfigurations() - .getWithResponse("qajzyulpkudjkr", "khbzhfepgzg", "e", com.azure.core.util.Context.NONE) + .getWithResponse("ewkfvhqcrai", "vpnpp", "uflrwd", com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(ServiceName.SSH, response.serviceName()); - Assertions.assertEquals("c", response.resourceId()); - Assertions.assertEquals(643106143486636349L, response.port()); + Assertions.assertEquals("xyjrxsagafcnih", response.resourceId()); + Assertions.assertEquals(3130876298104392093L, response.port()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsListByEndpointResourceMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsListByEndpointResourceMockTests.java index c6492bbf8984..d883a2d846c1 100644 --- a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsListByEndpointResourceMockTests.java +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/ServiceConfigurationsListByEndpointResourceMockTests.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.hybridconnectivity.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; import com.azure.resourcemanager.hybridconnectivity.models.ServiceConfigurationResource; @@ -23,20 +23,20 @@ public final class ServiceConfigurationsListByEndpointResourceMockTests { @Test public void testListByEndpointResource() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"serviceName\":\"SSH\",\"resourceId\":\"bnmo\",\"port\":7164396751895305600,\"provisioningState\":\"Updating\"},\"id\":\"rzafbljjgpbtoqcj\",\"name\":\"klj\",\"type\":\"vbqid\"}]}"; + = "{\"value\":[{\"properties\":{\"serviceName\":\"WAC\",\"resourceId\":\"kzzlvmbmpaxmodf\",\"port\":3624195401715068445,\"provisioningState\":\"Creating\"},\"id\":\"bpfvm\",\"name\":\"yhrfouyftaakcpw\",\"type\":\"yzvqt\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); HybridConnectivityManager manager = HybridConnectivityManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.serviceConfigurations() - .listByEndpointResource("znorcj", "vsnb", com.azure.core.util.Context.NONE); + .listByEndpointResource("rpkhjwn", "yqsluic", com.azure.core.util.Context.NONE); - Assertions.assertEquals(ServiceName.SSH, response.iterator().next().serviceName()); - Assertions.assertEquals("bnmo", response.iterator().next().resourceId()); - Assertions.assertEquals(7164396751895305600L, response.iterator().next().port()); + Assertions.assertEquals(ServiceName.WAC, response.iterator().next().serviceName()); + Assertions.assertEquals("kzzlvmbmpaxmodf", response.iterator().next().resourceId()); + Assertions.assertEquals(3624195401715068445L, response.iterator().next().port()); } } diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationInnerTests.java new file mode 100644 index 000000000000..094e3d72127d --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationInnerTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionConfigurationInner; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SolutionConfigurationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionConfigurationInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Canceled\",\"solutionType\":\"npwlbjnpg\",\"solutionSettings\":{\"\":{\"suesnzw\":\"adehxnltyfsopp\",\"avo\":\"ej\",\"vudwx\":\"xzdmohctb\",\"gujjugwdkcglh\":\"ndnvo\"}},\"status\":\"InProgress\",\"statusDetails\":\"jdyggdtji\",\"lastSyncTime\":\"2021-08-21T20:33:35Z\"},\"id\":\"uofqwe\",\"name\":\"kh\",\"type\":\"enevfyexfwhybci\"}") + .toObject(SolutionConfigurationInner.class); + Assertions.assertEquals("npwlbjnpg", model.properties().solutionType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SolutionConfigurationInner model = new SolutionConfigurationInner() + .withProperties(new SolutionConfigurationProperties().withSolutionType("npwlbjnpg") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf()))); + model = BinaryData.fromObject(model).toObject(SolutionConfigurationInner.class); + Assertions.assertEquals("npwlbjnpg", model.properties().solutionType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationListResultTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationListResultTests.java new file mode 100644 index 000000000000..580dbbce45bc --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationListResultTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.SolutionConfigurationListResult; +import org.junit.jupiter.api.Assertions; + +public final class SolutionConfigurationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionConfigurationListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"solutionType\":\"ysou\",\"solutionSettings\":{\"\":{\"oaeupfhyhltrpmo\":\"a\",\"uaodsfcpk\":\"jmcmatuokthfu\",\"xbezyiuokktwh\":\"xodpuozmyzydagfu\"}},\"status\":\"New\",\"statusDetails\":\"zywqsmbsu\",\"lastSyncTime\":\"2021-04-26T13:01:12Z\"},\"id\":\"moryocfsfksym\",\"name\":\"dystkiiuxhqyud\",\"type\":\"o\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"solutionType\":\"b\",\"solutionSettings\":{\"\":{\"rm\":\"vyifqrvkdvjsl\",\"ulexxbczwtr\":\"vdfwatkpn\",\"acspkwl\":\"wiqzbqjvsovmyo\"}},\"status\":\"Failed\",\"statusDetails\":\"bpxjmfl\",\"lastSyncTime\":\"2021-10-06T08:44:01Z\"},\"id\":\"chrkcciwwzjuqk\",\"name\":\"rsa\",\"type\":\"iwkuofos\"},{\"properties\":{\"provisioningState\":\"Canceled\",\"solutionType\":\"auu\",\"solutionSettings\":{\"\":{\"rfbyaosvexcso\":\"vxieduugidyj\"}},\"status\":\"Completed\",\"statusDetails\":\"hocohslkev\",\"lastSyncTime\":\"2021-07-27T15:45:18Z\"},\"id\":\"zfbuhf\",\"name\":\"vfaxkffeiith\",\"type\":\"vmezy\"}],\"nextLink\":\"hxmzsbbzoggig\"}") + .toObject(SolutionConfigurationListResult.class); + Assertions.assertEquals("ysou", model.value().get(0).properties().solutionType()); + Assertions.assertEquals("hxmzsbbzoggig", model.nextLink()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationPropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationPropertiesTests.java new file mode 100644 index 000000000000..e4512536bc66 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationPropertiesTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SolutionConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionConfigurationProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Canceled\",\"solutionType\":\"vdcsitynn\",\"solutionSettings\":{\"\":{\"qsc\":\"ectehf\",\"hcjrefovgmk\":\"eypvhezrkg\",\"yvxyqjp\":\"sle\"}},\"status\":\"Failed\",\"statusDetails\":\"tpngjcrcczsqpjh\",\"lastSyncTime\":\"2021-11-23T05:20:04Z\"}") + .toObject(SolutionConfigurationProperties.class); + Assertions.assertEquals("vdcsitynn", model.solutionType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SolutionConfigurationProperties model = new SolutionConfigurationProperties().withSolutionType("vdcsitynn") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf())); + model = BinaryData.fromObject(model).toObject(SolutionConfigurationProperties.class); + Assertions.assertEquals("vdcsitynn", model.solutionType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsCreateOrUpdateWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsCreateOrUpdateWithResponseMockTests.java new file mode 100644 index 000000000000..3bc54399f4a7 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsCreateOrUpdateWithResponseMockTests.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfiguration; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfigurationProperties; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SolutionConfigurationsCreateOrUpdateWithResponseMockTests { + @Test + public void testCreateOrUpdateWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Failed\",\"solutionType\":\"mbzonokix\",\"solutionSettings\":{\"\":{\"rlazszrnw\":\"irgzp\",\"fpwpjylwbt\":\"iin\"}},\"status\":\"InProgress\",\"statusDetails\":\"sj\",\"lastSyncTime\":\"2021-10-21T17:47:33Z\"},\"id\":\"zfjvfbgofe\",\"name\":\"jagrqmqhldvr\",\"type\":\"iiojnal\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SolutionConfiguration response = manager.solutionConfigurations() + .define("jabudurgkakmo") + .withExistingResourceUri("jxbkzbzkdvn") + .withProperties(new SolutionConfigurationProperties().withSolutionType("jk") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf()))) + .create(); + + Assertions.assertEquals("mbzonokix", response.properties().solutionType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsDeleteByResourceGroupWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsDeleteByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..f12e1d7b11be --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsDeleteByResourceGroupWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SolutionConfigurationsDeleteByResourceGroupWithResponseMockTests { + @Test + public void testDeleteWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.solutionConfigurations() + .deleteByResourceGroupWithResponse("scywuggwoluhc", "bwemhairs", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsGetWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsGetWithResponseMockTests.java new file mode 100644 index 000000000000..d917907d60e9 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsGetWithResponseMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfiguration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SolutionConfigurationsGetWithResponseMockTests { + @Test + public void testGetWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Failed\",\"solutionType\":\"wae\",\"solutionSettings\":{\"\":{\"woyuhhziuief\":\"kopbminrf\",\"smlmzqhoftrm\":\"zbhd\"}},\"status\":\"New\",\"statusDetails\":\"iahxicsl\",\"lastSyncTime\":\"2021-03-06T05:00:38Z\"},\"id\":\"z\",\"name\":\"iyylhalnswhccsp\",\"type\":\"kaivwit\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SolutionConfiguration response = manager.solutionConfigurations() + .getWithResponse("akufgmjz", "wr", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("wae", response.properties().solutionType()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsListMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsListMockTests.java new file mode 100644 index 000000000000..2263dce8152d --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionConfigurationsListMockTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionConfiguration; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SolutionConfigurationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"solutionType\":\"ggicccnxqhue\",\"solutionSettings\":{\"\":{\"zrncsdt\":\"tlstvlzywem\",\"bsfgytguslfea\":\"lusiy\",\"qukyhejhzi\":\"cy\",\"srp\":\"xgfpelolppv\"}},\"status\":\"InProgress\",\"statusDetails\":\"zraehtwd\",\"lastSyncTime\":\"2021-10-09T15:06:55Z\"},\"id\":\"swibyr\",\"name\":\"dl\",\"type\":\"h\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.solutionConfigurations().list("rgzdwmsweyp", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ggicccnxqhue", response.iterator().next().properties().solutionType()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionSettingsTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionSettingsTests.java new file mode 100644 index 000000000000..9e037110e247 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionSettingsTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import java.util.HashMap; +import java.util.Map; + +public final class SolutionSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionSettings model = BinaryData.fromString("{\"\":{\"f\":\"dgbb\",\"bexppb\":\"dgmb\",\"rolfpfp\":\"tq\"}}") + .toObject(SolutionSettings.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SolutionSettings model = new SolutionSettings().withAdditionalProperties(mapOf()); + model = BinaryData.fromObject(model).toObject(SolutionSettings.class); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypePropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypePropertiesTests.java new file mode 100644 index 000000000000..16e6989a3aa9 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypePropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeProperties; +import org.junit.jupiter.api.Assertions; + +public final class SolutionTypePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionTypeProperties model = BinaryData.fromString( + "{\"solutionType\":\"cuh\",\"description\":\"tcty\",\"supportedAzureRegions\":[\"lbbovplw\"],\"solutionSettings\":[{\"name\":\"vgyuguos\",\"displayName\":\"mkfssxqukkfplgm\",\"type\":\"sxnkjzkdeslpvlo\",\"description\":\"wiyighxpkdw\",\"allowedValues\":[\"aiuebbaumnyqu\",\"edeojnabc\",\"hsmtxpsiebtfhvp\"],\"defaultValue\":\"sapskr\"},{\"name\":\"qmhjjdhtld\",\"displayName\":\"kyzxuutk\",\"type\":\"cwscwsvlx\",\"description\":\"togt\",\"allowedValues\":[\"upqsx\",\"nmic\",\"kvceoveilovnotyf\"],\"defaultValue\":\"fcnj\"},{\"name\":\"k\",\"displayName\":\"nxdhbt\",\"type\":\"kphywpnvjto\",\"description\":\"nermcl\",\"allowedValues\":[\"lphox\",\"scrpabgyepsbjt\"],\"defaultValue\":\"zq\"}]}") + .toObject(SolutionTypeProperties.class); + Assertions.assertEquals("cuh", model.solutionType()); + Assertions.assertEquals("tcty", model.description()); + Assertions.assertEquals("lbbovplw", model.supportedAzureRegions().get(0)); + Assertions.assertEquals("vgyuguos", model.solutionSettings().get(0).name()); + Assertions.assertEquals("mkfssxqukkfplgm", model.solutionSettings().get(0).displayName()); + Assertions.assertEquals("sxnkjzkdeslpvlo", model.solutionSettings().get(0).type()); + Assertions.assertEquals("wiyighxpkdw", model.solutionSettings().get(0).description()); + Assertions.assertEquals("aiuebbaumnyqu", model.solutionSettings().get(0).allowedValues().get(0)); + Assertions.assertEquals("sapskr", model.solutionSettings().get(0).defaultValue()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeResourceInnerTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeResourceInnerTests.java new file mode 100644 index 000000000000..ec3596419a70 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeResourceInnerTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.fluent.models.SolutionTypeResourceInner; +import org.junit.jupiter.api.Assertions; + +public final class SolutionTypeResourceInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionTypeResourceInner model = BinaryData.fromString( + "{\"properties\":{\"solutionType\":\"jhtxfvgxbfsmxne\",\"description\":\"pvecxgodeb\",\"supportedAzureRegions\":[\"krbm\"],\"solutionSettings\":[{\"name\":\"gr\",\"displayName\":\"wflzlfbxzpuzy\",\"type\":\"ispnqzahmgkbrp\",\"description\":\"y\",\"allowedValues\":[\"ibnuqqkpik\",\"drgvtqagn\",\"uynhijg\"],\"defaultValue\":\"mebf\"},{\"name\":\"iarbutrcvpna\",\"displayName\":\"zmhjrunmp\",\"type\":\"ttdbhrbnl\",\"description\":\"nkxmyskpbhenbtk\",\"allowedValues\":[\"ywn\",\"tnrsyn\",\"qidybyx\",\"zfcl\"],\"defaultValue\":\"aaxdbabphlwrq\"},{\"name\":\"fkts\",\"displayName\":\"hsucoc\",\"type\":\"nyyazttbtwwrqpue\",\"description\":\"ckzywbiexzfeyue\",\"allowedValues\":[\"ibx\",\"jwbhqwalmuz\",\"oxaepd\",\"zjancuxr\"],\"defaultValue\":\"d\"}]},\"id\":\"avxbniwdjswztsdb\",\"name\":\"gnxytxhpzxbz\",\"type\":\"fzab\"}") + .toObject(SolutionTypeResourceInner.class); + Assertions.assertEquals("jhtxfvgxbfsmxne", model.properties().solutionType()); + Assertions.assertEquals("pvecxgodeb", model.properties().description()); + Assertions.assertEquals("krbm", model.properties().supportedAzureRegions().get(0)); + Assertions.assertEquals("gr", model.properties().solutionSettings().get(0).name()); + Assertions.assertEquals("wflzlfbxzpuzy", model.properties().solutionSettings().get(0).displayName()); + Assertions.assertEquals("ispnqzahmgkbrp", model.properties().solutionSettings().get(0).type()); + Assertions.assertEquals("y", model.properties().solutionSettings().get(0).description()); + Assertions.assertEquals("ibnuqqkpik", model.properties().solutionSettings().get(0).allowedValues().get(0)); + Assertions.assertEquals("mebf", model.properties().solutionSettings().get(0).defaultValue()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeResourceListResultTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeResourceListResultTests.java new file mode 100644 index 000000000000..ac77858608bc --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeResourceListResultTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.implementation.models.SolutionTypeResourceListResult; +import org.junit.jupiter.api.Assertions; + +public final class SolutionTypeResourceListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionTypeResourceListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"solutionType\":\"dw\",\"description\":\"ntxhdzhlrqjbhck\",\"supportedAzureRegions\":[\"hrxsbk\",\"vpycanuzbp\",\"kafkuwbcrnwbm\"],\"solutionSettings\":[{\"name\":\"seyvj\",\"displayName\":\"srtslhspkdeem\",\"type\":\"ofmxagkvtmelmqkr\",\"description\":\"ahvljuaha\",\"allowedValues\":[\"hcdhmdual\",\"exq\"],\"defaultValue\":\"vfadmws\"},{\"name\":\"crgvxpvgom\",\"displayName\":\"lf\",\"type\":\"isgwbnbbeldawkz\",\"description\":\"ali\",\"allowedValues\":[\"rqhakauha\",\"hsfwxosowzxcug\"],\"defaultValue\":\"cjooxdjebwpucwwf\"}]},\"id\":\"vbvmeu\",\"name\":\"civyhzceuo\",\"type\":\"gjrwjueiotwmcdyt\"},{\"properties\":{\"solutionType\":\"it\",\"description\":\"rjaw\",\"supportedAzureRegions\":[\"gxhnisk\",\"fbkp\"],\"solutionSettings\":[{\"name\":\"klwndnhjdauwhv\",\"displayName\":\"l\",\"type\":\"zbtd\",\"description\":\"xujznbmpowu\",\"allowedValues\":[\"rzqlveu\",\"lupj\"],\"defaultValue\":\"khfxobbcswsrt\"},{\"name\":\"riplrbpbewtg\",\"displayName\":\"fgb\",\"type\":\"c\",\"description\":\"wxzvlvqhjkb\",\"allowedValues\":[\"ibtnmxiebwwaloay\",\"cgwrtzjuz\"],\"defaultValue\":\"wyzmhtxon\"}]},\"id\":\"ts\",\"name\":\"vjcbpwxqpsrknf\",\"type\":\"guvriuhprwmd\"},{\"properties\":{\"solutionType\":\"qtayri\",\"description\":\"ro\",\"supportedAzureRegions\":[\"exrmcqibycnojvk\",\"mefqsgzvahapjyzh\"],\"solutionSettings\":[{\"name\":\"qzcjrvxdj\",\"displayName\":\"lmwlxkvugfhzo\",\"type\":\"awjvzunluthnnp\",\"description\":\"nxipeil\",\"allowedValues\":[\"zuaejxd\",\"ltskzbbtd\",\"umveekgpwozuhkf\",\"bsjyofdx\"],\"defaultValue\":\"uusdttouwa\"},{\"name\":\"oekqvk\",\"displayName\":\"lns\",\"type\":\"vbxwyjsflhh\",\"description\":\"aalnjixi\",\"allowedValues\":[\"yaw\",\"oyaqcslyjpkiid\"],\"defaultValue\":\"yexz\"}]},\"id\":\"lixhnrztfol\",\"name\":\"bnxknalaulppg\",\"type\":\"dtpnapnyiropuhp\"},{\"properties\":{\"solutionType\":\"pgylg\",\"description\":\"itxmedjvcslynqww\",\"supportedAzureRegions\":[\"zzhxgktrm\"],\"solutionSettings\":[{\"name\":\"napkteoellw\",\"displayName\":\"tfdygpfqb\",\"type\":\"ac\",\"description\":\"op\",\"allowedValues\":[\"qrhhu\",\"opppcqeq\",\"ol\"],\"defaultValue\":\"dahzxctobg\"},{\"name\":\"kdmoi\",\"displayName\":\"postmgrcfbunrm\",\"type\":\"qjhhkxbpv\",\"description\":\"ymjhxxjyngudivkr\",\"allowedValues\":[\"wbxqzvszjfau\",\"j\"],\"defaultValue\":\"dxxiv\"},{\"name\":\"tvtc\",\"displayName\":\"aqtdoqmcbx\",\"type\":\"wvxysl\",\"description\":\"bhsfxob\",\"allowedValues\":[\"tkblmpewww\",\"bkrvrnsvshqj\",\"hxcr\"],\"defaultValue\":\"bfovasrruvwbhsq\"}]},\"id\":\"ubcgjbirxb\",\"name\":\"ybsrfbjfdtwss\",\"type\":\"t\"}],\"nextLink\":\"pvjzbe\"}") + .toObject(SolutionTypeResourceListResult.class); + Assertions.assertEquals("dw", model.value().get(0).properties().solutionType()); + Assertions.assertEquals("ntxhdzhlrqjbhck", model.value().get(0).properties().description()); + Assertions.assertEquals("hrxsbk", model.value().get(0).properties().supportedAzureRegions().get(0)); + Assertions.assertEquals("seyvj", model.value().get(0).properties().solutionSettings().get(0).name()); + Assertions.assertEquals("srtslhspkdeem", + model.value().get(0).properties().solutionSettings().get(0).displayName()); + Assertions.assertEquals("ofmxagkvtmelmqkr", model.value().get(0).properties().solutionSettings().get(0).type()); + Assertions.assertEquals("ahvljuaha", model.value().get(0).properties().solutionSettings().get(0).description()); + Assertions.assertEquals("hcdhmdual", + model.value().get(0).properties().solutionSettings().get(0).allowedValues().get(0)); + Assertions.assertEquals("vfadmws", model.value().get(0).properties().solutionSettings().get(0).defaultValue()); + Assertions.assertEquals("pvjzbe", model.nextLink()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeSettingsPropertiesTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeSettingsPropertiesTests.java new file mode 100644 index 000000000000..3318a2a4586b --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeSettingsPropertiesTests.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeSettingsProperties; +import org.junit.jupiter.api.Assertions; + +public final class SolutionTypeSettingsPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionTypeSettingsProperties model = BinaryData.fromString( + "{\"name\":\"gxywpmue\",\"displayName\":\"fjz\",\"type\":\"fqkquj\",\"description\":\"dsuyonobgla\",\"allowedValues\":[\"qxtccmgyudx\"],\"defaultValue\":\"tlmoyrx\"}") + .toObject(SolutionTypeSettingsProperties.class); + Assertions.assertEquals("gxywpmue", model.name()); + Assertions.assertEquals("fjz", model.displayName()); + Assertions.assertEquals("fqkquj", model.type()); + Assertions.assertEquals("dsuyonobgla", model.description()); + Assertions.assertEquals("qxtccmgyudx", model.allowedValues().get(0)); + Assertions.assertEquals("tlmoyrx", model.defaultValue()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeSettingsTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeSettingsTests.java new file mode 100644 index 000000000000..6226ff991523 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypeSettingsTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionSettings; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeSettings; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SolutionTypeSettingsTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SolutionTypeSettings model = BinaryData.fromString( + "{\"solutionType\":\"qsrxybzqqed\",\"solutionSettings\":{\"\":{\"lmmnkzsmodmglo\":\"ciqfou\",\"uqktap\":\"gpbkwtmut\",\"kdosvqw\":\"pwgcuertu\"}}}") + .toObject(SolutionTypeSettings.class); + Assertions.assertEquals("qsrxybzqqed", model.solutionType()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SolutionTypeSettings model = new SolutionTypeSettings().withSolutionType("qsrxybzqqed") + .withSolutionSettings(new SolutionSettings().withAdditionalProperties(mapOf())); + model = BinaryData.fromObject(model).toObject(SolutionTypeSettings.class); + Assertions.assertEquals("qsrxybzqqed", model.solutionType()); + } + + // Use "Map.of" if available + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesGetByResourceGroupWithResponseMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesGetByResourceGroupWithResponseMockTests.java new file mode 100644 index 000000000000..06e250ba2000 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesGetByResourceGroupWithResponseMockTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SolutionTypesGetByResourceGroupWithResponseMockTests { + @Test + public void testGetByResourceGroupWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"solutionType\":\"opgxedkowepb\",\"description\":\"cr\",\"supportedAzureRegions\":[\"wccsnjvcdwxlpqek\",\"tn\",\"htjsying\",\"fq\"],\"solutionSettings\":[{\"name\":\"tdhtmdvyp\",\"displayName\":\"ikdgszywkbir\",\"type\":\"yuzhlhkjoqrvq\",\"description\":\"aatjinrvgoupmfi\",\"allowedValues\":[\"fggjioolvr\",\"x\",\"v\"],\"defaultValue\":\"kkgll\"}]},\"id\":\"jygvjayvbl\",\"name\":\"hvkzuh\",\"type\":\"xvvy\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + SolutionTypeResource response = manager.solutionTypes() + .getByResourceGroupWithResponse("mfe", "kerqwkyh", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("opgxedkowepb", response.properties().solutionType()); + Assertions.assertEquals("cr", response.properties().description()); + Assertions.assertEquals("wccsnjvcdwxlpqek", response.properties().supportedAzureRegions().get(0)); + Assertions.assertEquals("tdhtmdvyp", response.properties().solutionSettings().get(0).name()); + Assertions.assertEquals("ikdgszywkbir", response.properties().solutionSettings().get(0).displayName()); + Assertions.assertEquals("yuzhlhkjoqrvq", response.properties().solutionSettings().get(0).type()); + Assertions.assertEquals("aatjinrvgoupmfi", response.properties().solutionSettings().get(0).description()); + Assertions.assertEquals("fggjioolvr", response.properties().solutionSettings().get(0).allowedValues().get(0)); + Assertions.assertEquals("kkgll", response.properties().solutionSettings().get(0).defaultValue()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListByResourceGroupMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListByResourceGroupMockTests.java new file mode 100644 index 000000000000..49ae4bbb4a3d --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListByResourceGroupMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SolutionTypesListByResourceGroupMockTests { + @Test + public void testListByResourceGroup() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"solutionType\":\"fbn\",\"description\":\"mctlpdngitv\",\"supportedAzureRegions\":[\"hrixkwmy\",\"jejveg\",\"hbpnaixexccbd\",\"eaxhcexdrrvqahqk\"],\"solutionSettings\":[{\"name\":\"pwijnhy\",\"displayName\":\"svfycxzbfv\",\"type\":\"owvrvmtgjqppyos\",\"description\":\"ronzmyhgfip\",\"allowedValues\":[\"xkmcwaekrrjre\"],\"defaultValue\":\"fxtsgum\"},{\"name\":\"jglikkxwslolb\",\"displayName\":\"pvuzlmv\",\"type\":\"elfk\",\"description\":\"gplcrpwjxeznoigb\",\"allowedValues\":[\"jwmwkpnbs\",\"zejjoqk\",\"gfhsxttaugzxn\",\"aa\"],\"defaultValue\":\"pxdtnkdmkq\"}]},\"id\":\"lwuenvrkp\",\"name\":\"ou\",\"type\":\"ibreb\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.solutionTypes().listByResourceGroup("gsopbyrqufegxu", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("fbn", response.iterator().next().properties().solutionType()); + Assertions.assertEquals("mctlpdngitv", response.iterator().next().properties().description()); + Assertions.assertEquals("hrixkwmy", response.iterator().next().properties().supportedAzureRegions().get(0)); + Assertions.assertEquals("pwijnhy", response.iterator().next().properties().solutionSettings().get(0).name()); + Assertions.assertEquals("svfycxzbfv", + response.iterator().next().properties().solutionSettings().get(0).displayName()); + Assertions.assertEquals("owvrvmtgjqppyos", + response.iterator().next().properties().solutionSettings().get(0).type()); + Assertions.assertEquals("ronzmyhgfip", + response.iterator().next().properties().solutionSettings().get(0).description()); + Assertions.assertEquals("xkmcwaekrrjre", + response.iterator().next().properties().solutionSettings().get(0).allowedValues().get(0)); + Assertions.assertEquals("fxtsgum", + response.iterator().next().properties().solutionSettings().get(0).defaultValue()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListMockTests.java b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListMockTests.java new file mode 100644 index 000000000000..a8126a484a58 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/src/test/java/com/azure/resourcemanager/hybridconnectivity/generated/SolutionTypesListMockTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.hybridconnectivity.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.hybridconnectivity.HybridConnectivityManager; +import com.azure.resourcemanager.hybridconnectivity.models.SolutionTypeResource; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SolutionTypesListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"solutionType\":\"ysjkixqtnqttez\",\"description\":\"fffiak\",\"supportedAzureRegions\":[\"qqmtedltmmji\",\"yeozphvwauyqncy\"],\"solutionSettings\":[{\"name\":\"kvi\",\"displayName\":\"mdscwxqupev\",\"type\":\"hfstotxhojujbyp\",\"description\":\"lmcuvhixb\",\"allowedValues\":[\"yfwnylr\",\"ool\",\"ttpkiwkkbnujrywv\"],\"defaultValue\":\"y\"}]},\"id\":\"fpncurdo\",\"name\":\"wiithtywub\",\"type\":\"cbihwqk\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + HybridConnectivityManager manager = HybridConnectivityManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.solutionTypes().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("ysjkixqtnqttez", response.iterator().next().properties().solutionType()); + Assertions.assertEquals("fffiak", response.iterator().next().properties().description()); + Assertions.assertEquals("qqmtedltmmji", response.iterator().next().properties().supportedAzureRegions().get(0)); + Assertions.assertEquals("kvi", response.iterator().next().properties().solutionSettings().get(0).name()); + Assertions.assertEquals("mdscwxqupev", + response.iterator().next().properties().solutionSettings().get(0).displayName()); + Assertions.assertEquals("hfstotxhojujbyp", + response.iterator().next().properties().solutionSettings().get(0).type()); + Assertions.assertEquals("lmcuvhixb", + response.iterator().next().properties().solutionSettings().get(0).description()); + Assertions.assertEquals("yfwnylr", + response.iterator().next().properties().solutionSettings().get(0).allowedValues().get(0)); + Assertions.assertEquals("y", response.iterator().next().properties().solutionSettings().get(0).defaultValue()); + } +} diff --git a/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/tsp-location.yaml b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/tsp-location.yaml new file mode 100644 index 000000000000..31691128ac26 --- /dev/null +++ b/sdk/hybridconnectivity/azure-resourcemanager-hybridconnectivity/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/hybridconnectivity/HybridConnectivity.Management +commit: 71d60f94cbbe3ff7659748ba06bdb2b592206cf1 +repo: Azure/azure-rest-api-specs +additionalDirectories: