From c475537942c90b7013e53274e87d825609413763 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 21 Aug 2026 18:47:21 +0000 Subject: [PATCH] Configurations: 'specification/hybridconnectivity/HybridConnectivity.Management/tspconfig.yaml', SDK Release Type: stable, and CommitSHA: '47515ad36204e02e14c3b62414beebca92abb4a2' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6732173 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 92 + .../azure-mgmt-hybridconnectivity/MANIFEST.in | 9 +- .../azure-mgmt-hybridconnectivity/README.md | 6 +- .../azure-mgmt-hybridconnectivity/_meta.json | 6 - .../_metadata.json | 11 + .../azure-mgmt-hybridconnectivity/api.md | 2676 +++++++++++++++++ .../api.metadata.yml | 3 + .../apiview-properties.json | 113 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/hybridconnectivity/_client.py | 51 +- .../mgmt/hybridconnectivity/_configuration.py | 16 +- .../azure/mgmt/hybridconnectivity/_patch.py | 12 +- .../hybridconnectivity/_utils/__init__.py | 6 + .../{_model_base.py => _utils/model_base.py} | 824 ++++- .../serialization.py} | 213 +- .../mgmt/hybridconnectivity/_validation.py | 66 + .../azure/mgmt/hybridconnectivity/_version.py | 2 +- .../mgmt/hybridconnectivity/aio/_client.py | 53 +- .../hybridconnectivity/aio/_configuration.py | 16 +- .../mgmt/hybridconnectivity/aio/_patch.py | 12 +- .../aio/operations/__init__.py | 2 + .../aio/operations/_operations.py | 775 +++-- .../aio/operations/_patch.py | 12 +- .../hybridconnectivity/models/__init__.py | 18 + .../mgmt/hybridconnectivity/models/_enums.py | 30 +- .../mgmt/hybridconnectivity/models/_models.py | 451 ++- .../mgmt/hybridconnectivity/models/_patch.py | 12 +- .../hybridconnectivity/operations/__init__.py | 2 + .../operations/_operations.py | 915 ++++-- .../hybridconnectivity/operations/_patch.py | 12 +- .../azure/mgmt/hybridconnectivity/types.py | 694 +++++ ...oints_create_or_update_maximum_set_gen.py} | 6 +- ...oints_create_or_update_minimum_set_gen.py} | 21 +- .../endpoints_delete_maximum_set_gen.py | 42 + ...py => endpoints_delete_minimum_set_gen.py} | 6 +- ...om.py => endpoints_get_maximum_set_gen.py} | 6 +- ...lt.py => endpoints_get_minimum_set_gen.py} | 6 +- ...oints_list_credentials_maximum_set_gen.py} | 9 +- ...oints_list_credentials_minimum_set_gen.py} | 6 +- ...ess_gateway_credentials_maximum_set_gen.py | 43 + ...ess_gateway_credentials_minimum_set_gen.py | 43 + ..._managed_proxy_details_maximum_set_gen.py} | 8 +- ...t_managed_proxy_details_minimum_set_gen.py | 44 + ...t.py => endpoints_list_maximum_set_gen.py} | 4 +- ...s_post_list_ingress_gateway_credentials.py | 43 - .../endpoints_update_maximum_set_gen.py | 49 + .../endpoints_update_minimum_set_gen.py | 57 + ...rate_aws_template_post_maximum_set_gen.py} | 4 +- ...rate_aws_template_post_minimum_set_gen.py} | 9 +- ...erate_gcp_template_post_maximum_set_gen.py | 55 + ...rate_gcp_template_post_minimum_set_gen.py} | 10 +- .../inventory_get_maximum_set_gen.py | 44 + ..._solution_configuration_maximum_set_gen.py | 44 + ....py => operations_list_maximum_set_gen.py} | 4 +- ....py => operations_list_minimum_set_gen.py} | 8 +- ...ctors_create_or_update_maximum_set_gen.py} | 19 +- ...loud_connectors_delete_maximum_set_gen.py} | 8 +- ...c_cloud_connectors_get_maximum_set_gen.py} | 8 +- ...list_by_resource_group_maximum_set_gen.py} | 6 +- ...list_by_resource_group_minimum_set_gen.py} | 9 +- ...s_list_by_subscription_maximum_set_gen.py} | 4 +- ...rs_list_by_subscription_minimum_set_gen.py | 40 + ...ctors_test_permissions_maximum_set_gen.py} | 8 +- ...loud_connectors_update_maximum_set_gen.py} | 8 +- ...ations_create_orupdate_maximum_set_gen.py} | 18 +- ..._configurations_delete_maximum_set_gen.py} | 10 +- ...e_configurations_delete_minimum_set_gen.py | 43 + ...ice_configurations_get_maximum_set_gen.py} | 10 +- .../service_configurations_get_wac.py | 44 - ...t_by_endpoint_resource_maximum_set_gen.py} | 8 +- .../service_configurations_put_wac.py | 45 - ..._configurations_update_maximum_set_gen.py} | 10 +- ...olution_configurations_create_or_update.py | 43 - ...ations_create_or_update_maximum_set_gen.py | 50 + .../solution_configurations_delete.py | 41 - ...n_configurations_delete_maximum_set_gen.py | 42 + ...tion_configurations_get_maximum_set_gen.py | 43 + ...ion_configurations_list_maximum_set_gen.py | 43 + ...ion_configurations_list_minimum_set_gen.py | 43 + .../solution_configurations_sync_now.py | 42 - ...configurations_sync_now_maximum_set_gen.py | 43 + .../solution_configurations_update.py | 43 - ...n_configurations_update_maximum_set_gen.py | 44 + ... => solution_types_get_maximum_set_gen.py} | 8 +- ...list_by_resource_group_maximum_set_gen.py} | 6 +- ...s_list_by_subscription_maximum_set_gen.py} | 4 +- ...y_mgmt_generate_gcp_template_operations.py | 43 + ..._generate_gcp_template_operations_async.py | 44 + ...mgmt_public_cloud_connectors_operations.py | 20 +- ...ublic_cloud_connectors_operations_async.py | 20 +- .../pyproject.toml | 82 + .../sdk_packaging.toml | 12 - .../azure-mgmt-hybridconnectivity/setup.py | 83 - .../tsp-location.yaml | 2 +- 95 files changed, 7416 insertions(+), 1368 deletions(-) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_meta.json create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_metadata.json create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.md create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.metadata.yml create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/__init__.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/{_model_base.py => _utils/model_base.py} (56%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/{_serialization.py => _utils/serialization.py} (90%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_validation.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/types.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_put_custom.py => endpoints_create_or_update_maximum_set_gen.py} (91%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_put_default.py => endpoints_create_or_update_minimum_set_gen.py} (68%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_maximum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_delete_default.py => endpoints_delete_minimum_set_gen.py} (90%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_get_custom.py => endpoints_get_maximum_set_gen.py} (90%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_get_default.py => endpoints_get_minimum_set_gen.py} (90%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_patch_default.py => endpoints_list_credentials_maximum_set_gen.py} (86%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_post_list_credentials.py => endpoints_list_credentials_minimum_set_gen.py} (89%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_post_list_managed_proxy_details.py => endpoints_list_managed_proxy_details_maximum_set_gen.py} (84%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{endpoints_list.py => endpoints_list_maximum_set_gen.py} (93%) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_ingress_gateway_credentials.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{generate_aws_template_post.py => generate_aws_template_post_maximum_set_gen.py} (91%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_configurations_get.py => generate_aws_template_post_minimum_set_gen.py} (83%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_maximum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{inventory_get.py => generate_gcp_template_post_minimum_set_gen.py} (82%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration_maximum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{operations_list.py => operations_list_maximum_set_gen.py} (92%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_configurations_list.py => operations_list_minimum_set_gen.py} (86%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_create_or_update.py => public_cloud_connectors_create_or_update_maximum_set_gen.py} (67%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_delete.py => public_cloud_connectors_delete_maximum_set_gen.py} (84%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_get.py => public_cloud_connectors_get_maximum_set_gen.py} (85%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_list_by_resource_group.py => public_cloud_connectors_list_by_resource_group_maximum_set_gen.py} (85%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{inventory_list_by_solution_configuration.py => public_cloud_connectors_list_by_resource_group_minimum_set_gen.py} (81%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_list_by_subscription.py => public_cloud_connectors_list_by_subscription_maximum_set_gen.py} (88%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_test_permissions.py => public_cloud_connectors_test_permissions_maximum_set_gen.py} (84%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{public_cloud_connectors_update.py => public_cloud_connectors_update_maximum_set_gen.py} (86%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_put_ssh.py => service_configurations_create_orupdate_maximum_set_gen.py} (71%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_delete_ssh.py => service_configurations_delete_maximum_set_gen.py} (84%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_minimum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_get_ssh.py => service_configurations_get_maximum_set_gen.py} (84%) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_wac.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_list.py => service_configurations_list_by_endpoint_resource_maximum_set_gen.py} (86%) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_wac.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{service_configurations_patch_ssh.py => service_configurations_update_maximum_set_gen.py} (85%) delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update_maximum_set_gen.py delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_maximum_set_gen.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_minimum_set_gen.py delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now_maximum_set_gen.py delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update_maximum_set_gen.py rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_types_get.py => solution_types_get_maximum_set_gen.py} (85%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_types_list_by_resource_group.py => solution_types_list_by_resource_group_maximum_set_gen.py} (86%) rename sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/{solution_types_list_by_subscription.py => solution_types_list_by_subscription_maximum_set_gen.py} (89%) create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations.py create mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations_async.py delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/sdk_packaging.toml delete mode 100644 sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/setup.py diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/CHANGELOG.md b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/CHANGELOG.md index 564f71ffd601..b04775ccedb1 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/CHANGELOG.md +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/CHANGELOG.md @@ -1,5 +1,97 @@ # Release History +## 2.0.0 (2026-08-21) + +### Features Added + + - Client `HybridConnectivityMgmtClient` added parameter `cloud_setting` in method `__init__` + - Client `HybridConnectivityMgmtClient` added parameter `polling_interval` in method `__init__` + - Client `HybridConnectivityMgmtClient` added method `send_request` + - Client `HybridConnectivityMgmtClient` added operation group `generate_aws_template` + - Client `HybridConnectivityMgmtClient` added operation group `generate_gcp_template` + - Client `HybridConnectivityMgmtClient` added operation group `inventory` + - Client `HybridConnectivityMgmtClient` added operation group `public_cloud_connectors` + - Client `HybridConnectivityMgmtClient` added operation group `solution_configurations` + - Client `HybridConnectivityMgmtClient` added operation group `solution_types` + - Model `ServiceConfigurationResource` added property `properties` + - Added model `AADProfileProperties` + - Added model `AwsCloudProfile` + - Added model `AwsCloudProfileUpdate` + - Added enum `CloudNativeType` + - Added model `ExtensionResource` + - Added model `GcpCloudProfile` + - Added model `GcpCloudProfileUpdate` + - Added model `GcpOrganizationProperties` + - Added model `GcpOrganizationPropertiesUpdate` + - Added model `GcpProjectProperties` + - Added enum `GcpTemplateFormat` + - Added model `GenerateAwsTemplateRequest` + - Added model `GenerateAwsTemplateResponse` + - Added model `GenerateGcpTemplateRequest` + - Added model `GenerateGcpTemplateResponse` + - Added enum `HostType` + - Added model `IngressProfileProperties` + - Added model `InventoryProperties` + - Added model `InventoryResource` + - Added model `OperationStatusResult` + - Added model `PublicCloudConnector` + - Added model `PublicCloudConnectorProperties` + - Added model `PublicCloudConnectorPropertiesUpdate` + - Added model `PublicCloudConnectorUpdate` + - Added model `RelayNamespaceAccessProperties` + - Added enum `ResourceProvisioningState` + - Added model `ServiceConfigurationProperties` + - Added model `ServiceConfigurationPropertiesPatch` + - Added model `SolutionConfiguration` + - Added model `SolutionConfigurationProperties` + - Added model `SolutionConfigurationPropertiesUpdate` + - Added enum `SolutionConfigurationStatus` + - Added model `SolutionConfigurationUpdate` + - Added model `SolutionSettings` + - Added model `SolutionTypeProperties` + - Added model `SolutionTypeResource` + - Added model `SolutionTypeSettings` + - Added model `SolutionTypeSettingsProperties` + - Added model `TrackedResource` + - Added model `TrackedResourceUpdate` + - Added operation group `GenerateAwsTemplateOperations` + - Added operation group `GenerateGcpTemplateOperations` + - Added operation group `InventoryOperations` + - Added operation group `PublicCloudConnectorsOperations` + - Added operation group `SolutionConfigurationsOperations` + - Added operation group `SolutionTypesOperations` + +### Breaking Changes + + - Method `HybridConnectivityMgmtClient.__init__` inserted a `positional_or_keyword` parameter `subscription_id` + - Model `EndpointAccessResource` deleted or renamed its instance variable `access_key` + - Model `EndpointAccessResource` deleted or renamed its instance variable `expires_on` + - Model `EndpointAccessResource` deleted or renamed its instance variable `hybrid_connection_name` + - Model `EndpointAccessResource` deleted or renamed its instance variable `namespace_name` + - Model `EndpointAccessResource` deleted or renamed its instance variable `namespace_name_suffix` + - Model `EndpointAccessResource` deleted or renamed its instance variable `service_configuration_token` + - Model `IngressGatewayResource` deleted or renamed its instance variable `access_key` + - Model `IngressGatewayResource` deleted or renamed its instance variable `expires_on` + - Model `IngressGatewayResource` deleted or renamed its instance variable `hostname` + - Model `IngressGatewayResource` deleted or renamed its instance variable `hybrid_connection_name` + - Model `IngressGatewayResource` deleted or renamed its instance variable `namespace_name` + - Model `IngressGatewayResource` deleted or renamed its instance variable `namespace_name_suffix` + - Model `IngressGatewayResource` deleted or renamed its instance variable `server_id` + - Model `IngressGatewayResource` deleted or renamed its instance variable `service_configuration_token` + - Model `IngressGatewayResource` deleted or renamed its instance variable `tenant_id` + - Model `ServiceConfigurationResource` deleted or renamed its instance variable `port` + - Model `ServiceConfigurationResource` deleted or renamed its instance variable `provisioning_state` + - Model `ServiceConfigurationResource` deleted or renamed its instance variable `resource_id` + - Model `ServiceConfigurationResource` deleted or renamed its instance variable `service_name` + - Model `ServiceConfigurationResourcePatch` deleted or renamed its instance variable `port` + - Deleted or renamed model `EndpointsList` + - Deleted or renamed model `OperationListResult` + - Deleted or renamed model `ServiceConfigurationList` + - Method `EndpointsOperations.list_credentials` parameter `expiresin` changed default value from `10800` to `none` + - Method `EndpointsOperations.list_credentials` changed its parameter `expiresin` from `positional_or_keyword` to `keyword_only` + - Method `EndpointsOperations.list_ingress_gateway_credentials` parameter `expiresin` changed default value from `10800` to `none` + - Method `EndpointsOperations.list_ingress_gateway_credentials` changed its parameter `expiresin` from `positional_or_keyword` to `keyword_only` + ## 2.0.0b1 (2025-04-01) ### Features Added diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/MANIFEST.in b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/MANIFEST.in index 0566f13973fc..46cd474ba840 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/MANIFEST.in +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/MANIFEST.in @@ -1,8 +1,7 @@ -include _meta.json -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/hybridconnectivity/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md index d4fa95905534..c747b61b5618 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Hybridconnectivity Management Client Library. -This package has been tested with Python 3.8+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.8+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_meta.json b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_meta.json deleted file mode 100644 index 4c9201fb5386..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "commit": "3db6867b8e524ea6d1bc7a3bbb989fe50dd2f184", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/hybridconnectivity/HybridConnectivity.Management", - "@azure-tools/typespec-python": "0.41.0" -} \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_metadata.json b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_metadata.json new file mode 100644 index 000000000000..8f7f7896113c --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/_metadata.json @@ -0,0 +1,11 @@ +{ + "apiVersion": "2027-01-01", + "apiVersions": { + "Microsoft.HybridConnectivity": "2027-01-01" + }, + "commit": "47515ad36204e02e14c3b62414beebca92abb4a2", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "typespec_src": "specification/hybridconnectivity/HybridConnectivity.Management", + "emitterVersion": "0.63.5", + "httpClientPythonVersion": "^0.36.0" +} \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.md b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.md new file mode 100644 index 000000000000..a4c3e5505cca --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.md @@ -0,0 +1,2676 @@ +```py +namespace azure.mgmt.hybridconnectivity + + class azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient: implements ContextManager + endpoints: EndpointsOperations + generate_aws_template: GenerateAwsTemplateOperations + generate_gcp_template: GenerateGcpTemplateOperations + inventory: InventoryOperations + operations: Operations + public_cloud_connectors: PublicCloudConnectorsOperations + service_configurations: ServiceConfigurationsOperations + solution_configurations: SolutionConfigurationsOperations + solution_types: SolutionTypesOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.hybridconnectivity.aio + + class azure.mgmt.hybridconnectivity.aio.HybridConnectivityMgmtClient: implements AsyncContextManager + endpoints: EndpointsOperations + generate_aws_template: GenerateAwsTemplateOperations + generate_gcp_template: GenerateGcpTemplateOperations + inventory: InventoryOperations + operations: Operations + public_cloud_connectors: PublicCloudConnectorsOperations + service_configurations: ServiceConfigurationsOperations + solution_configurations: SolutionConfigurationsOperations + solution_types: SolutionTypesOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.hybridconnectivity.aio.operations + + class azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @distributed_trace_async + async def delete( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> EndpointResource: ... + + @distributed_trace + def list( + self, + resource_uri: str, + **kwargs: Any + ) -> AsyncItemPaged[EndpointResource]: ... + + @overload + async def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[ListCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + async def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[ListCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + async def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + async def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[ListIngressGatewayCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + async def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[ListIngressGatewayCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + async def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + async def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: ManagedProxyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + async def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: ManagedProxyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + async def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.GenerateAwsTemplateOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def post( + self, + generate_aws_template_request: GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + @overload + async def post( + self, + generate_aws_template_request: GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + @overload + async def post( + self, + generate_aws_template_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.GenerateGcpTemplateOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def post( + self, + generate_gcp_template_request: GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + @overload + async def post( + self, + generate_gcp_template_request: GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + @overload + async def post( + self, + generate_gcp_template_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.InventoryOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_uri: str, + solution_configuration: str, + inventory_id: str, + **kwargs: Any + ) -> InventoryResource: ... + + @distributed_trace + def list_by_solution_configuration( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> AsyncItemPaged[InventoryResource]: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: PublicCloudConnector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PublicCloudConnector]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: PublicCloudConnector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PublicCloudConnector]: ... + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[PublicCloudConnector]: ... + + @distributed_trace_async + async def begin_test_permissions( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> AsyncLROPoller[OperationStatusResult]: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> PublicCloudConnector: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[PublicCloudConnector]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[PublicCloudConnector]: ... + + @overload + async def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: PublicCloudConnectorUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + @overload + async def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: PublicCloudConnectorUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + @overload + async def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + async def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + async def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @distributed_trace_async + async def delete( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @distributed_trace + def list_by_endpoint_resource( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> AsyncItemPaged[ServiceConfigurationResource]: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResourcePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResourcePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + async def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def begin_sync_now( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> AsyncLROPoller[OperationStatusResult]: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: SolutionConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: SolutionConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + async def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @distributed_trace_async + async def delete( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> SolutionConfiguration: ... + + @distributed_trace + def list( + self, + resource_uri: str, + **kwargs: Any + ) -> AsyncItemPaged[SolutionConfiguration]: ... + + @overload + async def update( + self, + resource_uri: str, + solution_configuration: str, + properties: SolutionConfigurationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + async def update( + self, + resource_uri: str, + solution_configuration: str, + properties: SolutionConfigurationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + async def update( + self, + resource_uri: str, + solution_configuration: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + + class azure.mgmt.hybridconnectivity.aio.operations.SolutionTypesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + solution_type: str, + **kwargs: Any + ) -> SolutionTypeResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SolutionTypeResource]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[SolutionTypeResource]: ... + + +namespace azure.mgmt.hybridconnectivity.models + + class azure.mgmt.hybridconnectivity.models.AADProfileProperties(_Model): + server_id: str + tenant_id: str + + @overload + def __init__( + self, + *, + server_id: str, + tenant_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.hybridconnectivity.models.AwsCloudProfile(_Model): + account_id: str + excluded_accounts: Optional[list[str]] + is_organizational_account: Optional[bool] + + @overload + def __init__( + self, + *, + account_id: str, + excluded_accounts: Optional[list[str]] = ..., + is_organizational_account: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.AwsCloudProfileUpdate(_Model): + excluded_accounts: Optional[list[str]] + + @overload + def __init__( + self, + *, + excluded_accounts: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.CloudNativeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EC2 = "ec2" + + + class azure.mgmt.hybridconnectivity.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.hybridconnectivity.models.EndpointAccessResource(_Model): + relay: Optional[RelayNamespaceAccessProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + relay: Optional[RelayNamespaceAccessProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.EndpointProperties(_Model): + provisioning_state: Optional[str] + resource_id: Optional[str] + type: Union[str, Type] + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = ..., + type: Union[str, Type] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.EndpointResource(ExtensionResource): + id: str + name: str + properties: Optional[EndpointProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[EndpointProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.hybridconnectivity.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.hybridconnectivity.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ExtensionResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.models.GcpCloudProfile(_Model): + organization_properties: Optional[GcpOrganizationProperties] + project_properties: Optional[GcpProjectProperties] + + @overload + def __init__( + self, + *, + organization_properties: Optional[GcpOrganizationProperties] = ..., + project_properties: Optional[GcpProjectProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpCloudProfileUpdate(_Model): + organization_properties: Optional[GcpOrganizationPropertiesUpdate] + + @overload + def __init__( + self, + *, + organization_properties: Optional[GcpOrganizationPropertiesUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpOrganizationProperties(_Model): + excluded_folder_ids: Optional[list[str]] + excluded_project_numbers: Optional[list[str]] + management_project_id: str + management_project_number: str + organization_id: str + + @overload + def __init__( + self, + *, + excluded_folder_ids: Optional[list[str]] = ..., + excluded_project_numbers: Optional[list[str]] = ..., + management_project_id: str, + management_project_number: str, + organization_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpOrganizationPropertiesUpdate(_Model): + excluded_folder_ids: Optional[list[str]] + excluded_project_numbers: Optional[list[str]] + + @overload + def __init__( + self, + *, + excluded_folder_ids: Optional[list[str]] = ..., + excluded_project_numbers: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpProjectProperties(_Model): + project_id: str + project_number: str + + @overload + def __init__( + self, + *, + project_id: str, + project_number: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GcpTemplateFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SHELL_SCRIPT = "shellscript" + TERRAFORM = "terraform" + + + class azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest(_Model): + connector_id: str + solution_types: Optional[list[SolutionTypeSettings]] + + @overload + def __init__( + self, + *, + connector_id: str, + solution_types: Optional[list[SolutionTypeSettings]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse(_Model): + + + class azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest(_Model): + connector_id: str + gcp_cloud_profile: Optional[GcpCloudProfile] + gcp_template_format: Optional[Union[str, GcpTemplateFormat]] + solution_types: Optional[list[SolutionTypeSettings]] + + @overload + def __init__( + self, + *, + connector_id: str, + gcp_cloud_profile: Optional[GcpCloudProfile] = ..., + gcp_template_format: Optional[Union[str, GcpTemplateFormat]] = ..., + solution_types: Optional[list[SolutionTypeSettings]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse(_Model): + + + class azure.mgmt.hybridconnectivity.models.HostType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AWS = "AWS" + GCP = "GCP" + + + class azure.mgmt.hybridconnectivity.models.IngressGatewayResource(_Model): + ingress: Optional[IngressProfileProperties] + relay: Optional[RelayNamespaceAccessProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + ingress: Optional[IngressProfileProperties] = ..., + relay: Optional[RelayNamespaceAccessProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.IngressProfileProperties(_Model): + aad_profile: AADProfileProperties + hostname: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + aad_profile: AADProfileProperties, + hostname: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.InventoryProperties(_Model): + azure_resource_id: Optional[str] + cloud_native_resource_id: Optional[str] + cloud_native_type: Optional[Union[str, CloudNativeType]] + provisioning_state: Optional[Union[str, ResourceProvisioningState]] + status: Optional[Union[str, SolutionConfigurationStatus]] + status_details: Optional[str] + + @overload + def __init__( + self, + *, + azure_resource_id: Optional[str] = ..., + cloud_native_resource_id: Optional[str] = ..., + cloud_native_type: Optional[Union[str, CloudNativeType]] = ..., + status: Optional[Union[str, SolutionConfigurationStatus]] = ..., + status_details: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.InventoryResource(ProxyResource): + id: str + name: str + properties: Optional[InventoryProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[InventoryProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ListCredentialsRequest(_Model): + service_name: Optional[Union[str, ServiceName]] + + @overload + def __init__( + self, + *, + service_name: Optional[Union[str, ServiceName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest(_Model): + service_name: Optional[Union[str, ServiceName]] + + @overload + def __init__( + self, + *, + service_name: Optional[Union[str, ServiceName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ManagedProxyRequest(_Model): + hostname: Optional[str] + service: str + service_name: Optional[Union[str, ServiceName]] + + @overload + def __init__( + self, + *, + hostname: Optional[str] = ..., + service: str, + service_name: Optional[Union[str, ServiceName]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ManagedProxyResource(_Model): + expires_on: int + proxy: str + + @overload + def __init__( + self, + *, + expires_on: int, + proxy: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.hybridconnectivity.models.OperationStatusResult(_Model): + end_time: Optional[datetime] + error: Optional[ErrorDetail] + id: Optional[str] + name: Optional[str] + operations: Optional[list[OperationStatusResult]] + percent_complete: Optional[float] + resource_id: Optional[str] + start_time: Optional[datetime] + status: str + + @overload + def __init__( + self, + *, + end_time: Optional[datetime] = ..., + error: Optional[ErrorDetail] = ..., + id: Optional[str] = ..., + name: Optional[str] = ..., + operations: Optional[list[OperationStatusResult]] = ..., + percent_complete: Optional[float] = ..., + start_time: Optional[datetime] = ..., + status: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.hybridconnectivity.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + CREATING = "Creating" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + + + class azure.mgmt.hybridconnectivity.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.models.PublicCloudConnector(TrackedResource): + id: str + kind: Optional[Union[str, HostType]] + location: str + name: str + properties: Optional[PublicCloudConnectorProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[PublicCloudConnectorProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.PublicCloudConnectorProperties(_Model): + aws_cloud_profile: Optional[AwsCloudProfile] + connector_primary_identifier: Optional[str] + gcp_cloud_profile: Optional[GcpCloudProfile] + host_type: Union[str, HostType] + provisioning_state: Optional[Union[str, ResourceProvisioningState]] + + @overload + def __init__( + self, + *, + aws_cloud_profile: Optional[AwsCloudProfile] = ..., + gcp_cloud_profile: Optional[GcpCloudProfile] = ..., + host_type: Union[str, HostType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.PublicCloudConnectorPropertiesUpdate(_Model): + aws_cloud_profile: Optional[AwsCloudProfileUpdate] + gcp_cloud_profile: Optional[GcpCloudProfileUpdate] + + @overload + def __init__( + self, + *, + aws_cloud_profile: Optional[AwsCloudProfileUpdate] = ..., + gcp_cloud_profile: Optional[GcpCloudProfileUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate(TrackedResourceUpdate): + id: str + name: str + properties: Optional[PublicCloudConnectorPropertiesUpdate] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + properties: Optional[PublicCloudConnectorPropertiesUpdate] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.RelayNamespaceAccessProperties(_Model): + access_key: Optional[str] + expires_on: Optional[int] + hybrid_connection_name: str + namespace_name: str + namespace_name_suffix: str + service_configuration_token: Optional[str] + + @overload + def __init__( + self, + *, + expires_on: Optional[int] = ..., + hybrid_connection_name: str, + namespace_name: str, + namespace_name_suffix: str, + service_configuration_token: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.hybridconnectivity.models.ResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CANCELED = "Canceled" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.hybridconnectivity.models.ServiceConfigurationProperties(_Model): + port: Optional[int] + provisioning_state: Optional[Union[str, ProvisioningState]] + resource_id: Optional[str] + service_name: Union[str, ServiceName] + + @overload + def __init__( + self, + *, + port: Optional[int] = ..., + resource_id: Optional[str] = ..., + service_name: Union[str, ServiceName] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ServiceConfigurationPropertiesPatch(_Model): + port: Optional[int] + + @overload + def __init__( + self, + *, + port: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource(ExtensionResource): + id: str + name: str + properties: Optional[ServiceConfigurationProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ServiceConfigurationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch(_Model): + properties: Optional[ServiceConfigurationPropertiesPatch] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[ServiceConfigurationPropertiesPatch] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.ServiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SSH = "SSH" + WAC = "WAC" + + + class azure.mgmt.hybridconnectivity.models.SolutionConfiguration(ExtensionResource): + id: str + name: str + properties: Optional[SolutionConfigurationProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SolutionConfigurationProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionConfigurationProperties(_Model): + last_sync_time: Optional[datetime] + provisioning_state: Optional[Union[str, ResourceProvisioningState]] + solution_settings: Optional[SolutionSettings] + solution_type: str + status: Optional[Union[str, SolutionConfigurationStatus]] + status_details: Optional[str] + + @overload + def __init__( + self, + *, + solution_settings: Optional[SolutionSettings] = ..., + solution_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionConfigurationPropertiesUpdate(_Model): + solution_settings: Optional[SolutionSettings] + solution_type: Optional[str] + + @overload + def __init__( + self, + *, + solution_settings: Optional[SolutionSettings] = ..., + solution_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COMPLETED = "Completed" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + NEW = "New" + + + class azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate(ProxyResource): + id: str + name: str + properties: Optional[SolutionConfigurationPropertiesUpdate] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SolutionConfigurationPropertiesUpdate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionSettings(_Model): + + + class azure.mgmt.hybridconnectivity.models.SolutionTypeProperties(_Model): + description: Optional[str] + host_types: Optional[list[Union[str, HostType]]] + solution_settings: Optional[list[SolutionTypeSettingsProperties]] + solution_type: Optional[str] + supported_azure_regions: Optional[list[str]] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + host_types: Optional[list[Union[str, HostType]]] = ..., + solution_settings: Optional[list[SolutionTypeSettingsProperties]] = ..., + solution_type: Optional[str] = ..., + supported_azure_regions: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionTypeResource(ProxyResource): + id: str + name: str + properties: Optional[SolutionTypeProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SolutionTypeProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionTypeSettings(_Model): + solution_settings: Optional[SolutionSettings] + solution_type: str + + @overload + def __init__( + self, + *, + solution_settings: Optional[SolutionSettings] = ..., + solution_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SolutionTypeSettingsProperties(_Model): + allowed_values: list[str] + default_value: str + description: str + display_name: str + host_types: list[Union[str, HostType]] + name: str + type: str + + @overload + def __init__( + self, + *, + allowed_values: list[str], + default_value: str, + description: str, + display_name: str, + host_types: list[Union[str, HostType]], + name: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.TrackedResourceUpdate(Resource): + id: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.hybridconnectivity.models.Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CUSTOM = "custom" + DEFAULT = "default" + + +namespace azure.mgmt.hybridconnectivity.operations + + class azure.mgmt.hybridconnectivity.operations.EndpointsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + def create_or_update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @distributed_trace + def delete( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> EndpointResource: ... + + @distributed_trace + def list( + self, + resource_uri: str, + **kwargs: Any + ) -> ItemPaged[EndpointResource]: ... + + @overload + def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[ListCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[ListCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + def list_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_credentials_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> EndpointAccessResource: ... + + @overload + def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[ListIngressGatewayCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[ListIngressGatewayCredentialsRequest] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + def list_ingress_gateway_credentials( + self, + resource_uri: str, + endpoint_name: str, + list_ingress_gateway_credentials_request: Optional[IO[bytes]] = None, + *, + content_type: str = "application/json", + expiresin: Optional[int] = ..., + **kwargs: Any + ) -> IngressGatewayResource: ... + + @overload + def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: ManagedProxyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: ManagedProxyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + def list_managed_proxy_details( + self, + resource_uri: str, + endpoint_name: str, + managed_proxy_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ManagedProxyResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: EndpointResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + endpoint_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> EndpointResource: ... + + + class azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def post( + self, + generate_aws_template_request: GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + @overload + def post( + self, + generate_aws_template_request: GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + @overload + def post( + self, + generate_aws_template_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateAwsTemplateResponse: ... + + + class azure.mgmt.hybridconnectivity.operations.GenerateGcpTemplateOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def post( + self, + generate_gcp_template_request: GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + @overload + def post( + self, + generate_gcp_template_request: GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + @overload + def post( + self, + generate_gcp_template_request: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> GenerateGcpTemplateResponse: ... + + + class azure.mgmt.hybridconnectivity.operations.InventoryOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_uri: str, + solution_configuration: str, + inventory_id: str, + **kwargs: Any + ) -> InventoryResource: ... + + @distributed_trace + def list_by_solution_configuration( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> ItemPaged[InventoryResource]: ... + + + class azure.mgmt.hybridconnectivity.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: PublicCloudConnector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PublicCloudConnector]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: PublicCloudConnector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PublicCloudConnector]: ... + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + public_cloud_connector: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[PublicCloudConnector]: ... + + @distributed_trace + def begin_test_permissions( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> LROPoller[OperationStatusResult]: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + public_cloud_connector: str, + **kwargs: Any + ) -> PublicCloudConnector: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[PublicCloudConnector]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[PublicCloudConnector]: ... + + @overload + def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: PublicCloudConnectorUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + @overload + def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: PublicCloudConnectorUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + @overload + def update( + self, + resource_group_name: str, + public_cloud_connector: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> PublicCloudConnector: ... + + + class azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + def create_orupdate( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @distributed_trace + def delete( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @distributed_trace + def list_by_endpoint_resource( + self, + resource_uri: str, + endpoint_name: str, + **kwargs: Any + ) -> ItemPaged[ServiceConfigurationResource]: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResourcePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: ServiceConfigurationResourcePatch, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + @overload + def update( + self, + resource_uri: str, + endpoint_name: str, + service_configuration_name: str, + service_configuration_resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> ServiceConfigurationResource: ... + + + class azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def begin_sync_now( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> LROPoller[OperationStatusResult]: ... + + @overload + def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: SolutionConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: SolutionConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + def create_or_update( + self, + resource_uri: str, + solution_configuration: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @distributed_trace + def delete( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_uri: str, + solution_configuration: str, + **kwargs: Any + ) -> SolutionConfiguration: ... + + @distributed_trace + def list( + self, + resource_uri: str, + **kwargs: Any + ) -> ItemPaged[SolutionConfiguration]: ... + + @overload + def update( + self, + resource_uri: str, + solution_configuration: str, + properties: SolutionConfigurationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + def update( + self, + resource_uri: str, + solution_configuration: str, + properties: SolutionConfigurationUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + @overload + def update( + self, + resource_uri: str, + solution_configuration: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SolutionConfiguration: ... + + + class azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + solution_type: str, + **kwargs: Any + ) -> SolutionTypeResource: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[SolutionTypeResource]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[SolutionTypeResource]: ... + + +namespace azure.mgmt.hybridconnectivity.types + + class azure.mgmt.hybridconnectivity.types.AwsCloudProfile(TypedDict, total=False): + key "accountId": Required[str] + key "isOrganizationalAccount": bool + accountId: str + excludedAccounts: list[str] + isOrganizationalAccount: bool + + + class azure.mgmt.hybridconnectivity.types.AwsCloudProfileUpdate(TypedDict, total=False): + excludedAccounts: list[str] + + + class azure.mgmt.hybridconnectivity.types.EndpointProperties(TypedDict, total=False): + key "provisioningState": str + key "resourceId": str + key "type": Required[Union[str, Type]] + provisioningState: str + resourceId: str + type: Union[str, Type] + + + class azure.mgmt.hybridconnectivity.types.EndpointResource(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('EndpointProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: EndpointProperties + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.ExtensionResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.GcpCloudProfile(TypedDict, total=False): + key "organizationProperties": ForwardRef('GcpOrganizationProperties', module='types') + key "projectProperties": ForwardRef('GcpProjectProperties', module='types') + organizationProperties: GcpOrganizationProperties + projectProperties: GcpProjectProperties + + + class azure.mgmt.hybridconnectivity.types.GcpCloudProfileUpdate(TypedDict, total=False): + key "organizationProperties": ForwardRef('GcpOrganizationPropertiesUpdate', module='types') + organizationProperties: GcpOrganizationPropertiesUpdate + + + class azure.mgmt.hybridconnectivity.types.GcpOrganizationProperties(TypedDict, total=False): + key "managementProjectId": Required[str] + key "managementProjectNumber": Required[str] + key "organizationId": Required[str] + excludedFolderIds: list[str] + excludedProjectNumbers: list[str] + managementProjectId: str + managementProjectNumber: str + organizationId: str + + + class azure.mgmt.hybridconnectivity.types.GcpOrganizationPropertiesUpdate(TypedDict, total=False): + excludedFolderIds: list[str] + excludedProjectNumbers: list[str] + + + class azure.mgmt.hybridconnectivity.types.GcpProjectProperties(TypedDict, total=False): + key "projectId": Required[str] + key "projectNumber": Required[str] + projectId: str + projectNumber: str + + + class azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest(TypedDict, total=False): + key "connectorId": Required[str] + connectorId: str + solutionTypes: list[SolutionTypeSettings] + + + class azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest(TypedDict, total=False): + key "connectorId": Required[str] + key "gcpCloudProfile": ForwardRef('GcpCloudProfile', module='types') + key "gcpTemplateFormat": Union[str, GcpTemplateFormat] + connectorId: str + gcpCloudProfile: GcpCloudProfile + gcpTemplateFormat: Union[str, GcpTemplateFormat] + solutionTypes: list[SolutionTypeSettings] + + + class azure.mgmt.hybridconnectivity.types.ListCredentialsRequest(TypedDict, total=False): + key "serviceName": Union[str, ServiceName] + serviceName: Union[str, ServiceName] + + + class azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest(TypedDict, total=False): + key "serviceName": Union[str, ServiceName] + serviceName: Union[str, ServiceName] + + + class azure.mgmt.hybridconnectivity.types.ManagedProxyRequest(TypedDict, total=False): + key "hostname": str + key "service": Required[str] + key "serviceName": Union[str, ServiceName] + hostname: str + service: str + serviceName: Union[str, ServiceName] + + + class azure.mgmt.hybridconnectivity.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.PublicCloudConnector(TrackedResource): + key "id": str + key "kind": Union[str, HostType] + key "location": Required[str] + key "name": str + key "properties": ForwardRef('PublicCloudConnectorProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + kind: Union[str, HostType] + location: str + name: str + properties: PublicCloudConnectorProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.hybridconnectivity.types.PublicCloudConnectorProperties(TypedDict, total=False): + key "awsCloudProfile": ForwardRef('AwsCloudProfile', module='types') + key "connectorPrimaryIdentifier": str + key "gcpCloudProfile": ForwardRef('GcpCloudProfile', module='types') + key "hostType": Required[Union[str, HostType]] + key "provisioningState": Union[str, ResourceProvisioningState] + awsCloudProfile: AwsCloudProfile + connectorPrimaryIdentifier: str + gcpCloudProfile: GcpCloudProfile + hostType: Union[str, HostType] + provisioningState: Union[str, ResourceProvisioningState] + + + class azure.mgmt.hybridconnectivity.types.PublicCloudConnectorPropertiesUpdate(TypedDict, total=False): + key "awsCloudProfile": ForwardRef('AwsCloudProfileUpdate', module='types') + key "gcpCloudProfile": ForwardRef('GcpCloudProfileUpdate', module='types') + awsCloudProfile: AwsCloudProfileUpdate + gcpCloudProfile: GcpCloudProfileUpdate + + + class azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate(TrackedResourceUpdate): + key "id": str + key "name": str + key "properties": ForwardRef('PublicCloudConnectorPropertiesUpdate', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: PublicCloudConnectorPropertiesUpdate + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.hybridconnectivity.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.ServiceConfigurationProperties(TypedDict, total=False): + key "port": int + key "provisioningState": Union[str, ProvisioningState] + key "resourceId": str + key "serviceName": Required[Union[str, ServiceName]] + port: int + provisioningState: Union[str, ProvisioningState] + resourceId: str + serviceName: Union[str, ServiceName] + + + class azure.mgmt.hybridconnectivity.types.ServiceConfigurationPropertiesPatch(TypedDict, total=False): + key "port": int + port: int + + + class azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('ServiceConfigurationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: ServiceConfigurationProperties + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch(TypedDict, total=False): + key "properties": ForwardRef('ServiceConfigurationPropertiesPatch', module='types') + properties: ServiceConfigurationPropertiesPatch + + + class azure.mgmt.hybridconnectivity.types.SolutionConfiguration(ExtensionResource): + key "id": str + key "name": str + key "properties": ForwardRef('SolutionConfigurationProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: SolutionConfigurationProperties + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.SolutionConfigurationProperties(TypedDict, total=False): + key "lastSyncTime": str + key "provisioningState": Union[str, ResourceProvisioningState] + key "solutionSettings": ForwardRef('SolutionSettings', module='types') + key "solutionType": Required[str] + key "status": Union[str, SolutionConfigurationStatus] + key "statusDetails": str + lastSyncTime: str + provisioningState: Union[str, ResourceProvisioningState] + solutionSettings: SolutionSettings + solutionType: str + status: Union[str, SolutionConfigurationStatus] + statusDetails: str + + + class azure.mgmt.hybridconnectivity.types.SolutionConfigurationPropertiesUpdate(TypedDict, total=False): + key "solutionSettings": ForwardRef('SolutionSettings', module='types') + key "solutionType": str + solutionSettings: SolutionSettings + solutionType: str + + + class azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('SolutionConfigurationPropertiesUpdate', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: SolutionConfigurationPropertiesUpdate + systemData: SystemData + type: str + + + class azure.mgmt.hybridconnectivity.types.SolutionSettings(TypedDict, total=False): + + + class azure.mgmt.hybridconnectivity.types.SolutionTypeSettings(TypedDict, total=False): + key "solutionSettings": ForwardRef('SolutionSettings', module='types') + key "solutionType": Required[str] + solutionSettings: SolutionSettings + solutionType: str + + + class azure.mgmt.hybridconnectivity.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.hybridconnectivity.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.hybridconnectivity.types.TrackedResourceUpdate(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + +``` \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.metadata.yml b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.metadata.yml new file mode 100644 index 000000000000..25ff1dba12ee --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 7dfe49671bef44128b7d80b2c254bea5f44a4c87b9bbeadd9cad045e5024cd5e +parserVersion: 0.3.31 +pythonVersion: 3.13.15 diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/apiview-properties.json b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/apiview-properties.json index 09df4dd2b8b9..a94afebd39aa 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/apiview-properties.json +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/apiview-properties.json @@ -12,7 +12,15 @@ "azure.mgmt.hybridconnectivity.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.hybridconnectivity.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.hybridconnectivity.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.hybridconnectivity.models.GcpCloudProfile": "Microsoft.HybridConnectivity.GcpCloudProfile", + "azure.mgmt.hybridconnectivity.models.GcpCloudProfileUpdate": "Microsoft.HybridConnectivity.GcpCloudProfileUpdate", + "azure.mgmt.hybridconnectivity.models.GcpOrganizationProperties": "Microsoft.HybridConnectivity.GcpOrganizationProperties", + "azure.mgmt.hybridconnectivity.models.GcpOrganizationPropertiesUpdate": "Microsoft.HybridConnectivity.GcpOrganizationPropertiesUpdate", + "azure.mgmt.hybridconnectivity.models.GcpProjectProperties": "Microsoft.HybridConnectivity.GcpProjectProperties", "azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest": "Microsoft.HybridConnectivity.GenerateAwsTemplateRequest", + "azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse": "Microsoft.HybridConnectivity.GenerateAwsTemplateResponse", + "azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest": "Microsoft.HybridConnectivity.GenerateGcpTemplateRequest", + "azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse": "Microsoft.HybridConnectivity.GenerateGcpTemplateResponse", "azure.mgmt.hybridconnectivity.models.IngressGatewayResource": "Microsoft.HybridConnectivity.IngressGatewayResource", "azure.mgmt.hybridconnectivity.models.IngressProfileProperties": "Microsoft.HybridConnectivity.IngressProfileProperties", "azure.mgmt.hybridconnectivity.models.InventoryProperties": "Microsoft.HybridConnectivity.InventoryProperties", @@ -52,42 +60,79 @@ "azure.mgmt.hybridconnectivity.models.Type": "Microsoft.HybridConnectivity.Type", "azure.mgmt.hybridconnectivity.models.ServiceName": "Microsoft.HybridConnectivity.ServiceName", "azure.mgmt.hybridconnectivity.models.ProvisioningState": "Microsoft.HybridConnectivity.ProvisioningState", + "azure.mgmt.hybridconnectivity.models.GcpTemplateFormat": "Microsoft.HybridConnectivity.GcpTemplateFormat", "azure.mgmt.hybridconnectivity.models.HostType": "Microsoft.HybridConnectivity.HostType", "azure.mgmt.hybridconnectivity.models.ResourceProvisioningState": "Azure.ResourceManager.ResourceProvisioningState", "azure.mgmt.hybridconnectivity.models.SolutionConfigurationStatus": "Microsoft.HybridConnectivity.SolutionConfigurationStatus", "azure.mgmt.hybridconnectivity.models.CloudNativeType": "Microsoft.HybridConnectivity.CloudNativeType", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.operations.list": "Azure.ResourceManager.Operations.list", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.get": "Microsoft.HybridConnectivity.EndpointResources.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.create_or_update": "Microsoft.HybridConnectivity.EndpointResources.createOrUpdate", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.update": "Microsoft.HybridConnectivity.EndpointResources.update", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.delete": "Microsoft.HybridConnectivity.EndpointResources.delete", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.list": "Microsoft.HybridConnectivity.EndpointResources.list", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.list_credentials": "Microsoft.HybridConnectivity.EndpointResources.listCredentials", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.list_ingress_gateway_credentials": "Microsoft.HybridConnectivity.EndpointResources.listIngressGatewayCredentials", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.endpoints.list_managed_proxy_details": "Microsoft.HybridConnectivity.EndpointResources.listManagedProxyDetails", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.get": "Microsoft.HybridConnectivity.ServiceConfigurationResources.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.create_orupdate": "Microsoft.HybridConnectivity.ServiceConfigurationResources.createOrupdate", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.update": "Microsoft.HybridConnectivity.ServiceConfigurationResources.update", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.delete": "Microsoft.HybridConnectivity.ServiceConfigurationResources.delete", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.service_configurations.list_by_endpoint_resource": "Microsoft.HybridConnectivity.ServiceConfigurationResources.listByEndpointResource", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.generate_aws_template.post": "Microsoft.HybridConnectivity.GenerateAwsTemplate.post", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.get": "Microsoft.HybridConnectivity.PublicCloudConnectors.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.begin_create_or_update": "Microsoft.HybridConnectivity.PublicCloudConnectors.createOrUpdate", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.update": "Microsoft.HybridConnectivity.PublicCloudConnectors.update", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.delete": "Microsoft.HybridConnectivity.PublicCloudConnectors.delete", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.list_by_resource_group": "Microsoft.HybridConnectivity.PublicCloudConnectors.listByResourceGroup", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.list_by_subscription": "Microsoft.HybridConnectivity.PublicCloudConnectors.listBySubscription", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.public_cloud_connectors.begin_test_permissions": "Microsoft.HybridConnectivity.PublicCloudConnectors.testPermissions", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.get": "Microsoft.HybridConnectivity.SolutionConfigurations.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.create_or_update": "Microsoft.HybridConnectivity.SolutionConfigurations.createOrUpdate", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.update": "Microsoft.HybridConnectivity.SolutionConfigurations.update", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.delete": "Microsoft.HybridConnectivity.SolutionConfigurations.delete", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.list": "Microsoft.HybridConnectivity.SolutionConfigurations.list", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_configurations.begin_sync_now": "Microsoft.HybridConnectivity.SolutionConfigurations.syncNow", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.inventory.get": "Microsoft.HybridConnectivity.Inventory.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.inventory.list_by_solution_configuration": "Microsoft.HybridConnectivity.Inventory.listBySolutionConfiguration", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_types.get": "Microsoft.HybridConnectivity.SolutionTypes.get", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_types.list_by_resource_group": "Microsoft.HybridConnectivity.SolutionTypes.listByResourceGroup", - "azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient.solution_types.list_by_subscription": "Microsoft.HybridConnectivity.SolutionTypes.listBySubscription" - } + "azure.mgmt.hybridconnectivity.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.hybridconnectivity.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.get": "Microsoft.HybridConnectivity.EndpointResources.get", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.get": "Microsoft.HybridConnectivity.EndpointResources.get", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.create_or_update": "Microsoft.HybridConnectivity.EndpointResources.createOrUpdate", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.create_or_update": "Microsoft.HybridConnectivity.EndpointResources.createOrUpdate", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.update": "Microsoft.HybridConnectivity.EndpointResources.update", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.update": "Microsoft.HybridConnectivity.EndpointResources.update", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.delete": "Microsoft.HybridConnectivity.EndpointResources.delete", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.delete": "Microsoft.HybridConnectivity.EndpointResources.delete", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.list": "Microsoft.HybridConnectivity.EndpointResources.list", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.list": "Microsoft.HybridConnectivity.EndpointResources.list", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.list_credentials": "Microsoft.HybridConnectivity.EndpointResources.listCredentials", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.list_credentials": "Microsoft.HybridConnectivity.EndpointResources.listCredentials", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.list_ingress_gateway_credentials": "Microsoft.HybridConnectivity.EndpointResources.listIngressGatewayCredentials", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.list_ingress_gateway_credentials": "Microsoft.HybridConnectivity.EndpointResources.listIngressGatewayCredentials", + "azure.mgmt.hybridconnectivity.operations.EndpointsOperations.list_managed_proxy_details": "Microsoft.HybridConnectivity.EndpointResources.listManagedProxyDetails", + "azure.mgmt.hybridconnectivity.aio.operations.EndpointsOperations.list_managed_proxy_details": "Microsoft.HybridConnectivity.EndpointResources.listManagedProxyDetails", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.get": "Microsoft.HybridConnectivity.ServiceConfigurationResources.get", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.get": "Microsoft.HybridConnectivity.ServiceConfigurationResources.get", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.create_orupdate": "Microsoft.HybridConnectivity.ServiceConfigurationResources.createOrupdate", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.create_orupdate": "Microsoft.HybridConnectivity.ServiceConfigurationResources.createOrupdate", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.update": "Microsoft.HybridConnectivity.ServiceConfigurationResources.update", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.update": "Microsoft.HybridConnectivity.ServiceConfigurationResources.update", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.delete": "Microsoft.HybridConnectivity.ServiceConfigurationResources.delete", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.delete": "Microsoft.HybridConnectivity.ServiceConfigurationResources.delete", + "azure.mgmt.hybridconnectivity.operations.ServiceConfigurationsOperations.list_by_endpoint_resource": "Microsoft.HybridConnectivity.ServiceConfigurationResources.listByEndpointResource", + "azure.mgmt.hybridconnectivity.aio.operations.ServiceConfigurationsOperations.list_by_endpoint_resource": "Microsoft.HybridConnectivity.ServiceConfigurationResources.listByEndpointResource", + "azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations.post": "Microsoft.HybridConnectivity.GenerateAwsTemplate.post", + "azure.mgmt.hybridconnectivity.aio.operations.GenerateAwsTemplateOperations.post": "Microsoft.HybridConnectivity.GenerateAwsTemplate.post", + "azure.mgmt.hybridconnectivity.operations.GenerateGcpTemplateOperations.post": "Microsoft.HybridConnectivity.GenerateGcpTemplate.post", + "azure.mgmt.hybridconnectivity.aio.operations.GenerateGcpTemplateOperations.post": "Microsoft.HybridConnectivity.GenerateGcpTemplate.post", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.get": "Microsoft.HybridConnectivity.PublicCloudConnectors.get", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.get": "Microsoft.HybridConnectivity.PublicCloudConnectors.get", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.begin_create_or_update": "Microsoft.HybridConnectivity.PublicCloudConnectors.createOrUpdate", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.begin_create_or_update": "Microsoft.HybridConnectivity.PublicCloudConnectors.createOrUpdate", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.update": "Microsoft.HybridConnectivity.PublicCloudConnectors.update", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.update": "Microsoft.HybridConnectivity.PublicCloudConnectors.update", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.delete": "Microsoft.HybridConnectivity.PublicCloudConnectors.delete", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.delete": "Microsoft.HybridConnectivity.PublicCloudConnectors.delete", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.list_by_resource_group": "Microsoft.HybridConnectivity.PublicCloudConnectors.listByResourceGroup", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.list_by_resource_group": "Microsoft.HybridConnectivity.PublicCloudConnectors.listByResourceGroup", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.list_by_subscription": "Microsoft.HybridConnectivity.PublicCloudConnectors.listBySubscription", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.list_by_subscription": "Microsoft.HybridConnectivity.PublicCloudConnectors.listBySubscription", + "azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations.begin_test_permissions": "Microsoft.HybridConnectivity.PublicCloudConnectors.testPermissions", + "azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations.begin_test_permissions": "Microsoft.HybridConnectivity.PublicCloudConnectors.testPermissions", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.get": "Microsoft.HybridConnectivity.SolutionConfigurations.get", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.get": "Microsoft.HybridConnectivity.SolutionConfigurations.get", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.create_or_update": "Microsoft.HybridConnectivity.SolutionConfigurations.createOrUpdate", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.create_or_update": "Microsoft.HybridConnectivity.SolutionConfigurations.createOrUpdate", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.update": "Microsoft.HybridConnectivity.SolutionConfigurations.update", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.update": "Microsoft.HybridConnectivity.SolutionConfigurations.update", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.delete": "Microsoft.HybridConnectivity.SolutionConfigurations.delete", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.delete": "Microsoft.HybridConnectivity.SolutionConfigurations.delete", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.list": "Microsoft.HybridConnectivity.SolutionConfigurations.list", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.list": "Microsoft.HybridConnectivity.SolutionConfigurations.list", + "azure.mgmt.hybridconnectivity.operations.SolutionConfigurationsOperations.begin_sync_now": "Microsoft.HybridConnectivity.SolutionConfigurations.syncNow", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionConfigurationsOperations.begin_sync_now": "Microsoft.HybridConnectivity.SolutionConfigurations.syncNow", + "azure.mgmt.hybridconnectivity.operations.InventoryOperations.get": "Microsoft.HybridConnectivity.Inventory.get", + "azure.mgmt.hybridconnectivity.aio.operations.InventoryOperations.get": "Microsoft.HybridConnectivity.Inventory.get", + "azure.mgmt.hybridconnectivity.operations.InventoryOperations.list_by_solution_configuration": "Microsoft.HybridConnectivity.Inventory.listBySolutionConfiguration", + "azure.mgmt.hybridconnectivity.aio.operations.InventoryOperations.list_by_solution_configuration": "Microsoft.HybridConnectivity.Inventory.listBySolutionConfiguration", + "azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations.get": "Microsoft.HybridConnectivity.SolutionTypes.get", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionTypesOperations.get": "Microsoft.HybridConnectivity.SolutionTypes.get", + "azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations.list_by_resource_group": "Microsoft.HybridConnectivity.SolutionTypes.listByResourceGroup", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionTypesOperations.list_by_resource_group": "Microsoft.HybridConnectivity.SolutionTypes.listByResourceGroup", + "azure.mgmt.hybridconnectivity.operations.SolutionTypesOperations.list_by_subscription": "Microsoft.HybridConnectivity.SolutionTypes.listBySubscription", + "azure.mgmt.hybridconnectivity.aio.operations.SolutionTypesOperations.list_by_subscription": "Microsoft.HybridConnectivity.SolutionTypes.listBySubscription" + }, + "CrossLanguageVersion": "530cfadbbd11" } \ No newline at end of file diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_client.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_client.py index 2819ae046085..814ef40c9213 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_client.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_client.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,19 +8,22 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, TYPE_CHECKING -from typing_extensions import Self +import sys +from typing import Any, Optional, TYPE_CHECKING, cast from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse +from azure.core.settings import settings from azure.mgmt.core import ARMPipelineClient from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints from ._configuration import HybridConnectivityMgmtClientConfiguration -from ._serialization import Deserializer, Serializer +from ._utils.serialization import Deserializer, Serializer from .operations import ( EndpointsOperations, GenerateAwsTemplateOperations, + GenerateGcpTemplateOperations, InventoryOperations, Operations, PublicCloudConnectorsOperations, @@ -28,11 +32,17 @@ SolutionTypesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attributes +class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """REST API for public clouds. :ivar operations: Operations operations @@ -45,6 +55,9 @@ class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attribu :ivar generate_aws_template: GenerateAwsTemplateOperations operations :vartype generate_aws_template: azure.mgmt.hybridconnectivity.operations.GenerateAwsTemplateOperations + :ivar generate_gcp_template: GenerateGcpTemplateOperations operations + :vartype generate_gcp_template: + azure.mgmt.hybridconnectivity.operations.GenerateGcpTemplateOperations :ivar public_cloud_connectors: PublicCloudConnectorsOperations operations :vartype public_cloud_connectors: azure.mgmt.hybridconnectivity.operations.PublicCloudConnectorsOperations @@ -59,9 +72,13 @@ class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attribu :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-12-01". + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2027-01-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -72,13 +89,26 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = HybridConnectivityMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -97,7 +127,7 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) self._serialize = Serializer() self._deserialize = Deserializer() @@ -110,6 +140,9 @@ def __init__( self.generate_aws_template = GenerateAwsTemplateOperations( self._client, self._config, self._serialize, self._deserialize ) + self.generate_gcp_template = GenerateGcpTemplateOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.public_cloud_connectors = PublicCloudConnectorsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_configuration.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_configuration.py index a83b2c177790..f559a1f21986 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_configuration.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,10 +15,11 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only """Configuration for HybridConnectivityMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -29,7 +31,11 @@ class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-ins :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-12-01". + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2027-01-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,9 +45,10 @@ def __init__( credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-12-01") + api_version: str = kwargs.pop("api_version", "2027-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,6 +58,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-hybridconnectivity/{}".format(VERSION)) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/__init__.py new file mode 100644 index 000000000000..8026245c2abc --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_model_base.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/model_base.py similarity index 56% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_model_base.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/model_base.py index 3072ee252ed9..35d5fc024978 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_model_base.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/model_base.py @@ -1,9 +1,10 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=protected-access, broad-except @@ -21,17 +22,19 @@ from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder import xml.etree.ElementTree as ET -from typing_extensions import Self +from collections.abc import MutableMapping import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping +from azure.core.rest import HttpResponse + +if sys.version_info >= (3, 11): + from typing import Self else: - from typing import MutableMapping + from typing_extensions import Self _LOGGER = logging.getLogger(__name__) @@ -39,6 +42,7 @@ TZ_UTC = timezone.utc _T = typing.TypeVar("_T") +_NONE_TYPE = type(None) def _timedelta_as_isostr(td: timedelta) -> str: @@ -105,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -131,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -173,6 +208,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -204,7 +254,7 @@ def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: test_utc = date_obj.utctimetuple() if test_utc.tm_year > 9999 or test_utc.tm_year < 1: raise OverflowError("Hit max or min date") - return date_obj + return date_obj # type: ignore[no-any-return] def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: @@ -258,7 +308,7 @@ def _deserialize_time(attr: typing.Union[str, time]) -> time: """ if isinstance(attr, time): return attr - return isodate.parse_time(attr) + return isodate.parse_time(attr) # type: ignore[no-any-return] def _deserialize_bytes(attr): @@ -282,6 +332,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -294,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -311,12 +373,20 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -347,17 +417,47 @@ def _get_model(module_name: str, model_name: str): _UNSET = object() -class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: self._data = data def __contains__(self, key: typing.Any) -> bool: return key in self._data def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -374,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -398,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -407,13 +507,13 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: return default @typing.overload - def pop(self, key: str) -> typing.Any: ... + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ @typing.overload - def pop(self, key: str, default: _T) -> _T: ... + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs @typing.overload - def pop(self, key: str, default: typing.Any) -> typing.Any: ... + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ @@ -428,24 +528,24 @@ def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + def popitem(self) -> tuple[str, typing.Any]: """ Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -454,14 +554,15 @@ def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: def setdefault(self, key: str, default: None = None) -> None: ... @typing.overload - def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -469,6 +570,8 @@ def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.setdefault(key, default) def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data try: other_model = self.__class__(other) except Exception: @@ -485,6 +588,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -509,16 +614,14 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: try: return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) except StopIteration: @@ -537,69 +640,253 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: typing.Set[str] = set() + _calculated: set[str] = set() def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -616,8 +903,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -626,7 +1022,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") } annotations = { @@ -641,10 +1037,13 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint: disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: @@ -670,7 +1069,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -680,10 +1079,10 @@ def _deserialize(cls, data, exist_discriminators): discriminator_value = data.find(xml_name).text # pyright: ignore else: discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -743,7 +1142,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -753,7 +1152,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -762,6 +1161,14 @@ def _deserialize_multiple_sequence( return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + def _deserialize_sequence( deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], @@ -771,17 +1178,30 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: return sorted( types, key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), ) -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -821,16 +1241,18 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore ) return functools.partial(_deserialize_with_optional, if_obj_deserializer) # the type is Optional[Union[...]], we need to remove the None type from the Union annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) except AttributeError: pass @@ -846,7 +1268,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -859,7 +1284,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -908,16 +1336,20 @@ def _deserialize_with_callable( return float(value.text) if value.text else None if deserializer is bool: return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None if deserializer is None: return value if deserializer in [int, float, bool]: return deserializer(value) if isinstance(deserializer, CaseInsensitiveEnumMeta): try: - return deserializer(value) + return deserializer(value.text if isinstance(value, ET.Element) else value) except ValueError: # for unknown value, return raw value - return value + return value.text if isinstance(value, ET.Element) else value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) @@ -943,14 +1375,14 @@ def _deserialize( def _failsafe_deserialize( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, module: typing.Optional[str] = None, rf: typing.Optional["_RestField"] = None, format: typing.Optional[str] = None, ) -> typing.Any: try: - return _deserialize(deserializer, value, module, rf, format) - except DeserializationError: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -959,17 +1391,18 @@ def _failsafe_deserialize( def _failsafe_deserialize_xml( deserializer: typing.Any, - value: typing.Any, + response: HttpResponse, ) -> typing.Any: try: - return _deserialize_xml(deserializer, value) - except DeserializationError: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -977,11 +1410,12 @@ def __init__( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -989,14 +1423,20 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1007,14 +1447,44 @@ def _rest_name(self) -> str: def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class - item = obj.get(self._rest_name) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1039,11 +1509,12 @@ def rest_field( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1053,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1060,8 +1532,8 @@ def rest_discriminator( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1077,21 +1549,77 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, list[ET.Element]]: if _is_model(o): model_meta = getattr(o, "_xml", {}) # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1113,7 +1641,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1125,12 +1655,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1139,6 +1664,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1146,7 +1672,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1155,13 +1681,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1171,10 +1700,11 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1182,7 +1712,7 @@ def _get_wrapped_element( _get_element(v, exclude_readonly, meta, wrapped_element) else: wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element + return wrapped_element # type: ignore[no-any-return] def _get_primitive_type_value(v) -> str: @@ -1195,9 +1725,29 @@ def _get_primitive_type_value(v) -> str: return str(v) -def _create_xml_element(tag, prefix=None, ns=None): - if prefix and ns: +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1208,13 +1758,15 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) def _convert_element(e: ET.Element): # dict case if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1227,7 +1779,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_serialization.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/serialization.py similarity index 90% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_serialization.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/serialization.py index 7a0232de5ddc..ae08f9d89f74 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_serialization.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_utils/serialization.py @@ -1,28 +1,10 @@ # pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pyright: reportUnnecessaryTypeIgnoreComment=false @@ -39,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -49,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -59,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -247,12 +231,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -329,7 +313,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -398,7 +382,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -432,7 +416,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -496,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -536,6 +524,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -546,7 +538,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -597,7 +589,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -807,7 +799,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -841,13 +833,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1118,6 +1117,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1202,7 +1256,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1390,6 +1444,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1402,9 +1460,13 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1414,7 +1476,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1424,6 +1486,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1777,7 +1860,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1803,7 +1886,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): @@ -1938,6 +2025,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_validation.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_version.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_version.py index 0e00a6283246..8f2350dd3b0c 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_version.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0b1" +VERSION = "2.0.0" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_client.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_client.py index 3a54c6ae3ec5..872f160e8b81 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_client.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_client.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,19 +8,22 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, TYPE_CHECKING -from typing_extensions import Self +import sys +from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.settings import settings from azure.mgmt.core import AsyncARMPipelineClient from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy +from azure.mgmt.core.tools import get_arm_endpoints -from .._serialization import Deserializer, Serializer +from .._utils.serialization import Deserializer, Serializer from ._configuration import HybridConnectivityMgmtClientConfiguration from .operations import ( EndpointsOperations, GenerateAwsTemplateOperations, + GenerateGcpTemplateOperations, InventoryOperations, Operations, PublicCloudConnectorsOperations, @@ -28,11 +32,17 @@ SolutionTypesOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attributes +class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """REST API for public clouds. :ivar operations: Operations operations @@ -45,6 +55,9 @@ class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attribu :ivar generate_aws_template: GenerateAwsTemplateOperations operations :vartype generate_aws_template: azure.mgmt.hybridconnectivity.aio.operations.GenerateAwsTemplateOperations + :ivar generate_gcp_template: GenerateGcpTemplateOperations operations + :vartype generate_gcp_template: + azure.mgmt.hybridconnectivity.aio.operations.GenerateGcpTemplateOperations :ivar public_cloud_connectors: PublicCloudConnectorsOperations operations :vartype public_cloud_connectors: azure.mgmt.hybridconnectivity.aio.operations.PublicCloudConnectorsOperations @@ -59,9 +72,13 @@ class HybridConnectivityMgmtClient: # pylint: disable=too-many-instance-attribu :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service host. Default value is "https://management.azure.com". + :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-12-01". + :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2027-01-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no @@ -72,13 +89,26 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: _endpoint = "{endpoint}" + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore + _endpoints = get_arm_endpoints(_cloud) + if not base_url: + base_url = _endpoints["resource_manager"] + credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) self._config = HybridConnectivityMgmtClientConfiguration( - credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs + credential=credential, + subscription_id=subscription_id, + base_url=cast(str, base_url), + cloud_setting=cloud_setting, + credential_scopes=credential_scopes, + **kwargs ) + _policies = kwargs.pop("policies", None) if _policies is None: _policies = [ @@ -97,7 +127,9 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( + base_url=cast(str, _endpoint), policies=_policies, **kwargs + ) self._serialize = Serializer() self._deserialize = Deserializer() @@ -110,6 +142,9 @@ def __init__( self.generate_aws_template = GenerateAwsTemplateOperations( self._client, self._config, self._serialize, self._deserialize ) + self.generate_gcp_template = GenerateGcpTemplateOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.public_cloud_connectors = PublicCloudConnectorsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_configuration.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_configuration.py index ffcaf8d0b94e..fa58783230ed 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_configuration.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,10 +15,11 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only """Configuration for HybridConnectivityMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -29,7 +31,11 @@ class HybridConnectivityMgmtClientConfiguration: # pylint: disable=too-many-ins :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2024-12-01". + :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is + None. + :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: The API version to use for this operation. Known values are "2027-01-01" + and None. Default value is None. If not set, the operation's default API version will be used. Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -39,9 +45,10 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2024-12-01") + api_version: str = kwargs.pop("api_version", "2027-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,6 +58,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-hybridconnectivity/{}".format(VERSION)) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/__init__.py index 60101daee8c0..2caf8c623231 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/__init__.py @@ -16,6 +16,7 @@ from ._operations import EndpointsOperations # type: ignore from ._operations import ServiceConfigurationsOperations # type: ignore from ._operations import GenerateAwsTemplateOperations # type: ignore +from ._operations import GenerateGcpTemplateOperations # type: ignore from ._operations import PublicCloudConnectorsOperations # type: ignore from ._operations import SolutionConfigurationsOperations # type: ignore from ._operations import InventoryOperations # type: ignore @@ -30,6 +31,7 @@ "EndpointsOperations", "ServiceConfigurationsOperations", "GenerateAwsTemplateOperations", + "GenerateGcpTemplateOperations", "PublicCloudConnectorsOperations", "SolutionConfigurationsOperations", "InventoryOperations", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_operations.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_operations.py index c2241ec6b3fe..e79ca21133e4 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_operations.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_operations.py @@ -6,10 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -33,9 +33,10 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models -from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from ..._serialization import Deserializer, Serializer +from ... import models as _models, types as _types +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._utils.serialization import Deserializer, Serializer +from ..._validation import api_version_validation from ...operations._operations import ( build_endpoints_create_or_update_request, build_endpoints_delete_request, @@ -46,6 +47,7 @@ build_endpoints_list_request, build_endpoints_update_request, build_generate_aws_template_post_request, + build_generate_gcp_template_post_request, build_inventory_get_request, build_inventory_list_by_solution_configuration_request, build_operations_list_request, @@ -73,16 +75,12 @@ ) from .._configuration import HybridConnectivityMgmtClientConfiguration -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +List = list -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -102,7 +100,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -149,7 +147,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -162,7 +163,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -178,7 +182,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -186,7 +193,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class EndpointsOperations: +class EndpointsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -243,6 +250,7 @@ async def get(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> _mo } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -257,11 +265,14 @@ async def get(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> _mo except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -302,7 +313,7 @@ async def create_or_update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: JSON, + endpoint_resource: _types.EndpointResource, *, content_type: str = "application/json", **kwargs: Any @@ -315,7 +326,7 @@ async def create_or_update( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param endpoint_resource: Endpoint details. Required. - :type endpoint_resource: JSON + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.types.EndpointResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -356,7 +367,7 @@ async def create_or_update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: Union[_models.EndpointResource, JSON, IO[bytes]], + endpoint_resource: Union[_models.EndpointResource, _types.EndpointResource, IO[bytes]], **kwargs: Any ) -> _models.EndpointResource: """Create or update the endpoint to the target resource. @@ -366,10 +377,10 @@ async def create_or_update( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param endpoint_resource: Endpoint details. Is one of the following types: EndpointResource, - JSON, IO[bytes] Required. - :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or JSON or - IO[bytes] + :param endpoint_resource: Endpoint details. Is either a EndpointResource type or a IO[bytes] + type. Required. + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or + ~azure.mgmt.hybridconnectivity.types.EndpointResource or IO[bytes] :return: EndpointResource. The EndpointResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.EndpointResource :raises ~azure.core.exceptions.HttpResponseError: @@ -409,6 +420,7 @@ async def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -423,11 +435,14 @@ async def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -468,7 +483,7 @@ async def update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: JSON, + endpoint_resource: _types.EndpointResource, *, content_type: str = "application/json", **kwargs: Any @@ -481,7 +496,7 @@ async def update( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param endpoint_resource: Endpoint details. Required. - :type endpoint_resource: JSON + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.types.EndpointResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -522,7 +537,7 @@ async def update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: Union[_models.EndpointResource, JSON, IO[bytes]], + endpoint_resource: Union[_models.EndpointResource, _types.EndpointResource, IO[bytes]], **kwargs: Any ) -> _models.EndpointResource: """Update the endpoint to the target resource. @@ -532,10 +547,10 @@ async def update( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param endpoint_resource: Endpoint details. Is one of the following types: EndpointResource, - JSON, IO[bytes] Required. - :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or JSON or - IO[bytes] + :param endpoint_resource: Endpoint details. Is either a EndpointResource type or a IO[bytes] + type. Required. + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or + ~azure.mgmt.hybridconnectivity.types.EndpointResource or IO[bytes] :return: EndpointResource. The EndpointResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.EndpointResource :raises ~azure.core.exceptions.HttpResponseError: @@ -575,6 +590,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -589,11 +605,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -649,14 +668,17 @@ async def delete(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.EndpointResource"]: + def list(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.EndpointResource"]: """List of endpoints to the target resource. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -707,7 +729,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -720,7 +745,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EndpointResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.EndpointResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -736,7 +764,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -779,7 +810,7 @@ async def list_credentials( self, resource_uri: str, endpoint_name: str, - list_credentials_request: Optional[JSON] = None, + list_credentials_request: Optional[_types.ListCredentialsRequest] = None, *, expiresin: Optional[int] = None, content_type: str = "application/json", @@ -793,7 +824,7 @@ async def list_credentials( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param list_credentials_request: Object of type ListCredentialsRequest. Default value is None. - :type list_credentials_request: JSON + :type list_credentials_request: ~azure.mgmt.hybridconnectivity.types.ListCredentialsRequest :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -841,7 +872,9 @@ async def list_credentials( self, resource_uri: str, endpoint_name: str, - list_credentials_request: Optional[Union[_models.ListCredentialsRequest, JSON, IO[bytes]]] = None, + list_credentials_request: Optional[ + Union[_models.ListCredentialsRequest, _types.ListCredentialsRequest, IO[bytes]] + ] = None, *, expiresin: Optional[int] = None, **kwargs: Any @@ -853,10 +886,10 @@ async def list_credentials( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param list_credentials_request: Object of type ListCredentialsRequest. Is one of the following - types: ListCredentialsRequest, JSON, IO[bytes] Default value is None. + :param list_credentials_request: Object of type ListCredentialsRequest. Is either a + ListCredentialsRequest type or a IO[bytes] type. Default value is None. :type list_credentials_request: ~azure.mgmt.hybridconnectivity.models.ListCredentialsRequest or - JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.types.ListCredentialsRequest or IO[bytes] :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -876,9 +909,10 @@ async def list_credentials( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if list_credentials_request else None cls: ClsType[_models.EndpointAccessResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if list_credentials_request else None _content = None if isinstance(list_credentials_request, (IOBase, bytes)): _content = list_credentials_request @@ -903,6 +937,7 @@ async def list_credentials( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -917,11 +952,14 @@ async def list_credentials( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointAccessResource, response.json()) @@ -968,7 +1006,7 @@ async def list_ingress_gateway_credentials( self, resource_uri: str, endpoint_name: str, - list_ingress_gateway_credentials_request: Optional[JSON] = None, + list_ingress_gateway_credentials_request: Optional[_types.ListIngressGatewayCredentialsRequest] = None, *, expiresin: Optional[int] = None, content_type: str = "application/json", @@ -983,7 +1021,8 @@ async def list_ingress_gateway_credentials( :type endpoint_name: str :param list_ingress_gateway_credentials_request: Object of type ListIngressGatewayCredentialsRequest. Default value is None. - :type list_ingress_gateway_credentials_request: JSON + :type list_ingress_gateway_credentials_request: + ~azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1033,7 +1072,7 @@ async def list_ingress_gateway_credentials( resource_uri: str, endpoint_name: str, list_ingress_gateway_credentials_request: Optional[ - Union[_models.ListIngressGatewayCredentialsRequest, JSON, IO[bytes]] + Union[_models.ListIngressGatewayCredentialsRequest, _types.ListIngressGatewayCredentialsRequest, IO[bytes]] ] = None, *, expiresin: Optional[int] = None, @@ -1047,10 +1086,11 @@ async def list_ingress_gateway_credentials( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param list_ingress_gateway_credentials_request: Object of type - ListIngressGatewayCredentialsRequest. Is one of the following types: - ListIngressGatewayCredentialsRequest, JSON, IO[bytes] Default value is None. + ListIngressGatewayCredentialsRequest. Is either a ListIngressGatewayCredentialsRequest type or + a IO[bytes] type. Default value is None. :type list_ingress_gateway_credentials_request: - ~azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest or + ~azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest or IO[bytes] :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1070,9 +1110,10 @@ async def list_ingress_gateway_credentials( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if list_ingress_gateway_credentials_request else None cls: ClsType[_models.IngressGatewayResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if list_ingress_gateway_credentials_request else None _content = None if isinstance(list_ingress_gateway_credentials_request, (IOBase, bytes)): _content = list_ingress_gateway_credentials_request @@ -1097,6 +1138,7 @@ async def list_ingress_gateway_credentials( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1111,11 +1153,14 @@ async def list_ingress_gateway_credentials( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngressGatewayResource, response.json()) @@ -1156,7 +1201,7 @@ async def list_managed_proxy_details( self, resource_uri: str, endpoint_name: str, - managed_proxy_request: JSON, + managed_proxy_request: _types.ManagedProxyRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1169,7 +1214,7 @@ async def list_managed_proxy_details( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param managed_proxy_request: Object of type ManagedProxyRequest. Required. - :type managed_proxy_request: JSON + :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.types.ManagedProxyRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1210,7 +1255,7 @@ async def list_managed_proxy_details( self, resource_uri: str, endpoint_name: str, - managed_proxy_request: Union[_models.ManagedProxyRequest, JSON, IO[bytes]], + managed_proxy_request: Union[_models.ManagedProxyRequest, _types.ManagedProxyRequest, IO[bytes]], **kwargs: Any ) -> _models.ManagedProxyResource: """Fetches the managed proxy details. @@ -1220,10 +1265,10 @@ async def list_managed_proxy_details( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param managed_proxy_request: Object of type ManagedProxyRequest. Is one of the following - types: ManagedProxyRequest, JSON, IO[bytes] Required. - :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.models.ManagedProxyRequest or JSON - or IO[bytes] + :param managed_proxy_request: Object of type ManagedProxyRequest. Is either a + ManagedProxyRequest type or a IO[bytes] type. Required. + :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.models.ManagedProxyRequest or + ~azure.mgmt.hybridconnectivity.types.ManagedProxyRequest or IO[bytes] :return: ManagedProxyResource. The ManagedProxyResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ManagedProxyResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1263,6 +1308,7 @@ async def list_managed_proxy_details( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1277,11 +1323,14 @@ async def list_managed_proxy_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ManagedProxyResource, response.json()) @@ -1291,7 +1340,7 @@ async def list_managed_proxy_details( return deserialized # type: ignore -class ServiceConfigurationsOperations: +class ServiceConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1354,6 +1403,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1368,11 +1418,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -1419,7 +1472,7 @@ async def create_orupdate( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: JSON, + service_configuration_resource: _types.ServiceConfigurationResource, *, content_type: str = "application/json", **kwargs: Any @@ -1434,7 +1487,8 @@ async def create_orupdate( :param service_configuration_name: The service name. Required. :type service_configuration_name: str :param service_configuration_resource: Service details. Required. - :type service_configuration_resource: JSON + :type service_configuration_resource: + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1481,7 +1535,9 @@ async def create_orupdate( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: Union[_models.ServiceConfigurationResource, JSON, IO[bytes]], + service_configuration_resource: Union[ + _models.ServiceConfigurationResource, _types.ServiceConfigurationResource, IO[bytes] + ], **kwargs: Any ) -> _models.ServiceConfigurationResource: """Create or update a service in serviceConfiguration for the endpoint resource. @@ -1493,10 +1549,11 @@ async def create_orupdate( :type endpoint_name: str :param service_configuration_name: The service name. Required. :type service_configuration_name: str - :param service_configuration_resource: Service details. Is one of the following types: - ServiceConfigurationResource, JSON, IO[bytes] Required. + :param service_configuration_resource: Service details. Is either a + ServiceConfigurationResource type or a IO[bytes] type. Required. :type service_configuration_resource: - ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource or + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource or IO[bytes] :return: ServiceConfigurationResource. The ServiceConfigurationResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource @@ -1538,6 +1595,7 @@ async def create_orupdate( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1552,11 +1610,14 @@ async def create_orupdate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -1603,7 +1664,7 @@ async def update( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: JSON, + service_configuration_resource: _types.ServiceConfigurationResourcePatch, *, content_type: str = "application/json", **kwargs: Any @@ -1618,7 +1679,8 @@ async def update( :param service_configuration_name: The service name. Required. :type service_configuration_name: str :param service_configuration_resource: Service details. Required. - :type service_configuration_resource: JSON + :type service_configuration_resource: + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1665,7 +1727,9 @@ async def update( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: Union[_models.ServiceConfigurationResourcePatch, JSON, IO[bytes]], + service_configuration_resource: Union[ + _models.ServiceConfigurationResourcePatch, _types.ServiceConfigurationResourcePatch, IO[bytes] + ], **kwargs: Any ) -> _models.ServiceConfigurationResource: """Update the service details in the service configurations of the target resource. @@ -1677,10 +1741,11 @@ async def update( :type endpoint_name: str :param service_configuration_name: The service name. Required. :type service_configuration_name: str - :param service_configuration_resource: Service details. Is one of the following types: - ServiceConfigurationResourcePatch, JSON, IO[bytes] Required. + :param service_configuration_resource: Service details. Is either a + ServiceConfigurationResourcePatch type or a IO[bytes] type. Required. :type service_configuration_resource: - ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch or + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch or IO[bytes] :return: ServiceConfigurationResource. The ServiceConfigurationResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource @@ -1722,6 +1787,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1736,11 +1802,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -1801,7 +1870,10 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1810,7 +1882,7 @@ async def delete( @distributed_trace def list_by_endpoint_resource( self, resource_uri: str, endpoint_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ServiceConfigurationResource"]: + ) -> AsyncItemPaged["_models.ServiceConfigurationResource"]: """Lists of all the services associated with endpoint resource. API to enumerate registered services in service configurations under a Endpoint Resource. @@ -1866,7 +1938,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1879,7 +1954,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ServiceConfigurationResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ServiceConfigurationResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1895,7 +1973,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1903,7 +1984,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class GenerateAwsTemplateOperations: +class GenerateAwsTemplateOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1929,7 +2010,7 @@ async def post( *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to @@ -1939,32 +2020,39 @@ async def post( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def post( - self, generate_aws_template_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + self, + generate_aws_template_request: _types.GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. Required. - :type generate_aws_template_request: JSON + :type generate_aws_template_request: + ~azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def post( self, generate_aws_template_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to @@ -1973,24 +2061,31 @@ async def post( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def post( - self, generate_aws_template_request: Union[_models.GenerateAwsTemplateRequest, JSON, IO[bytes]], **kwargs: Any - ) -> Any: + self, + generate_aws_template_request: Union[ + _models.GenerateAwsTemplateRequest, _types.GenerateAwsTemplateRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to - Generate AWS CFT Template. Is one of the following types: GenerateAwsTemplateRequest, JSON, - IO[bytes] Required. + Generate AWS CFT Template. Is either a GenerateAwsTemplateRequest type or a IO[bytes] type. + Required. :type generate_aws_template_request: - ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest or JSON or IO[bytes] - :return: any - :rtype: any + ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest or + ~azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest or IO[bytes] + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2005,7 +2100,7 @@ async def post( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Any] = kwargs.pop("cls", None) + cls: ClsType[_models.GenerateAwsTemplateResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2027,6 +2122,182 @@ async def post( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GenerateAwsTemplateResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class GenerateGcpTemplateOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridconnectivity.aio.HybridConnectivityMgmtClient`'s + :attr:`generate_gcp_template` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HybridConnectivityMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def post( + self, + generate_gcp_template_request: _models.GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, + generate_gcp_template_request: _types.GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, generate_gcp_template_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2027-01-01", + params_added_on={"2027-01-01": ["api_version", "subscription_id", "content_type", "accept"]}, + api_versions_list=["2027-01-01"], + ) + async def post( + self, + generate_gcp_template_request: Union[ + _models.GenerateGcpTemplateRequest, _types.GenerateGcpTemplateRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Is either a GenerateGcpTemplateRequest type or a + IO[bytes] type. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest or + ~azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest or IO[bytes] + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateGcpTemplateResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(generate_gcp_template_request, (IOBase, bytes)): + _content = generate_gcp_template_request + else: + _content = json.dumps(generate_gcp_template_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_generate_gcp_template_post_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2041,13 +2312,16 @@ async def post( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(Any, response.json()) + deserialized = _deserialize(_models.GenerateGcpTemplateResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2055,7 +2329,7 @@ async def post( return deserialized # type: ignore -class PublicCloudConnectorsOperations: +class PublicCloudConnectorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2115,6 +2389,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2129,11 +2404,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PublicCloudConnector, response.json()) @@ -2146,7 +2424,7 @@ async def _create_or_update_initial( self, resource_group_name: str, public_cloud_connector: str, - resource: Union[_models.PublicCloudConnector, JSON, IO[bytes]], + resource: Union[_models.PublicCloudConnector, _types.PublicCloudConnector, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2185,6 +2463,7 @@ async def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2198,7 +2477,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2208,7 +2490,7 @@ async def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2249,7 +2531,7 @@ async def begin_create_or_update( self, resource_group_name: str, public_cloud_connector: str, - resource: JSON, + resource: _types.PublicCloudConnector, *, content_type: str = "application/json", **kwargs: Any @@ -2262,7 +2544,7 @@ async def begin_create_or_update( :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.hybridconnectivity.types.PublicCloudConnector :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2307,7 +2589,7 @@ async def begin_create_or_update( self, resource_group_name: str, public_cloud_connector: str, - resource: Union[_models.PublicCloudConnector, JSON, IO[bytes]], + resource: Union[_models.PublicCloudConnector, _types.PublicCloudConnector, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.PublicCloudConnector]: """Create a PublicCloudConnector. @@ -2317,9 +2599,10 @@ async def begin_create_or_update( :type resource_group_name: str :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str - :param resource: Resource create parameters. Is one of the following types: - PublicCloudConnector, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a PublicCloudConnector type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector or + ~azure.mgmt.hybridconnectivity.types.PublicCloudConnector or IO[bytes] :return: An instance of AsyncLROPoller that returns PublicCloudConnector. The PublicCloudConnector is compatible with MutableMapping :rtype: @@ -2410,7 +2693,7 @@ async def update( self, resource_group_name: str, public_cloud_connector: str, - properties: JSON, + properties: _types.PublicCloudConnectorUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -2423,7 +2706,7 @@ async def update( :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2464,7 +2747,7 @@ async def update( self, resource_group_name: str, public_cloud_connector: str, - properties: Union[_models.PublicCloudConnectorUpdate, JSON, IO[bytes]], + properties: Union[_models.PublicCloudConnectorUpdate, _types.PublicCloudConnectorUpdate, IO[bytes]], **kwargs: Any ) -> _models.PublicCloudConnector: """Update a PublicCloudConnector. @@ -2474,10 +2757,10 @@ async def update( :type resource_group_name: str :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str - :param properties: The resource properties to be updated. Is one of the following types: - PublicCloudConnectorUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + PublicCloudConnectorUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate or + ~azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate or IO[bytes] :return: PublicCloudConnector. The PublicCloudConnector is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector :raises ~azure.core.exceptions.HttpResponseError: @@ -2518,6 +2801,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2532,11 +2816,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PublicCloudConnector, response.json()) @@ -2593,7 +2880,10 @@ async def delete(self, resource_group_name: str, public_cloud_connector: str, ** if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -2602,7 +2892,7 @@ async def delete(self, resource_group_name: str, public_cloud_connector: str, ** @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.PublicCloudConnector"]: + ) -> AsyncItemPaged["_models.PublicCloudConnector"]: """List PublicCloudConnector resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -2654,7 +2944,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2667,7 +2960,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PublicCloudConnector], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PublicCloudConnector], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2683,7 +2979,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2691,7 +2990,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.PublicCloudConnector"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.PublicCloudConnector"]: """List PublicCloudConnector resources by subscription ID. :return: An iterator like instance of PublicCloudConnector @@ -2739,7 +3038,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2752,7 +3054,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PublicCloudConnector], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PublicCloudConnector], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2768,7 +3073,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2804,6 +3112,7 @@ async def _test_permissions_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2817,7 +3126,10 @@ async def _test_permissions_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2825,7 +3137,7 @@ async def _test_permissions_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2869,14 +3181,10 @@ async def begin_test_permissions( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -2903,7 +3211,7 @@ def get_long_running_output(pipeline_response): ) -class SolutionConfigurationsOperations: +class SolutionConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2960,6 +3268,7 @@ async def get(self, resource_uri: str, solution_configuration: str, **kwargs: An } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2974,11 +3283,14 @@ async def get(self, resource_uri: str, solution_configuration: str, **kwargs: An except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -3019,7 +3331,7 @@ async def create_or_update( self, resource_uri: str, solution_configuration: str, - resource: JSON, + resource: _types.SolutionConfiguration, *, content_type: str = "application/json", **kwargs: Any @@ -3032,7 +3344,7 @@ async def create_or_update( :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.hybridconnectivity.types.SolutionConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3073,7 +3385,7 @@ async def create_or_update( self, resource_uri: str, solution_configuration: str, - resource: Union[_models.SolutionConfiguration, JSON, IO[bytes]], + resource: Union[_models.SolutionConfiguration, _types.SolutionConfiguration, IO[bytes]], **kwargs: Any ) -> _models.SolutionConfiguration: """Create a SolutionConfiguration. @@ -3083,10 +3395,10 @@ async def create_or_update( :type resource_uri: str :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str - :param resource: Resource create parameters. Is one of the following types: - SolutionConfiguration, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration or JSON or - IO[bytes] + :param resource: Resource create parameters. Is either a SolutionConfiguration type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration or + ~azure.mgmt.hybridconnectivity.types.SolutionConfiguration or IO[bytes] :return: SolutionConfiguration. The SolutionConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration :raises ~azure.core.exceptions.HttpResponseError: @@ -3126,6 +3438,7 @@ async def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3140,11 +3453,14 @@ async def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -3185,7 +3501,7 @@ async def update( self, resource_uri: str, solution_configuration: str, - properties: JSON, + properties: _types.SolutionConfigurationUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -3198,7 +3514,7 @@ async def update( :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3239,7 +3555,7 @@ async def update( self, resource_uri: str, solution_configuration: str, - properties: Union[_models.SolutionConfigurationUpdate, JSON, IO[bytes]], + properties: Union[_models.SolutionConfigurationUpdate, _types.SolutionConfigurationUpdate, IO[bytes]], **kwargs: Any ) -> _models.SolutionConfiguration: """Update a SolutionConfiguration. @@ -3249,10 +3565,10 @@ async def update( :type resource_uri: str :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str - :param properties: The resource properties to be updated. Is one of the following types: - SolutionConfigurationUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + SolutionConfigurationUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate or + ~azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate or IO[bytes] :return: SolutionConfiguration. The SolutionConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration :raises ~azure.core.exceptions.HttpResponseError: @@ -3292,6 +3608,7 @@ async def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3306,11 +3623,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -3366,14 +3686,17 @@ async def delete(self, resource_uri: str, solution_configuration: str, **kwargs: if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> AsyncIterable["_models.SolutionConfiguration"]: + def list(self, resource_uri: str, **kwargs: Any) -> AsyncItemPaged["_models.SolutionConfiguration"]: """List SolutionConfiguration resources by parent. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -3424,7 +3747,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3437,7 +3763,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionConfiguration], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionConfiguration], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3453,7 +3782,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3488,6 +3820,7 @@ async def _sync_now_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3501,7 +3834,10 @@ async def _sync_now_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3509,7 +3845,7 @@ async def _sync_now_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3553,14 +3889,10 @@ async def begin_sync_now( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -3587,7 +3919,7 @@ def get_long_running_output(pipeline_response): ) -class InventoryOperations: +class InventoryOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3649,6 +3981,7 @@ async def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3663,11 +3996,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.InventoryResource, response.json()) @@ -3679,7 +4015,7 @@ async def get( @distributed_trace def list_by_solution_configuration( self, resource_uri: str, solution_configuration: str, **kwargs: Any - ) -> AsyncIterable["_models.InventoryResource"]: + ) -> AsyncItemPaged["_models.InventoryResource"]: """List InventoryResource resources by SolutionConfiguration. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -3733,7 +4069,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3746,7 +4085,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.InventoryResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.InventoryResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3762,7 +4104,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3770,7 +4115,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class SolutionTypesOperations: +class SolutionTypesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3828,6 +4173,7 @@ async def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3842,11 +4188,14 @@ async def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTypeResource, response.json()) @@ -3858,7 +4207,7 @@ async def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SolutionTypeResource"]: + ) -> AsyncItemPaged["_models.SolutionTypeResource"]: """List SolutionTypeResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3910,7 +4259,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3923,7 +4275,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTypeResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionTypeResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3939,7 +4294,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3947,7 +4305,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SolutionTypeResource"]: + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.SolutionTypeResource"]: """List SolutionTypeResource resources by subscription ID. :return: An iterator like instance of SolutionTypeResource @@ -3995,7 +4353,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4008,7 +4369,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTypeResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionTypeResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -4024,7 +4388,10 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/aio/operations/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/__init__.py index f46ac515281b..8d339144bebd 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/__init__.py @@ -24,7 +24,15 @@ ErrorDetail, ErrorResponse, ExtensionResource, + GcpCloudProfile, + GcpCloudProfileUpdate, + GcpOrganizationProperties, + GcpOrganizationPropertiesUpdate, + GcpProjectProperties, GenerateAwsTemplateRequest, + GenerateAwsTemplateResponse, + GenerateGcpTemplateRequest, + GenerateGcpTemplateResponse, IngressGatewayResource, IngressProfileProperties, InventoryProperties, @@ -65,6 +73,7 @@ ActionType, CloudNativeType, CreatedByType, + GcpTemplateFormat, HostType, Origin, ProvisioningState, @@ -88,7 +97,15 @@ "ErrorDetail", "ErrorResponse", "ExtensionResource", + "GcpCloudProfile", + "GcpCloudProfileUpdate", + "GcpOrganizationProperties", + "GcpOrganizationPropertiesUpdate", + "GcpProjectProperties", "GenerateAwsTemplateRequest", + "GenerateAwsTemplateResponse", + "GenerateGcpTemplateRequest", + "GenerateGcpTemplateResponse", "IngressGatewayResource", "IngressProfileProperties", "InventoryProperties", @@ -126,6 +143,7 @@ "ActionType", "CloudNativeType", "CreatedByType", + "GcpTemplateFormat", "HostType", "Origin", "ProvisioningState", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_enums.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_enums.py index dc862c7da3de..788715cfcbf2 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_enums.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_enums.py @@ -39,11 +39,22 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The entity was created by a key.""" +class GcpTemplateFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """GCP template format.""" + + TERRAFORM = "terraform" + """Terraform template format.""" + SHELL_SCRIPT = "shellscript" + """Shell script template format.""" + + class HostType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enum of host cloud the public cloud connector is referencing.""" AWS = "AWS" - """AWS state""" + """AWS state.""" + GCP = "GCP" + """GCP state.""" class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -63,10 +74,15 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The resource provisioning state.""" SUCCEEDED = "Succeeded" + """SUCCEEDED.""" CREATING = "Creating" + """CREATING.""" UPDATING = "Updating" + """UPDATING.""" FAILED = "Failed" + """FAILED.""" CANCELED = "Canceled" + """CANCELED.""" class ResourceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -84,24 +100,28 @@ class ServiceName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Name of the service.""" SSH = "SSH" + """SSH.""" WAC = "WAC" + """WAC.""" class SolutionConfigurationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Solution Configuration Status.""" NEW = "New" - """New status""" + """New status.""" IN_PROGRESS = "InProgress" - """InProgress status""" + """InProgress status.""" COMPLETED = "Completed" - """Canceled status""" + """Canceled status.""" FAILED = "Failed" - """Failed status""" + """Failed status.""" class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of endpoint.""" DEFAULT = "default" + """DEFAULT.""" CUSTOM = "custom" + """CUSTOM.""" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_models.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_models.py index fd45b020813b..7a9e90402e34 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_models.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_models.py @@ -9,16 +9,15 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Mapping, Optional, TYPE_CHECKING, Union, overload +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload -from .. import _model_base -from .._model_base import rest_field +from .._utils.model_base import Model as _Model, rest_field if TYPE_CHECKING: from .. import models as _models -class AADProfileProperties(_model_base.Model): +class AADProfileProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The AAD Profile. :ivar server_id: The arc ingress gateway server app id. Required. @@ -51,7 +50,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AwsCloudProfile(_model_base.Model): +class AwsCloudProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """cloud profile for AWS. :ivar account_id: Account id for the AWS account. Required. @@ -66,7 +65,7 @@ class AwsCloudProfile(_model_base.Model): account_id: str = rest_field(name="accountId", visibility=["read", "create"]) """Account id for the AWS account. Required.""" - excluded_accounts: Optional[List[str]] = rest_field( + excluded_accounts: Optional[list[str]] = rest_field( name="excludedAccounts", visibility=["read", "create", "update", "delete", "query"] ) """List of AWS accounts which need to be excluded.""" @@ -81,7 +80,7 @@ def __init__( self, *, account_id: str, - excluded_accounts: Optional[List[str]] = None, + excluded_accounts: Optional[list[str]] = None, is_organizational_account: Optional[bool] = None, ) -> None: ... @@ -96,14 +95,14 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AwsCloudProfileUpdate(_model_base.Model): +class AwsCloudProfileUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """cloud profile for AWS. :ivar excluded_accounts: List of AWS accounts which need to be excluded. :vartype excluded_accounts: list[str] """ - excluded_accounts: Optional[List[str]] = rest_field( + excluded_accounts: Optional[list[str]] = rest_field( name="excludedAccounts", visibility=["read", "create", "update", "delete", "query"] ) """List of AWS accounts which need to be excluded.""" @@ -112,7 +111,7 @@ class AwsCloudProfileUpdate(_model_base.Model): def __init__( self, *, - excluded_accounts: Optional[List[str]] = None, + excluded_accounts: Optional[list[str]] = None, ) -> None: ... @overload @@ -126,7 +125,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EndpointAccessResource(_model_base.Model): +class EndpointAccessResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The endpoint access for the target resource. :ivar relay: Azure relay hybrid connection access properties. @@ -178,12 +177,12 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.relay is None: self.relay = self._attr_to_rest_field["relay"]._class_type() - setattr(self.properties, key, value) + setattr(self.relay, key, value) else: super().__setattr__(key, value) -class EndpointProperties(_model_base.Model): +class EndpointProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Endpoint details. :ivar type: The type of endpoint. Required. Known values are: "default" and "custom". @@ -222,8 +221,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Resource(_model_base.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. +class Resource(_Model): + """Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -267,7 +266,7 @@ class ExtensionResource(Resource): """ -class EndpointResource(ExtensionResource): +class EndpointResource(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The endpoint for the target resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -308,7 +307,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ErrorAdditionalInfo(_model_base.Model): +class ErrorAdditionalInfo(_Model): """The resource management error additional info. :ivar type: The additional info type. @@ -323,7 +322,7 @@ class ErrorAdditionalInfo(_model_base.Model): """The additional info.""" -class ErrorDetail(_model_base.Model): +class ErrorDetail(_Model): """The error detail. :ivar code: The error code. @@ -344,17 +343,16 @@ class ErrorDetail(_model_base.Model): """The error message.""" target: Optional[str] = rest_field(visibility=["read"]) """The error target.""" - details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) """The error details.""" - additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( name="additionalInfo", visibility=["read"] ) """The error additional info.""" -class ErrorResponse(_model_base.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Error response. :ivar error: The error object. :vartype error: ~azure.mgmt.hybridconnectivity.models.ErrorDetail @@ -381,7 +379,198 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class GenerateAwsTemplateRequest(_model_base.Model): +class GcpCloudProfile(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """cloud profile for GCP. + + :ivar project_properties: The project properties of the GCP project. + :vartype project_properties: ~azure.mgmt.hybridconnectivity.models.GcpProjectProperties + :ivar organization_properties: The organization properties of the GCP organization. + :vartype organization_properties: + ~azure.mgmt.hybridconnectivity.models.GcpOrganizationProperties + """ + + project_properties: Optional["_models.GcpProjectProperties"] = rest_field( + name="projectProperties", visibility=["read", "create"] + ) + """The project properties of the GCP project.""" + organization_properties: Optional["_models.GcpOrganizationProperties"] = rest_field( + name="organizationProperties", visibility=["read", "create"] + ) + """The organization properties of the GCP organization.""" + + @overload + def __init__( + self, + *, + project_properties: Optional["_models.GcpProjectProperties"] = None, + organization_properties: Optional["_models.GcpOrganizationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GcpCloudProfileUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """cloud profile for GCP. + + :ivar organization_properties: The organization properties of the GCP organization. + :vartype organization_properties: + ~azure.mgmt.hybridconnectivity.models.GcpOrganizationPropertiesUpdate + """ + + organization_properties: Optional["_models.GcpOrganizationPropertiesUpdate"] = rest_field( + name="organizationProperties", visibility=["read", "create", "update", "delete", "query"] + ) + """The organization properties of the GCP organization.""" + + @overload + def __init__( + self, + *, + organization_properties: Optional["_models.GcpOrganizationPropertiesUpdate"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GcpOrganizationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """GCP organization properties. + + :ivar organization_id: The organization id of the GCP organization. Required. + :vartype organization_id: str + :ivar management_project_number: The project number of the management project under the GCP + organization. Required. + :vartype management_project_number: str + :ivar management_project_id: The project Id of the management project under the GCP + organization. Required. + :vartype management_project_id: str + :ivar excluded_project_numbers: List of GCP projects which need to be excluded. + :vartype excluded_project_numbers: list[str] + :ivar excluded_folder_ids: List of GCP folders which need to be excluded. + :vartype excluded_folder_ids: list[str] + """ + + organization_id: str = rest_field(name="organizationId", visibility=["read", "create"]) + """The organization id of the GCP organization. Required.""" + management_project_number: str = rest_field(name="managementProjectNumber", visibility=["read", "create"]) + """The project number of the management project under the GCP organization. Required.""" + management_project_id: str = rest_field(name="managementProjectId", visibility=["read", "create"]) + """The project Id of the management project under the GCP organization. Required.""" + excluded_project_numbers: Optional[list[str]] = rest_field( + name="excludedProjectNumbers", visibility=["read", "create"] + ) + """List of GCP projects which need to be excluded.""" + excluded_folder_ids: Optional[list[str]] = rest_field(name="excludedFolderIds", visibility=["read", "create"]) + """List of GCP folders which need to be excluded.""" + + @overload + def __init__( + self, + *, + organization_id: str, + management_project_number: str, + management_project_id: str, + excluded_project_numbers: Optional[list[str]] = None, + excluded_folder_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GcpOrganizationPropertiesUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """GCP organization properties for update. + + :ivar excluded_project_numbers: List of GCP projects which need to be excluded. + :vartype excluded_project_numbers: list[str] + :ivar excluded_folder_ids: List of GCP folders which need to be excluded. + :vartype excluded_folder_ids: list[str] + """ + + excluded_project_numbers: Optional[list[str]] = rest_field( + name="excludedProjectNumbers", visibility=["read", "create", "update", "delete", "query"] + ) + """List of GCP projects which need to be excluded.""" + excluded_folder_ids: Optional[list[str]] = rest_field( + name="excludedFolderIds", visibility=["read", "create", "update", "delete", "query"] + ) + """List of GCP folders which need to be excluded.""" + + @overload + def __init__( + self, + *, + excluded_project_numbers: Optional[list[str]] = None, + excluded_folder_ids: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GcpProjectProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """GCP project properties. + + :ivar project_number: The project number of the GCP project. Required. + :vartype project_number: str + :ivar project_id: The project id of the GCP project. Required. + :vartype project_id: str + """ + + project_number: str = rest_field(name="projectNumber", visibility=["read", "create"]) + """The project number of the GCP project. Required.""" + project_id: str = rest_field(name="projectId", visibility=["read", "create"]) + """The project id of the GCP project. Required.""" + + @overload + def __init__( + self, + *, + project_number: str, + project_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GenerateAwsTemplateRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. :ivar connector_id: The name of public cloud connector. Required. @@ -392,7 +581,7 @@ class GenerateAwsTemplateRequest(_model_base.Model): connector_id: str = rest_field(name="connectorId", visibility=["read", "create", "update", "delete", "query"]) """The name of public cloud connector. Required.""" - solution_types: Optional[List["_models.SolutionTypeSettings"]] = rest_field( + solution_types: Optional[list["_models.SolutionTypeSettings"]] = rest_field( name="solutionTypes", visibility=["read", "create", "update", "delete", "query"] ) """The list of solution types and their settings.""" @@ -402,7 +591,7 @@ def __init__( self, *, connector_id: str, - solution_types: Optional[List["_models.SolutionTypeSettings"]] = None, + solution_types: Optional[list["_models.SolutionTypeSettings"]] = None, ) -> None: ... @overload @@ -416,7 +605,66 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class IngressGatewayResource(_model_base.Model): +class GenerateAwsTemplateResponse(_Model): + """The HybridConnectivity post operation response.""" + + +class GenerateGcpTemplateRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """ConnectorId and SolutionTypes and their properties to Generate GCP Access Control Template. + + :ivar connector_id: The name of public cloud connector. Required. + :vartype connector_id: str + :ivar solution_types: The list of solution types and their settings. + :vartype solution_types: list[~azure.mgmt.hybridconnectivity.models.SolutionTypeSettings] + :ivar gcp_cloud_profile: The GCP cloud profile. + :vartype gcp_cloud_profile: ~azure.mgmt.hybridconnectivity.models.GcpCloudProfile + :ivar gcp_template_format: Optional template output format. Defaults to 'terraform' if not + provided. Known values are: "terraform" and "shellscript". + :vartype gcp_template_format: str or ~azure.mgmt.hybridconnectivity.models.GcpTemplateFormat + """ + + connector_id: str = rest_field(name="connectorId", visibility=["read", "create", "update", "delete", "query"]) + """The name of public cloud connector. Required.""" + solution_types: Optional[list["_models.SolutionTypeSettings"]] = rest_field( + name="solutionTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of solution types and their settings.""" + gcp_cloud_profile: Optional["_models.GcpCloudProfile"] = rest_field( + name="gcpCloudProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The GCP cloud profile.""" + gcp_template_format: Optional[Union[str, "_models.GcpTemplateFormat"]] = rest_field( + name="gcpTemplateFormat", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional template output format. Defaults to 'terraform' if not provided. Known values are: + \"terraform\" and \"shellscript\".""" + + @overload + def __init__( + self, + *, + connector_id: str, + solution_types: Optional[list["_models.SolutionTypeSettings"]] = None, + gcp_cloud_profile: Optional["_models.GcpCloudProfile"] = None, + gcp_template_format: Optional[Union[str, "_models.GcpTemplateFormat"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GenerateGcpTemplateResponse(_Model): + """The HybridConnectivity post operation response.""" + + +class IngressGatewayResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The ingress gateway access credentials. :ivar relay: Azure relay hybrid connection access properties. @@ -475,12 +723,12 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.relay is None: self.relay = self._attr_to_rest_field["relay"]._class_type() - setattr(self.properties, key, value) + setattr(self.relay, key, value) else: super().__setattr__(key, value) -class IngressProfileProperties(_model_base.Model): +class IngressProfileProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Ingress gateway profile. :ivar hostname: The ingress hostname. Required. @@ -530,12 +778,12 @@ def __setattr__(self, key: str, value: Any) -> None: if key in self.__flattened_items: if self.aad_profile is None: self.aad_profile = self._attr_to_rest_field["aad_profile"]._class_type() - setattr(self.properties, key, value) + setattr(self.aad_profile, key, value) else: super().__setattr__(key, value) -class InventoryProperties(_model_base.Model): +class InventoryProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of inventory. :ivar cloud_native_type: Gets or sets the cloud native resource type. "ec2" @@ -604,8 +852,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. + """Proxy Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -621,7 +868,7 @@ class ProxyResource(Resource): """ -class InventoryResource(ProxyResource): +class InventoryResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Concrete proxy resource types can be created by aliasing this type using a specific property type. @@ -663,7 +910,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ListCredentialsRequest(_model_base.Model): +class ListCredentialsRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The details of the service for which credentials needs to be returned. :ivar service_name: The name of the service. If not provided, the request will by pass the @@ -695,7 +942,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ListIngressGatewayCredentialsRequest(_model_base.Model): +class ListIngressGatewayCredentialsRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represent ListIngressGatewayCredentials Request object. :ivar service_name: The name of the service. If not provided, the request will by pass the @@ -727,7 +974,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedProxyRequest(_model_base.Model): +class ManagedProxyRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represent ManageProxy Request object. :ivar service: The name of the service. Required. @@ -769,7 +1016,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagedProxyResource(_model_base.Model): +class ManagedProxyResource(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Managed Proxy. :ivar proxy: The short lived proxy name. Required. @@ -802,8 +1049,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_model_base.Model): - """Details of a REST API operation, returned from the Resource Provider Operations API. +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". @@ -859,8 +1106,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OperationDisplay(_model_base.Model): - """Localized display information for and operation. +class OperationDisplay(_Model): + """Localized display information for an operation. :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". @@ -890,7 +1137,7 @@ class OperationDisplay(_model_base.Model): views.""" -class OperationStatusResult(_model_base.Model): +class OperationStatusResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The current status of an async operation. :ivar id: Fully qualified ID for the async operation. @@ -932,7 +1179,7 @@ class OperationStatusResult(_model_base.Model): name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" ) """The end time of the operation.""" - operations: Optional[List["_models.OperationStatusResult"]] = rest_field( + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The operations list.""" @@ -951,7 +1198,7 @@ def __init__( percent_complete: Optional[float] = None, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, - operations: Optional[List["_models.OperationStatusResult"]] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, error: Optional["_models.ErrorDetail"] = None, ) -> None: ... @@ -966,9 +1213,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only + """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -987,7 +1233,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -997,7 +1243,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1011,7 +1257,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicCloudConnector(TrackedResource): +class PublicCloudConnector(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Public Cloud Connector. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1031,19 +1277,23 @@ class PublicCloudConnector(TrackedResource): :vartype location: str :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorProperties + :ivar kind: The kind of the public cloud connector. Known values are: "AWS" and "GCP". + :vartype kind: str or ~azure.mgmt.hybridconnectivity.models.HostType """ properties: Optional["_models.PublicCloudConnectorProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" + kind: Optional[Union[str, "_models.HostType"]] = rest_field(visibility=["read"]) + """The kind of the public cloud connector. Known values are: \"AWS\" and \"GCP\".""" @overload def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.PublicCloudConnectorProperties"] = None, ) -> None: ... @@ -1058,12 +1308,15 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicCloudConnectorProperties(_model_base.Model): +class PublicCloudConnectorProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of public cloud connectors. - :ivar aws_cloud_profile: Cloud profile for AWS. Required. + :ivar aws_cloud_profile: Cloud profile for AWS. :vartype aws_cloud_profile: ~azure.mgmt.hybridconnectivity.models.AwsCloudProfile - :ivar host_type: Host cloud the public cloud connector. Required. "AWS" + :ivar gcp_cloud_profile: Cloud profile for GCP. + :vartype gcp_cloud_profile: ~azure.mgmt.hybridconnectivity.models.GcpCloudProfile + :ivar host_type: Host cloud the public cloud connector. Required. Known values are: "AWS" and + "GCP". :vartype host_type: str or ~azure.mgmt.hybridconnectivity.models.HostType :ivar provisioning_state: The resource provisioning state. Known values are: "Succeeded", "Failed", and "Canceled". @@ -1073,12 +1326,16 @@ class PublicCloudConnectorProperties(_model_base.Model): :vartype connector_primary_identifier: str """ - aws_cloud_profile: "_models.AwsCloudProfile" = rest_field( + aws_cloud_profile: Optional["_models.AwsCloudProfile"] = rest_field( name="awsCloudProfile", visibility=["read", "create", "update", "delete", "query"] ) - """Cloud profile for AWS. Required.""" + """Cloud profile for AWS.""" + gcp_cloud_profile: Optional["_models.GcpCloudProfile"] = rest_field( + name="gcpCloudProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Cloud profile for GCP.""" host_type: Union[str, "_models.HostType"] = rest_field(name="hostType", visibility=["read", "create"]) - """Host cloud the public cloud connector. Required. \"AWS\"""" + """Host cloud the public cloud connector. Required. Known values are: \"AWS\" and \"GCP\".""" provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -1090,8 +1347,9 @@ class PublicCloudConnectorProperties(_model_base.Model): def __init__( self, *, - aws_cloud_profile: "_models.AwsCloudProfile", host_type: Union[str, "_models.HostType"], + aws_cloud_profile: Optional["_models.AwsCloudProfile"] = None, + gcp_cloud_profile: Optional["_models.GcpCloudProfile"] = None, ) -> None: ... @overload @@ -1105,23 +1363,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicCloudConnectorPropertiesUpdate(_model_base.Model): +class PublicCloudConnectorPropertiesUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of public cloud connectors. :ivar aws_cloud_profile: Cloud profile for AWS. :vartype aws_cloud_profile: ~azure.mgmt.hybridconnectivity.models.AwsCloudProfileUpdate + :ivar gcp_cloud_profile: Cloud profile for GCP. + :vartype gcp_cloud_profile: ~azure.mgmt.hybridconnectivity.models.GcpCloudProfileUpdate """ aws_cloud_profile: Optional["_models.AwsCloudProfileUpdate"] = rest_field( name="awsCloudProfile", visibility=["read", "create", "update", "delete", "query"] ) """Cloud profile for AWS.""" + gcp_cloud_profile: Optional["_models.GcpCloudProfileUpdate"] = rest_field( + name="gcpCloudProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Cloud profile for GCP.""" @overload def __init__( self, *, aws_cloud_profile: Optional["_models.AwsCloudProfileUpdate"] = None, + gcp_cloud_profile: Optional["_models.GcpCloudProfileUpdate"] = None, ) -> None: ... @overload @@ -1135,7 +1400,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TrackedResourceUpdate(Resource): +class TrackedResourceUpdate(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -1154,14 +1419,14 @@ class TrackedResourceUpdate(Resource): :vartype tags: dict[str, str] """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" @overload def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1175,7 +1440,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PublicCloudConnectorUpdate(TrackedResourceUpdate): +class PublicCloudConnectorUpdate(TrackedResourceUpdate): # pylint: disable=docstring-keyword-should-match-keyword-only """Public Cloud Connector. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1204,7 +1469,7 @@ class PublicCloudConnectorUpdate(TrackedResourceUpdate): def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.PublicCloudConnectorPropertiesUpdate"] = None, ) -> None: ... @@ -1219,7 +1484,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class RelayNamespaceAccessProperties(_model_base.Model): +class RelayNamespaceAccessProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Azure relay hybrid connection access properties. :ivar namespace_name: The namespace name. Required. @@ -1277,7 +1542,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ServiceConfigurationProperties(_model_base.Model): +class ServiceConfigurationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Service configuration details. :ivar service_name: Name of the service. Required. Known values are: "SSH" and "WAC". @@ -1327,7 +1592,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ServiceConfigurationPropertiesPatch(_model_base.Model): +class ServiceConfigurationPropertiesPatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Service configuration details. :ivar port: The port on which service is enabled. @@ -1355,7 +1620,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ServiceConfigurationResource(ExtensionResource): +class ServiceConfigurationResource(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The service configuration details associated with the target resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1416,7 +1681,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class ServiceConfigurationResourcePatch(_model_base.Model): +class ServiceConfigurationResourcePatch(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The service details under service configuration for the target endpoint resource. :ivar properties: The service configuration properties. @@ -1466,7 +1731,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class SolutionConfiguration(ExtensionResource): +class SolutionConfiguration(ExtensionResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Solution Configuration. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1507,7 +1772,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionConfigurationProperties(_model_base.Model): +class SolutionConfigurationProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Solution configuration resource. :ivar provisioning_state: The resource provisioning state. Known values are: "Succeeded", @@ -1564,7 +1829,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionConfigurationPropertiesUpdate(_model_base.Model): +class SolutionConfigurationPropertiesUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Solution configuration resource. :ivar solution_type: The type of the solution. @@ -1601,7 +1866,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionConfigurationUpdate(ProxyResource): +class SolutionConfigurationUpdate(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Solution Configuration. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1643,11 +1908,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionSettings(_model_base.Model): +class SolutionSettings(_Model): """Solution settings.""" -class SolutionTypeProperties(_model_base.Model): +class SolutionTypeProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of Solution type resource. :ivar solution_type: The name of the solution type. @@ -1656,6 +1921,8 @@ class SolutionTypeProperties(_model_base.Model): :vartype description: str :ivar supported_azure_regions: The locations this solution is supported in. :vartype supported_azure_regions: list[str] + :ivar host_types: The supported host types for the current solution type. + :vartype host_types: list[str or ~azure.mgmt.hybridconnectivity.models.HostType] :ivar solution_settings: Array of solution settings and its description. :vartype solution_settings: list[~azure.mgmt.hybridconnectivity.models.SolutionTypeSettingsProperties] @@ -1667,11 +1934,15 @@ class SolutionTypeProperties(_model_base.Model): """The name of the solution type.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Short description of solution type.""" - supported_azure_regions: Optional[List[str]] = rest_field( + supported_azure_regions: Optional[list[str]] = rest_field( name="supportedAzureRegions", visibility=["read", "create", "update", "delete", "query"] ) """The locations this solution is supported in.""" - solution_settings: Optional[List["_models.SolutionTypeSettingsProperties"]] = rest_field( + host_types: Optional[list[Union[str, "_models.HostType"]]] = rest_field( + name="hostTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The supported host types for the current solution type.""" + solution_settings: Optional[list["_models.SolutionTypeSettingsProperties"]] = rest_field( name="solutionSettings", visibility=["read", "create", "update", "delete", "query"] ) """Array of solution settings and its description.""" @@ -1682,8 +1953,9 @@ def __init__( *, solution_type: Optional[str] = None, description: Optional[str] = None, - supported_azure_regions: Optional[List[str]] = None, - solution_settings: Optional[List["_models.SolutionTypeSettingsProperties"]] = None, + supported_azure_regions: Optional[list[str]] = None, + host_types: Optional[list[Union[str, "_models.HostType"]]] = None, + solution_settings: Optional[list["_models.SolutionTypeSettingsProperties"]] = None, ) -> None: ... @overload @@ -1697,7 +1969,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionTypeResource(ProxyResource): +class SolutionTypeResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Concrete proxy resource types can be created by aliasing this type using a specific property type. @@ -1739,7 +2011,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionTypeSettings(_model_base.Model): +class SolutionTypeSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The properties of Solution Type. :ivar solution_type: The type of the solution. Required. @@ -1774,7 +2046,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SolutionTypeSettingsProperties(_model_base.Model): +class SolutionTypeSettingsProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Represent Solution settings properties description array. :ivar name: The name of the solution setting property. Required. @@ -1787,6 +2059,8 @@ class SolutionTypeSettingsProperties(_model_base.Model): :vartype description: str :ivar allowed_values: Array of allowed values for this solution settings property. Required. :vartype allowed_values: list[str] + :ivar host_types: The supported host types for the current solution setting. Required. + :vartype host_types: list[str or ~azure.mgmt.hybridconnectivity.models.HostType] :ivar default_value: Default value for this solution settings property. Required. :vartype default_value: str """ @@ -1799,10 +2073,14 @@ class SolutionTypeSettingsProperties(_model_base.Model): """Type of the solution setting property, represented as a string. Required.""" description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Description of solution setting property. Required.""" - allowed_values: List[str] = rest_field( + allowed_values: list[str] = rest_field( name="allowedValues", visibility=["read", "create", "update", "delete", "query"] ) """Array of allowed values for this solution settings property. Required.""" + host_types: list[Union[str, "_models.HostType"]] = rest_field( + name="hostTypes", visibility=["read", "create", "update", "delete", "query"] + ) + """The supported host types for the current solution setting. Required.""" default_value: str = rest_field(name="defaultValue", visibility=["read", "create", "update", "delete", "query"]) """Default value for this solution settings property. Required.""" @@ -1814,7 +2092,8 @@ def __init__( display_name: str, type: str, description: str, - allowed_values: List[str], + allowed_values: list[str], + host_types: list[Union[str, "_models.HostType"]], default_value: str, ) -> None: ... @@ -1829,7 +2108,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SystemData(_model_base.Model): +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/models/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/__init__.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/__init__.py index 60101daee8c0..2caf8c623231 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/__init__.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/__init__.py @@ -16,6 +16,7 @@ from ._operations import EndpointsOperations # type: ignore from ._operations import ServiceConfigurationsOperations # type: ignore from ._operations import GenerateAwsTemplateOperations # type: ignore +from ._operations import GenerateGcpTemplateOperations # type: ignore from ._operations import PublicCloudConnectorsOperations # type: ignore from ._operations import SolutionConfigurationsOperations # type: ignore from ._operations import InventoryOperations # type: ignore @@ -30,6 +31,7 @@ "EndpointsOperations", "ServiceConfigurationsOperations", "GenerateAwsTemplateOperations", + "GenerateGcpTemplateOperations", "PublicCloudConnectorsOperations", "SolutionConfigurationsOperations", "InventoryOperations", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_operations.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_operations.py index 2958e40b289b..4ee0e357e049 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_operations.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_operations.py @@ -6,10 +6,10 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from collections.abc import MutableMapping from io import IOBase import json -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -32,18 +32,15 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import HybridConnectivityMgmtClientConfiguration -from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize -from .._serialization import Deserializer, Serializer +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._utils.serialization import Deserializer, Serializer +from .._validation import api_version_validation -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -53,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +69,7 @@ def build_endpoints_get_request(resource_uri: str, endpoint_name: str, **kwargs: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +95,7 @@ def build_endpoints_create_or_update_request(resource_uri: str, endpoint_name: s _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +123,7 @@ def build_endpoints_update_request(resource_uri: str, endpoint_name: str, **kwar _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,12 +147,9 @@ def build_endpoints_update_request(resource_uri: str, endpoint_name: str, **kwar def build_endpoints_delete_request(resource_uri: str, endpoint_name: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) # Construct URL _url = "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}" path_format_arguments = { @@ -168,17 +162,14 @@ def build_endpoints_delete_request(resource_uri: str, endpoint_name: str, **kwar # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_endpoints_list_request(resource_uri: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -205,7 +196,7 @@ def build_endpoints_list_credentials_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +228,7 @@ def build_endpoints_list_ingress_gateway_credentials_request( # pylint: disable _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +262,7 @@ def build_endpoints_list_managed_proxy_details_request( # pylint: disable=name- _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -300,7 +291,7 @@ def build_service_configurations_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -331,7 +322,7 @@ def build_service_configurations_create_orupdate_request( # pylint: disable=nam _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -364,7 +355,7 @@ def build_service_configurations_update_request( # pylint: disable=name-too-lon _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -393,12 +384,9 @@ def build_service_configurations_update_request( # pylint: disable=name-too-lon def build_service_configurations_delete_request( # pylint: disable=name-too-long resource_uri: str, endpoint_name: str, service_configuration_name: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) # Construct URL _url = "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}" path_format_arguments = { @@ -414,10 +402,7 @@ def build_service_configurations_delete_request( # pylint: disable=name-too-lon # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_service_configurations_list_by_endpoint_resource_request( # pylint: disable=name-too-long @@ -426,7 +411,7 @@ def build_service_configurations_list_by_endpoint_resource_request( # pylint: d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -452,7 +437,7 @@ def build_generate_aws_template_post_request(subscription_id: str, **kwargs: Any _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -474,13 +459,40 @@ def build_generate_aws_template_post_request(subscription_id: str, **kwargs: Any return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_generate_gcp_template_post_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridConnectivity/generateGcpTemplate" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + def build_public_cloud_connectors_get_request( # pylint: disable=name-too-long resource_group_name: str, public_cloud_connector: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -509,7 +521,7 @@ def build_public_cloud_connectors_create_or_update_request( # pylint: disable=n _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -540,7 +552,7 @@ def build_public_cloud_connectors_update_request( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -567,12 +579,9 @@ def build_public_cloud_connectors_update_request( # pylint: disable=name-too-lo def build_public_cloud_connectors_delete_request( # pylint: disable=name-too-long resource_group_name: str, public_cloud_connector: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridConnectivity/publicCloudConnectors/{publicCloudConnector}" path_format_arguments = { @@ -586,10 +595,7 @@ def build_public_cloud_connectors_delete_request( # pylint: disable=name-too-lo # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_public_cloud_connectors_list_by_resource_group_request( # pylint: disable=name-too-long @@ -598,7 +604,7 @@ def build_public_cloud_connectors_list_by_resource_group_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -625,7 +631,7 @@ def build_public_cloud_connectors_list_by_subscription_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -651,7 +657,7 @@ def build_public_cloud_connectors_test_permissions_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -679,7 +685,7 @@ def build_solution_configurations_get_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -707,7 +713,7 @@ def build_solution_configurations_create_or_update_request( # pylint: disable=n _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -737,7 +743,7 @@ def build_solution_configurations_update_request( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -763,12 +769,9 @@ def build_solution_configurations_update_request( # pylint: disable=name-too-lo def build_solution_configurations_delete_request( # pylint: disable=name-too-long resource_uri: str, solution_configuration: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) # Construct URL _url = "/{resourceUri}/providers/Microsoft.HybridConnectivity/solutionConfigurations/{solutionConfiguration}" path_format_arguments = { @@ -781,10 +784,7 @@ def build_solution_configurations_delete_request( # pylint: disable=name-too-lo # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) def build_solution_configurations_list_request( # pylint: disable=name-too-long @@ -793,7 +793,7 @@ def build_solution_configurations_list_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -819,7 +819,7 @@ def build_solution_configurations_sync_now_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -848,7 +848,7 @@ def build_inventory_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -876,7 +876,7 @@ def build_inventory_list_by_solution_configuration_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -905,7 +905,7 @@ def build_solution_types_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -933,7 +933,7 @@ def build_solution_types_list_by_resource_group_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -960,7 +960,7 @@ def build_solution_types_list_by_subscription_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-12-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2027-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -980,7 +980,7 @@ def build_solution_types_list_by_subscription_request( # pylint: disable=name-t return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -990,7 +990,7 @@ class Operations: :attr:`operations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -1000,7 +1000,7 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: """List the operations for the provider. :return: An iterator like instance of Operation @@ -1046,7 +1046,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1059,7 +1062,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1075,7 +1081,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1083,7 +1092,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class EndpointsOperations: +class EndpointsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1093,7 +1102,7 @@ class EndpointsOperations: :attr:`endpoints` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -1140,6 +1149,7 @@ def get(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> _models.E } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1154,11 +1164,14 @@ def get(self, resource_uri: str, endpoint_name: str, **kwargs: Any) -> _models.E except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -1199,7 +1212,7 @@ def create_or_update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: JSON, + endpoint_resource: _types.EndpointResource, *, content_type: str = "application/json", **kwargs: Any @@ -1212,7 +1225,7 @@ def create_or_update( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param endpoint_resource: Endpoint details. Required. - :type endpoint_resource: JSON + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.types.EndpointResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1253,7 +1266,7 @@ def create_or_update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: Union[_models.EndpointResource, JSON, IO[bytes]], + endpoint_resource: Union[_models.EndpointResource, _types.EndpointResource, IO[bytes]], **kwargs: Any ) -> _models.EndpointResource: """Create or update the endpoint to the target resource. @@ -1263,10 +1276,10 @@ def create_or_update( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param endpoint_resource: Endpoint details. Is one of the following types: EndpointResource, - JSON, IO[bytes] Required. - :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or JSON or - IO[bytes] + :param endpoint_resource: Endpoint details. Is either a EndpointResource type or a IO[bytes] + type. Required. + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or + ~azure.mgmt.hybridconnectivity.types.EndpointResource or IO[bytes] :return: EndpointResource. The EndpointResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.EndpointResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1306,6 +1319,7 @@ def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1320,11 +1334,14 @@ def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -1365,7 +1382,7 @@ def update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: JSON, + endpoint_resource: _types.EndpointResource, *, content_type: str = "application/json", **kwargs: Any @@ -1378,7 +1395,7 @@ def update( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param endpoint_resource: Endpoint details. Required. - :type endpoint_resource: JSON + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.types.EndpointResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1419,7 +1436,7 @@ def update( self, resource_uri: str, endpoint_name: str, - endpoint_resource: Union[_models.EndpointResource, JSON, IO[bytes]], + endpoint_resource: Union[_models.EndpointResource, _types.EndpointResource, IO[bytes]], **kwargs: Any ) -> _models.EndpointResource: """Update the endpoint to the target resource. @@ -1429,10 +1446,10 @@ def update( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param endpoint_resource: Endpoint details. Is one of the following types: EndpointResource, - JSON, IO[bytes] Required. - :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or JSON or - IO[bytes] + :param endpoint_resource: Endpoint details. Is either a EndpointResource type or a IO[bytes] + type. Required. + :type endpoint_resource: ~azure.mgmt.hybridconnectivity.models.EndpointResource or + ~azure.mgmt.hybridconnectivity.types.EndpointResource or IO[bytes] :return: EndpointResource. The EndpointResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.EndpointResource :raises ~azure.core.exceptions.HttpResponseError: @@ -1472,6 +1489,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1486,11 +1504,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointResource, response.json()) @@ -1548,14 +1569,17 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.EndpointResource"]: + def list(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.EndpointResource"]: """List of endpoints to the target resource. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -1605,7 +1629,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1618,7 +1645,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.EndpointResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.EndpointResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1634,7 +1664,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1677,7 +1710,7 @@ def list_credentials( self, resource_uri: str, endpoint_name: str, - list_credentials_request: Optional[JSON] = None, + list_credentials_request: Optional[_types.ListCredentialsRequest] = None, *, expiresin: Optional[int] = None, content_type: str = "application/json", @@ -1691,7 +1724,7 @@ def list_credentials( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param list_credentials_request: Object of type ListCredentialsRequest. Default value is None. - :type list_credentials_request: JSON + :type list_credentials_request: ~azure.mgmt.hybridconnectivity.types.ListCredentialsRequest :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1739,7 +1772,9 @@ def list_credentials( self, resource_uri: str, endpoint_name: str, - list_credentials_request: Optional[Union[_models.ListCredentialsRequest, JSON, IO[bytes]]] = None, + list_credentials_request: Optional[ + Union[_models.ListCredentialsRequest, _types.ListCredentialsRequest, IO[bytes]] + ] = None, *, expiresin: Optional[int] = None, **kwargs: Any @@ -1751,10 +1786,10 @@ def list_credentials( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param list_credentials_request: Object of type ListCredentialsRequest. Is one of the following - types: ListCredentialsRequest, JSON, IO[bytes] Default value is None. + :param list_credentials_request: Object of type ListCredentialsRequest. Is either a + ListCredentialsRequest type or a IO[bytes] type. Default value is None. :type list_credentials_request: ~azure.mgmt.hybridconnectivity.models.ListCredentialsRequest or - JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.types.ListCredentialsRequest or IO[bytes] :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1774,9 +1809,10 @@ def list_credentials( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if list_credentials_request else None cls: ClsType[_models.EndpointAccessResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if list_credentials_request else None _content = None if isinstance(list_credentials_request, (IOBase, bytes)): _content = list_credentials_request @@ -1801,6 +1837,7 @@ def list_credentials( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -1815,11 +1852,14 @@ def list_credentials( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.EndpointAccessResource, response.json()) @@ -1866,7 +1906,7 @@ def list_ingress_gateway_credentials( self, resource_uri: str, endpoint_name: str, - list_ingress_gateway_credentials_request: Optional[JSON] = None, + list_ingress_gateway_credentials_request: Optional[_types.ListIngressGatewayCredentialsRequest] = None, *, expiresin: Optional[int] = None, content_type: str = "application/json", @@ -1881,7 +1921,8 @@ def list_ingress_gateway_credentials( :type endpoint_name: str :param list_ingress_gateway_credentials_request: Object of type ListIngressGatewayCredentialsRequest. Default value is None. - :type list_ingress_gateway_credentials_request: JSON + :type list_ingress_gateway_credentials_request: + ~azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1931,7 +1972,7 @@ def list_ingress_gateway_credentials( resource_uri: str, endpoint_name: str, list_ingress_gateway_credentials_request: Optional[ - Union[_models.ListIngressGatewayCredentialsRequest, JSON, IO[bytes]] + Union[_models.ListIngressGatewayCredentialsRequest, _types.ListIngressGatewayCredentialsRequest, IO[bytes]] ] = None, *, expiresin: Optional[int] = None, @@ -1945,10 +1986,11 @@ def list_ingress_gateway_credentials( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param list_ingress_gateway_credentials_request: Object of type - ListIngressGatewayCredentialsRequest. Is one of the following types: - ListIngressGatewayCredentialsRequest, JSON, IO[bytes] Default value is None. + ListIngressGatewayCredentialsRequest. Is either a ListIngressGatewayCredentialsRequest type or + a IO[bytes] type. Default value is None. :type list_ingress_gateway_credentials_request: - ~azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ListIngressGatewayCredentialsRequest or + ~azure.mgmt.hybridconnectivity.types.ListIngressGatewayCredentialsRequest or IO[bytes] :keyword expiresin: The is how long the endpoint access token is valid (in seconds). Default value is None. :paramtype expiresin: int @@ -1968,9 +2010,10 @@ def list_ingress_gateway_credentials( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + content_type = content_type if list_ingress_gateway_credentials_request else None cls: ClsType[_models.IngressGatewayResource] = kwargs.pop("cls", None) - content_type = content_type or "application/json" + content_type = content_type or "application/json" if list_ingress_gateway_credentials_request else None _content = None if isinstance(list_ingress_gateway_credentials_request, (IOBase, bytes)): _content = list_ingress_gateway_credentials_request @@ -1995,6 +2038,7 @@ def list_ingress_gateway_credentials( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2009,11 +2053,14 @@ def list_ingress_gateway_credentials( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.IngressGatewayResource, response.json()) @@ -2054,7 +2101,7 @@ def list_managed_proxy_details( self, resource_uri: str, endpoint_name: str, - managed_proxy_request: JSON, + managed_proxy_request: _types.ManagedProxyRequest, *, content_type: str = "application/json", **kwargs: Any @@ -2067,7 +2114,7 @@ def list_managed_proxy_details( :param endpoint_name: The endpoint name. Required. :type endpoint_name: str :param managed_proxy_request: Object of type ManagedProxyRequest. Required. - :type managed_proxy_request: JSON + :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.types.ManagedProxyRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2108,7 +2155,7 @@ def list_managed_proxy_details( self, resource_uri: str, endpoint_name: str, - managed_proxy_request: Union[_models.ManagedProxyRequest, JSON, IO[bytes]], + managed_proxy_request: Union[_models.ManagedProxyRequest, _types.ManagedProxyRequest, IO[bytes]], **kwargs: Any ) -> _models.ManagedProxyResource: """Fetches the managed proxy details. @@ -2118,10 +2165,10 @@ def list_managed_proxy_details( :type resource_uri: str :param endpoint_name: The endpoint name. Required. :type endpoint_name: str - :param managed_proxy_request: Object of type ManagedProxyRequest. Is one of the following - types: ManagedProxyRequest, JSON, IO[bytes] Required. - :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.models.ManagedProxyRequest or JSON - or IO[bytes] + :param managed_proxy_request: Object of type ManagedProxyRequest. Is either a + ManagedProxyRequest type or a IO[bytes] type. Required. + :type managed_proxy_request: ~azure.mgmt.hybridconnectivity.models.ManagedProxyRequest or + ~azure.mgmt.hybridconnectivity.types.ManagedProxyRequest or IO[bytes] :return: ManagedProxyResource. The ManagedProxyResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ManagedProxyResource :raises ~azure.core.exceptions.HttpResponseError: @@ -2161,6 +2208,7 @@ def list_managed_proxy_details( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2175,11 +2223,14 @@ def list_managed_proxy_details( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ManagedProxyResource, response.json()) @@ -2189,7 +2240,7 @@ def list_managed_proxy_details( return deserialized # type: ignore -class ServiceConfigurationsOperations: +class ServiceConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2199,7 +2250,7 @@ class ServiceConfigurationsOperations: :attr:`service_configurations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -2252,6 +2303,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2266,11 +2318,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -2317,7 +2372,7 @@ def create_orupdate( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: JSON, + service_configuration_resource: _types.ServiceConfigurationResource, *, content_type: str = "application/json", **kwargs: Any @@ -2332,7 +2387,8 @@ def create_orupdate( :param service_configuration_name: The service name. Required. :type service_configuration_name: str :param service_configuration_resource: Service details. Required. - :type service_configuration_resource: JSON + :type service_configuration_resource: + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2379,7 +2435,9 @@ def create_orupdate( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: Union[_models.ServiceConfigurationResource, JSON, IO[bytes]], + service_configuration_resource: Union[ + _models.ServiceConfigurationResource, _types.ServiceConfigurationResource, IO[bytes] + ], **kwargs: Any ) -> _models.ServiceConfigurationResource: """Create or update a service in serviceConfiguration for the endpoint resource. @@ -2391,10 +2449,11 @@ def create_orupdate( :type endpoint_name: str :param service_configuration_name: The service name. Required. :type service_configuration_name: str - :param service_configuration_resource: Service details. Is one of the following types: - ServiceConfigurationResource, JSON, IO[bytes] Required. + :param service_configuration_resource: Service details. Is either a + ServiceConfigurationResource type or a IO[bytes] type. Required. :type service_configuration_resource: - ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource or + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResource or IO[bytes] :return: ServiceConfigurationResource. The ServiceConfigurationResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource @@ -2436,6 +2495,7 @@ def create_orupdate( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2450,11 +2510,14 @@ def create_orupdate( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -2501,7 +2564,7 @@ def update( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: JSON, + service_configuration_resource: _types.ServiceConfigurationResourcePatch, *, content_type: str = "application/json", **kwargs: Any @@ -2516,7 +2579,8 @@ def update( :param service_configuration_name: The service name. Required. :type service_configuration_name: str :param service_configuration_resource: Service details. Required. - :type service_configuration_resource: JSON + :type service_configuration_resource: + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2563,7 +2627,9 @@ def update( resource_uri: str, endpoint_name: str, service_configuration_name: str, - service_configuration_resource: Union[_models.ServiceConfigurationResourcePatch, JSON, IO[bytes]], + service_configuration_resource: Union[ + _models.ServiceConfigurationResourcePatch, _types.ServiceConfigurationResourcePatch, IO[bytes] + ], **kwargs: Any ) -> _models.ServiceConfigurationResource: """Update the service details in the service configurations of the target resource. @@ -2575,10 +2641,11 @@ def update( :type endpoint_name: str :param service_configuration_name: The service name. Required. :type service_configuration_name: str - :param service_configuration_resource: Service details. Is one of the following types: - ServiceConfigurationResourcePatch, JSON, IO[bytes] Required. + :param service_configuration_resource: Service details. Is either a + ServiceConfigurationResourcePatch type or a IO[bytes] type. Required. :type service_configuration_resource: - ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch or JSON or IO[bytes] + ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResourcePatch or + ~azure.mgmt.hybridconnectivity.types.ServiceConfigurationResourcePatch or IO[bytes] :return: ServiceConfigurationResource. The ServiceConfigurationResource is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.ServiceConfigurationResource @@ -2620,6 +2687,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2634,11 +2702,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.ServiceConfigurationResource, response.json()) @@ -2699,7 +2770,10 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -2708,7 +2782,7 @@ def delete( # pylint: disable=inconsistent-return-statements @distributed_trace def list_by_endpoint_resource( self, resource_uri: str, endpoint_name: str, **kwargs: Any - ) -> Iterable["_models.ServiceConfigurationResource"]: + ) -> ItemPaged["_models.ServiceConfigurationResource"]: """Lists of all the services associated with endpoint resource. API to enumerate registered services in service configurations under a Endpoint Resource. @@ -2764,7 +2838,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2777,7 +2854,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.ServiceConfigurationResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.ServiceConfigurationResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2793,7 +2873,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2801,7 +2884,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class GenerateAwsTemplateOperations: +class GenerateAwsTemplateOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2811,7 +2894,7 @@ class GenerateAwsTemplateOperations: :attr:`generate_aws_template` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -2827,7 +2910,7 @@ def post( *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to @@ -2837,32 +2920,39 @@ def post( :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def post( - self, generate_aws_template_request: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + self, + generate_aws_template_request: _types.GenerateAwsTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. Required. - :type generate_aws_template_request: JSON + :type generate_aws_template_request: + ~azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def post( self, generate_aws_template_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Any: + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to @@ -2871,24 +2961,31 @@ def post( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: any - :rtype: any + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def post( - self, generate_aws_template_request: Union[_models.GenerateAwsTemplateRequest, JSON, IO[bytes]], **kwargs: Any - ) -> Any: + self, + generate_aws_template_request: Union[ + _models.GenerateAwsTemplateRequest, _types.GenerateAwsTemplateRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.GenerateAwsTemplateResponse: """Retrieve AWS Cloud Formation template. :param generate_aws_template_request: ConnectorId and SolutionTypes and their properties to - Generate AWS CFT Template. Is one of the following types: GenerateAwsTemplateRequest, JSON, - IO[bytes] Required. + Generate AWS CFT Template. Is either a GenerateAwsTemplateRequest type or a IO[bytes] type. + Required. :type generate_aws_template_request: - ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest or JSON or IO[bytes] - :return: any - :rtype: any + ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateRequest or + ~azure.mgmt.hybridconnectivity.types.GenerateAwsTemplateRequest or IO[bytes] + :return: GenerateAwsTemplateResponse. The GenerateAwsTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateAwsTemplateResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2903,7 +3000,7 @@ def post( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Any] = kwargs.pop("cls", None) + cls: ClsType[_models.GenerateAwsTemplateResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2925,6 +3022,182 @@ def post( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GenerateAwsTemplateResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class GenerateGcpTemplateOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.hybridconnectivity.HybridConnectivityMgmtClient`'s + :attr:`generate_gcp_template` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: HybridConnectivityMgmtClientConfiguration = ( + input_args.pop(0) if input_args else kwargs.pop("config") + ) + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def post( + self, + generate_gcp_template_request: _models.GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, + generate_gcp_template_request: _types.GenerateGcpTemplateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, generate_gcp_template_request: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Required. + :type generate_gcp_template_request: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2027-01-01", + params_added_on={"2027-01-01": ["api_version", "subscription_id", "content_type", "accept"]}, + api_versions_list=["2027-01-01"], + ) + def post( + self, + generate_gcp_template_request: Union[ + _models.GenerateGcpTemplateRequest, _types.GenerateGcpTemplateRequest, IO[bytes] + ], + **kwargs: Any + ) -> _models.GenerateGcpTemplateResponse: + """Retrieve GCP Access Control template. + + :param generate_gcp_template_request: ConnectorId and SolutionTypes and their properties to + Generate GCP Access Control Template. Is either a GenerateGcpTemplateRequest type or a + IO[bytes] type. Required. + :type generate_gcp_template_request: + ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateRequest or + ~azure.mgmt.hybridconnectivity.types.GenerateGcpTemplateRequest or IO[bytes] + :return: GenerateGcpTemplateResponse. The GenerateGcpTemplateResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.hybridconnectivity.models.GenerateGcpTemplateResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GenerateGcpTemplateResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(generate_gcp_template_request, (IOBase, bytes)): + _content = generate_gcp_template_request + else: + _content = json.dumps(generate_gcp_template_request, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_generate_gcp_template_post_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -2939,13 +3212,16 @@ def post( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(Any, response.json()) + deserialized = _deserialize(_models.GenerateGcpTemplateResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2953,7 +3229,7 @@ def post( return deserialized # type: ignore -class PublicCloudConnectorsOperations: +class PublicCloudConnectorsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2963,7 +3239,7 @@ class PublicCloudConnectorsOperations: :attr:`public_cloud_connectors` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -3011,6 +3287,7 @@ def get(self, resource_group_name: str, public_cloud_connector: str, **kwargs: A } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3025,11 +3302,14 @@ def get(self, resource_group_name: str, public_cloud_connector: str, **kwargs: A except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PublicCloudConnector, response.json()) @@ -3042,7 +3322,7 @@ def _create_or_update_initial( self, resource_group_name: str, public_cloud_connector: str, - resource: Union[_models.PublicCloudConnector, JSON, IO[bytes]], + resource: Union[_models.PublicCloudConnector, _types.PublicCloudConnector, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3081,6 +3361,7 @@ def _create_or_update_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3094,7 +3375,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3104,7 +3388,7 @@ def _create_or_update_initial( ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3145,7 +3429,7 @@ def begin_create_or_update( self, resource_group_name: str, public_cloud_connector: str, - resource: JSON, + resource: _types.PublicCloudConnector, *, content_type: str = "application/json", **kwargs: Any @@ -3158,7 +3442,7 @@ def begin_create_or_update( :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.hybridconnectivity.types.PublicCloudConnector :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3203,7 +3487,7 @@ def begin_create_or_update( self, resource_group_name: str, public_cloud_connector: str, - resource: Union[_models.PublicCloudConnector, JSON, IO[bytes]], + resource: Union[_models.PublicCloudConnector, _types.PublicCloudConnector, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.PublicCloudConnector]: """Create a PublicCloudConnector. @@ -3213,9 +3497,10 @@ def begin_create_or_update( :type resource_group_name: str :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str - :param resource: Resource create parameters. Is one of the following types: - PublicCloudConnector, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a PublicCloudConnector type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector or + ~azure.mgmt.hybridconnectivity.types.PublicCloudConnector or IO[bytes] :return: An instance of LROPoller that returns PublicCloudConnector. The PublicCloudConnector is compatible with MutableMapping :rtype: @@ -3306,7 +3591,7 @@ def update( self, resource_group_name: str, public_cloud_connector: str, - properties: JSON, + properties: _types.PublicCloudConnectorUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -3319,7 +3604,7 @@ def update( :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3360,7 +3645,7 @@ def update( self, resource_group_name: str, public_cloud_connector: str, - properties: Union[_models.PublicCloudConnectorUpdate, JSON, IO[bytes]], + properties: Union[_models.PublicCloudConnectorUpdate, _types.PublicCloudConnectorUpdate, IO[bytes]], **kwargs: Any ) -> _models.PublicCloudConnector: """Update a PublicCloudConnector. @@ -3370,10 +3655,10 @@ def update( :type resource_group_name: str :param public_cloud_connector: Represent public cloud connectors resource. Required. :type public_cloud_connector: str - :param properties: The resource properties to be updated. Is one of the following types: - PublicCloudConnectorUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + PublicCloudConnectorUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnectorUpdate or + ~azure.mgmt.hybridconnectivity.types.PublicCloudConnectorUpdate or IO[bytes] :return: PublicCloudConnector. The PublicCloudConnector is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.PublicCloudConnector :raises ~azure.core.exceptions.HttpResponseError: @@ -3414,6 +3699,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3428,11 +3714,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.PublicCloudConnector, response.json()) @@ -3491,7 +3780,10 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -3500,7 +3792,7 @@ def delete( # pylint: disable=inconsistent-return-statements @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.PublicCloudConnector"]: + ) -> ItemPaged["_models.PublicCloudConnector"]: """List PublicCloudConnector resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3552,7 +3844,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3565,7 +3860,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PublicCloudConnector], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PublicCloudConnector], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3581,7 +3879,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3589,7 +3890,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.PublicCloudConnector"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.PublicCloudConnector"]: """List PublicCloudConnector resources by subscription ID. :return: An iterator like instance of PublicCloudConnector @@ -3637,7 +3938,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3650,7 +3954,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PublicCloudConnector], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PublicCloudConnector], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3666,7 +3973,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3702,6 +4012,7 @@ def _test_permissions_initial( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3715,7 +4026,10 @@ def _test_permissions_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3723,7 +4037,7 @@ def _test_permissions_initial( response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3767,14 +4081,10 @@ def begin_test_permissions( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -3801,7 +4111,7 @@ def get_long_running_output(pipeline_response): ) -class SolutionConfigurationsOperations: +class SolutionConfigurationsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3811,7 +4121,7 @@ class SolutionConfigurationsOperations: :attr:`solution_configurations` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -3858,6 +4168,7 @@ def get(self, resource_uri: str, solution_configuration: str, **kwargs: Any) -> } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -3872,11 +4183,14 @@ def get(self, resource_uri: str, solution_configuration: str, **kwargs: Any) -> except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -3917,7 +4231,7 @@ def create_or_update( self, resource_uri: str, solution_configuration: str, - resource: JSON, + resource: _types.SolutionConfiguration, *, content_type: str = "application/json", **kwargs: Any @@ -3930,7 +4244,7 @@ def create_or_update( :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.hybridconnectivity.types.SolutionConfiguration :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3971,7 +4285,7 @@ def create_or_update( self, resource_uri: str, solution_configuration: str, - resource: Union[_models.SolutionConfiguration, JSON, IO[bytes]], + resource: Union[_models.SolutionConfiguration, _types.SolutionConfiguration, IO[bytes]], **kwargs: Any ) -> _models.SolutionConfiguration: """Create a SolutionConfiguration. @@ -3981,10 +4295,10 @@ def create_or_update( :type resource_uri: str :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str - :param resource: Resource create parameters. Is one of the following types: - SolutionConfiguration, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration or JSON or - IO[bytes] + :param resource: Resource create parameters. Is either a SolutionConfiguration type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration or + ~azure.mgmt.hybridconnectivity.types.SolutionConfiguration or IO[bytes] :return: SolutionConfiguration. The SolutionConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration :raises ~azure.core.exceptions.HttpResponseError: @@ -4024,6 +4338,7 @@ def create_or_update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4038,11 +4353,14 @@ def create_or_update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -4083,7 +4401,7 @@ def update( self, resource_uri: str, solution_configuration: str, - properties: JSON, + properties: _types.SolutionConfigurationUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -4096,7 +4414,7 @@ def update( :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4137,7 +4455,7 @@ def update( self, resource_uri: str, solution_configuration: str, - properties: Union[_models.SolutionConfigurationUpdate, JSON, IO[bytes]], + properties: Union[_models.SolutionConfigurationUpdate, _types.SolutionConfigurationUpdate, IO[bytes]], **kwargs: Any ) -> _models.SolutionConfiguration: """Update a SolutionConfiguration. @@ -4147,10 +4465,10 @@ def update( :type resource_uri: str :param solution_configuration: Represent Solution Configuration Resource. Required. :type solution_configuration: str - :param properties: The resource properties to be updated. Is one of the following types: - SolutionConfigurationUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + SolutionConfigurationUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.hybridconnectivity.models.SolutionConfigurationUpdate or + ~azure.mgmt.hybridconnectivity.types.SolutionConfigurationUpdate or IO[bytes] :return: SolutionConfiguration. The SolutionConfiguration is compatible with MutableMapping :rtype: ~azure.mgmt.hybridconnectivity.models.SolutionConfiguration :raises ~azure.core.exceptions.HttpResponseError: @@ -4190,6 +4508,7 @@ def update( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4204,11 +4523,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionConfiguration, response.json()) @@ -4266,14 +4588,17 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list(self, resource_uri: str, **kwargs: Any) -> Iterable["_models.SolutionConfiguration"]: + def list(self, resource_uri: str, **kwargs: Any) -> ItemPaged["_models.SolutionConfiguration"]: """List SolutionConfiguration resources by parent. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -4324,7 +4649,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4337,7 +4665,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionConfiguration], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionConfiguration], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4353,7 +4684,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4386,6 +4720,7 @@ def _sync_now_initial(self, resource_uri: str, solution_configuration: str, **kw } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4399,7 +4734,10 @@ def _sync_now_initial(self, resource_uri: str, solution_configuration: str, **kw except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4407,7 +4745,7 @@ def _sync_now_initial(self, resource_uri: str, solution_configuration: str, **kw response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4451,14 +4789,10 @@ def begin_sync_now( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response_headers = {} response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - deserialized = _deserialize(_models.OperationStatusResult, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized path_format_arguments = { @@ -4485,7 +4819,7 @@ def get_long_running_output(pipeline_response): ) -class InventoryOperations: +class InventoryOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4495,7 +4829,7 @@ class InventoryOperations: :attr:`inventory` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -4547,6 +4881,7 @@ def get( } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4561,11 +4896,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.InventoryResource, response.json()) @@ -4577,7 +4915,7 @@ def get( @distributed_trace def list_by_solution_configuration( self, resource_uri: str, solution_configuration: str, **kwargs: Any - ) -> Iterable["_models.InventoryResource"]: + ) -> ItemPaged["_models.InventoryResource"]: """List InventoryResource resources by SolutionConfiguration. :param resource_uri: The fully qualified Azure Resource manager identifier of the resource. @@ -4630,7 +4968,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4643,7 +4984,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.InventoryResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.InventoryResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4659,7 +5003,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4667,7 +5014,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class SolutionTypesOperations: +class SolutionTypesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4677,7 +5024,7 @@ class SolutionTypesOperations: :attr:`solution_types` attribute. """ - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") self._config: HybridConnectivityMgmtClientConfiguration = ( @@ -4725,6 +5072,7 @@ def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) -> _m } _request.url = self._client.format_url(_request.url, **path_format_arguments) + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -4739,11 +5087,14 @@ def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) -> _m except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SolutionTypeResource, response.json()) @@ -4755,7 +5106,7 @@ def get(self, resource_group_name: str, solution_type: str, **kwargs: Any) -> _m @distributed_trace def list_by_resource_group( self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.SolutionTypeResource"]: + ) -> ItemPaged["_models.SolutionTypeResource"]: """List SolutionTypeResource resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -4807,7 +5158,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4820,7 +5174,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTypeResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionTypeResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4836,7 +5193,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -4844,7 +5204,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SolutionTypeResource"]: + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.SolutionTypeResource"]: """List SolutionTypeResource resources by subscription ID. :return: An iterator like instance of SolutionTypeResource @@ -4892,7 +5252,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4905,7 +5268,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SolutionTypeResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SolutionTypeResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4921,7 +5287,10 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response.json()) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_patch.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_patch.py index f7dd32510333..ea765788358a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_patch.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/operations/_patch.py @@ -1,14 +1,14 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/types.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/types.py new file mode 100644 index 000000000000..5669f7fb686e --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/azure/mgmt/hybridconnectivity/types.py @@ -0,0 +1,694 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import ( + CreatedByType, + GcpTemplateFormat, + HostType, + ProvisioningState, + ResourceProvisioningState, + ServiceName, + SolutionConfigurationStatus, + Type, + ) + + +class AwsCloudProfile(TypedDict, total=False): + """cloud profile for AWS. + + :ivar accountId: Account id for the AWS account. Required. + :vartype accountId: str + :ivar excludedAccounts: List of AWS accounts which need to be excluded. + :vartype excludedAccounts: list[str] + :ivar isOrganizationalAccount: Boolean value that indicates whether the account is + organizational or not. True represents organization account, whereas false represents a single + account. + :vartype isOrganizationalAccount: bool + """ + + accountId: Required[str] + """Account id for the AWS account. Required.""" + excludedAccounts: list[str] + """List of AWS accounts which need to be excluded.""" + isOrganizationalAccount: bool + """Boolean value that indicates whether the account is organizational or not. True represents + organization account, whereas false represents a single account.""" + + +class AwsCloudProfileUpdate(TypedDict, total=False): + """cloud profile for AWS. + + :ivar excludedAccounts: List of AWS accounts which need to be excluded. + :vartype excludedAccounts: list[str] + """ + + excludedAccounts: list[str] + """List of AWS accounts which need to be excluded.""" + + +class EndpointProperties(TypedDict, total=False): + """Endpoint details. + + :ivar type: The type of endpoint. Required. Known values are: "default" and "custom". + :vartype type: Union[str, "Type"] + :ivar resourceId: The resource Id of the connectivity endpoint (optional). + :vartype resourceId: str + :ivar provisioningState: The resource provisioning state. + :vartype provisioningState: str + """ + + type: Required[Union[str, "Type"]] + """The type of endpoint. Required. Known values are: \"default\" and \"custom\".""" + resourceId: str + """The resource Id of the connectivity endpoint (optional).""" + provisioningState: str + """The resource provisioning state.""" + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ExtensionResource(Resource): + """The base extension resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class EndpointResource(ExtensionResource): + """The endpoint for the target resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The endpoint properties. + :vartype properties: "EndpointProperties" + """ + + properties: "EndpointProperties" + """The endpoint properties.""" + + +class GcpCloudProfile(TypedDict, total=False): + """cloud profile for GCP. + + :ivar projectProperties: The project properties of the GCP project. + :vartype projectProperties: "GcpProjectProperties" + :ivar organizationProperties: The organization properties of the GCP organization. + :vartype organizationProperties: "GcpOrganizationProperties" + """ + + projectProperties: "GcpProjectProperties" + """The project properties of the GCP project.""" + organizationProperties: "GcpOrganizationProperties" + """The organization properties of the GCP organization.""" + + +class GcpCloudProfileUpdate(TypedDict, total=False): + """cloud profile for GCP. + + :ivar organizationProperties: The organization properties of the GCP organization. + :vartype organizationProperties: "GcpOrganizationPropertiesUpdate" + """ + + organizationProperties: "GcpOrganizationPropertiesUpdate" + """The organization properties of the GCP organization.""" + + +class GcpOrganizationProperties(TypedDict, total=False): + """GCP organization properties. + + :ivar organizationId: The organization id of the GCP organization. Required. + :vartype organizationId: str + :ivar managementProjectNumber: The project number of the management project under the GCP + organization. Required. + :vartype managementProjectNumber: str + :ivar managementProjectId: The project Id of the management project under the GCP organization. + Required. + :vartype managementProjectId: str + :ivar excludedProjectNumbers: List of GCP projects which need to be excluded. + :vartype excludedProjectNumbers: list[str] + :ivar excludedFolderIds: List of GCP folders which need to be excluded. + :vartype excludedFolderIds: list[str] + """ + + organizationId: Required[str] + """The organization id of the GCP organization. Required.""" + managementProjectNumber: Required[str] + """The project number of the management project under the GCP organization. Required.""" + managementProjectId: Required[str] + """The project Id of the management project under the GCP organization. Required.""" + excludedProjectNumbers: list[str] + """List of GCP projects which need to be excluded.""" + excludedFolderIds: list[str] + """List of GCP folders which need to be excluded.""" + + +class GcpOrganizationPropertiesUpdate(TypedDict, total=False): + """GCP organization properties for update. + + :ivar excludedProjectNumbers: List of GCP projects which need to be excluded. + :vartype excludedProjectNumbers: list[str] + :ivar excludedFolderIds: List of GCP folders which need to be excluded. + :vartype excludedFolderIds: list[str] + """ + + excludedProjectNumbers: list[str] + """List of GCP projects which need to be excluded.""" + excludedFolderIds: list[str] + """List of GCP folders which need to be excluded.""" + + +class GcpProjectProperties(TypedDict, total=False): + """GCP project properties. + + :ivar projectNumber: The project number of the GCP project. Required. + :vartype projectNumber: str + :ivar projectId: The project id of the GCP project. Required. + :vartype projectId: str + """ + + projectNumber: Required[str] + """The project number of the GCP project. Required.""" + projectId: Required[str] + """The project id of the GCP project. Required.""" + + +class GenerateAwsTemplateRequest(TypedDict, total=False): + """ConnectorId and SolutionTypes and their properties to Generate AWS CFT Template. + + :ivar connectorId: The name of public cloud connector. Required. + :vartype connectorId: str + :ivar solutionTypes: The list of solution types and their settings. + :vartype solutionTypes: list["SolutionTypeSettings"] + """ + + connectorId: Required[str] + """The name of public cloud connector. Required.""" + solutionTypes: list["SolutionTypeSettings"] + """The list of solution types and their settings.""" + + +class GenerateGcpTemplateRequest(TypedDict, total=False): + """ConnectorId and SolutionTypes and their properties to Generate GCP Access Control Template. + + :ivar connectorId: The name of public cloud connector. Required. + :vartype connectorId: str + :ivar solutionTypes: The list of solution types and their settings. + :vartype solutionTypes: list["SolutionTypeSettings"] + :ivar gcpCloudProfile: The GCP cloud profile. + :vartype gcpCloudProfile: "GcpCloudProfile" + :ivar gcpTemplateFormat: Optional template output format. Defaults to 'terraform' if not + provided. Known values are: "terraform" and "shellscript". + :vartype gcpTemplateFormat: Union[str, "GcpTemplateFormat"] + """ + + connectorId: Required[str] + """The name of public cloud connector. Required.""" + solutionTypes: list["SolutionTypeSettings"] + """The list of solution types and their settings.""" + gcpCloudProfile: "GcpCloudProfile" + """The GCP cloud profile.""" + gcpTemplateFormat: Union[str, "GcpTemplateFormat"] + """Optional template output format. Defaults to 'terraform' if not provided. Known values are: + \"terraform\" and \"shellscript\".""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class ListCredentialsRequest(TypedDict, total=False): + """The details of the service for which credentials needs to be returned. + + :ivar serviceName: The name of the service. If not provided, the request will by pass the + generation of service configuration token. Known values are: "SSH" and "WAC". + :vartype serviceName: Union[str, "ServiceName"] + """ + + serviceName: Union[str, "ServiceName"] + """The name of the service. If not provided, the request will by pass the generation of service + configuration token. Known values are: \"SSH\" and \"WAC\".""" + + +class ListIngressGatewayCredentialsRequest(TypedDict, total=False): + """Represent ListIngressGatewayCredentials Request object. + + :ivar serviceName: The name of the service. If not provided, the request will by pass the + generation of service configuration token. Known values are: "SSH" and "WAC". + :vartype serviceName: Union[str, "ServiceName"] + """ + + serviceName: Union[str, "ServiceName"] + """The name of the service. If not provided, the request will by pass the generation of service + configuration token. Known values are: \"SSH\" and \"WAC\".""" + + +class ManagedProxyRequest(TypedDict, total=False): + """Represent ManageProxy Request object. + + :ivar service: The name of the service. Required. + :vartype service: str + :ivar hostname: The target host name. + :vartype hostname: str + :ivar serviceName: The name of the service. It is an optional property, if not provided, + service configuration tokens issue code would be by passed. Known values are: "SSH" and "WAC". + :vartype serviceName: Union[str, "ServiceName"] + """ + + service: Required[str] + """The name of the service. Required.""" + hostname: str + """The target host name.""" + serviceName: Union[str, "ServiceName"] + """The name of the service. It is an optional property, if not provided, service configuration + tokens issue code would be by passed. Known values are: \"SSH\" and \"WAC\".""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class PublicCloudConnector(TrackedResource): + """Public Cloud Connector. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "PublicCloudConnectorProperties" + :ivar kind: The kind of the public cloud connector. Known values are: "AWS" and "GCP". + :vartype kind: Union[str, "HostType"] + """ + + properties: "PublicCloudConnectorProperties" + """The resource-specific properties for this resource.""" + kind: Union[str, "HostType"] + """The kind of the public cloud connector. Known values are: \"AWS\" and \"GCP\".""" + + +class PublicCloudConnectorProperties(TypedDict, total=False): + """Properties of public cloud connectors. + + :ivar awsCloudProfile: Cloud profile for AWS. + :vartype awsCloudProfile: "AwsCloudProfile" + :ivar gcpCloudProfile: Cloud profile for GCP. + :vartype gcpCloudProfile: "GcpCloudProfile" + :ivar hostType: Host cloud the public cloud connector. Required. Known values are: "AWS" and + "GCP". + :vartype hostType: Union[str, "HostType"] + :ivar provisioningState: The resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioningState: Union[str, "ResourceProvisioningState"] + :ivar connectorPrimaryIdentifier: Connector primary identifier. + :vartype connectorPrimaryIdentifier: str + """ + + awsCloudProfile: "AwsCloudProfile" + """Cloud profile for AWS.""" + gcpCloudProfile: "GcpCloudProfile" + """Cloud profile for GCP.""" + hostType: Required[Union[str, "HostType"]] + """Host cloud the public cloud connector. Required. Known values are: \"AWS\" and \"GCP\".""" + provisioningState: Union[str, "ResourceProvisioningState"] + """The resource provisioning state. Known values are: \"Succeeded\", \"Failed\", and \"Canceled\".""" + connectorPrimaryIdentifier: str + """Connector primary identifier.""" + + +class PublicCloudConnectorPropertiesUpdate(TypedDict, total=False): + """Properties of public cloud connectors. + + :ivar awsCloudProfile: Cloud profile for AWS. + :vartype awsCloudProfile: "AwsCloudProfileUpdate" + :ivar gcpCloudProfile: Cloud profile for GCP. + :vartype gcpCloudProfile: "GcpCloudProfileUpdate" + """ + + awsCloudProfile: "AwsCloudProfileUpdate" + """Cloud profile for AWS.""" + gcpCloudProfile: "GcpCloudProfileUpdate" + """Cloud profile for GCP.""" + + +class TrackedResourceUpdate(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: dict[str, str] + """Resource tags.""" + + +class PublicCloudConnectorUpdate(TrackedResourceUpdate): + """Public Cloud Connector. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "PublicCloudConnectorPropertiesUpdate" + """ + + properties: "PublicCloudConnectorPropertiesUpdate" + """The resource-specific properties for this resource.""" + + +class ServiceConfigurationProperties(TypedDict, total=False): + """Service configuration details. + + :ivar serviceName: Name of the service. Required. Known values are: "SSH" and "WAC". + :vartype serviceName: Union[str, "ServiceName"] + :ivar resourceId: The resource Id of the connectivity endpoint (optional). + :vartype resourceId: str + :ivar port: The port on which service is enabled. + :vartype port: int + :ivar provisioningState: The resource provisioning state. Known values are: "Succeeded", + "Creating", "Updating", "Failed", and "Canceled". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + serviceName: Required[Union[str, "ServiceName"]] + """Name of the service. Required. Known values are: \"SSH\" and \"WAC\".""" + resourceId: str + """The resource Id of the connectivity endpoint (optional).""" + port: int + """The port on which service is enabled.""" + provisioningState: Union[str, "ProvisioningState"] + """The resource provisioning state. Known values are: \"Succeeded\", \"Creating\", \"Updating\", + \"Failed\", and \"Canceled\".""" + + +class ServiceConfigurationPropertiesPatch(TypedDict, total=False): + """Service configuration details. + + :ivar port: The port on which service is enabled. + :vartype port: int + """ + + port: int + """The port on which service is enabled.""" + + +class ServiceConfigurationResource(ExtensionResource): + """The service configuration details associated with the target resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The service configuration properties. + :vartype properties: "ServiceConfigurationProperties" + """ + + properties: "ServiceConfigurationProperties" + """The service configuration properties.""" + + +class ServiceConfigurationResourcePatch(TypedDict, total=False): + """The service details under service configuration for the target endpoint resource. + + :ivar properties: The service configuration properties. + :vartype properties: "ServiceConfigurationPropertiesPatch" + """ + + properties: "ServiceConfigurationPropertiesPatch" + """The service configuration properties.""" + + +class SolutionConfiguration(ExtensionResource): + """Solution Configuration. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SolutionConfigurationProperties" + """ + + properties: "SolutionConfigurationProperties" + """The resource-specific properties for this resource.""" + + +class SolutionConfigurationProperties(TypedDict, total=False): + """Solution configuration resource. + + :ivar provisioningState: The resource provisioning state. Known values are: "Succeeded", + "Failed", and "Canceled". + :vartype provisioningState: Union[str, "ResourceProvisioningState"] + :ivar solutionType: The type of the solution. Required. + :vartype solutionType: str + :ivar solutionSettings: Solution settings. + :vartype solutionSettings: "SolutionSettings" + :ivar status: The status of solution configurations. Known values are: "New", "InProgress", + "Completed", and "Failed". + :vartype status: Union[str, "SolutionConfigurationStatus"] + :ivar statusDetails: The detailed message of status details. + :vartype statusDetails: str + :ivar lastSyncTime: The last time resources were inventoried. + :vartype lastSyncTime: str + """ + + provisioningState: Union[str, "ResourceProvisioningState"] + """The resource provisioning state. Known values are: \"Succeeded\", \"Failed\", and \"Canceled\".""" + solutionType: Required[str] + """The type of the solution. Required.""" + solutionSettings: "SolutionSettings" + """Solution settings.""" + status: Union[str, "SolutionConfigurationStatus"] + """The status of solution configurations. Known values are: \"New\", \"InProgress\", + \"Completed\", and \"Failed\".""" + statusDetails: str + """The detailed message of status details.""" + lastSyncTime: str + """The last time resources were inventoried.""" + + +class SolutionConfigurationPropertiesUpdate(TypedDict, total=False): + """Solution configuration resource. + + :ivar solutionType: The type of the solution. + :vartype solutionType: str + :ivar solutionSettings: Solution settings. + :vartype solutionSettings: "SolutionSettings" + """ + + solutionType: str + """The type of the solution.""" + solutionSettings: "SolutionSettings" + """Solution settings.""" + + +class SolutionConfigurationUpdate(ProxyResource): + """Solution Configuration. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SolutionConfigurationPropertiesUpdate" + """ + + properties: "SolutionConfigurationPropertiesUpdate" + """The resource-specific properties for this resource.""" + + +class SolutionSettings(TypedDict, total=False): + """Solution settings.""" + + +class SolutionTypeSettings(TypedDict, total=False): + """The properties of Solution Type. + + :ivar solutionType: The type of the solution. Required. + :vartype solutionType: str + :ivar solutionSettings: Solution settings. + :vartype solutionSettings: "SolutionSettings" + """ + + solutionType: Required[str] + """The type of the solution. Required.""" + solutionSettings: "SolutionSettings" + """Solution settings.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_custom.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_maximum_set_gen.py similarity index 91% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_custom.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_maximum_set_gen.py index 7403a1f4faf6..b6e47969b0da 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_custom.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_put_custom.py + python endpoints_create_or_update_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,7 +33,7 @@ def main(): response = client.endpoints.create_or_update( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="custom", + endpoint_name="qlgk", endpoint_resource={ "properties": { "resourceId": "/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace", @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2024-12-01/EndpointsPutCustom.json +# x-ms-original-file: 2027-01-01/Endpoints_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_default.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_minimum_set_gen.py similarity index 68% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_default.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_minimum_set_gen.py index c5dac2d4e473..f0ae626341eb 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_put_default.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_create_or_update_minimum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_put_default.py + python endpoints_create_or_update_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,12 +33,25 @@ def main(): response = client.endpoints.create_or_update( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", - endpoint_resource={"properties": {"type": "default"}}, + endpoint_name="brvzkuhspeph", + endpoint_resource={ + "id": "str", + "name": "str", + "properties": {"type": "str", "provisioningState": "str", "resourceId": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsPutDefault.json +# x-ms-original-file: 2027-01-01/Endpoints_CreateOrUpdate_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_maximum_set_gen.py new file mode 100644 index 000000000000..a83c4c6f1c15 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_maximum_set_gen.py @@ -0,0 +1,42 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.endpoints.delete( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="bzibyvoiurhaqyjfcvvmtqqxp", + ) + + +# x-ms-original-file: 2027-01-01/Endpoints_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_default.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_minimum_set_gen.py similarity index 90% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_default.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_minimum_set_gen.py index d990167ecbde..e5c0b4275419 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_default.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_delete_minimum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_delete_default.py + python endpoints_delete_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,10 +33,10 @@ def main(): client.endpoints.delete( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", + endpoint_name="hnsdhce", ) -# x-ms-original-file: 2024-12-01/EndpointsDeleteDefault.json +# x-ms-original-file: 2027-01-01/Endpoints_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_custom.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_maximum_set_gen.py similarity index 90% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_custom.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_maximum_set_gen.py index 5b064606b69b..a4fad94cb63a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_custom.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_get_custom.py + python endpoints_get_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,11 +33,11 @@ def main(): response = client.endpoints.get( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="custom", + endpoint_name="dvibtlitlirlrljqjavewemmh", ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsGetCustom.json +# x-ms-original-file: 2027-01-01/Endpoints_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_default.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_minimum_set_gen.py similarity index 90% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_default.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_minimum_set_gen.py index a925e639d79e..91f02be82539 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_default.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_get_minimum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_get_default.py + python endpoints_get_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,11 +33,11 @@ def main(): response = client.endpoints.get( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", + endpoint_name="mtmtfiytugklrzlgsbfllkffmpbit", ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsGetDefault.json +# x-ms-original-file: 2027-01-01/Endpoints_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_patch_default.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_maximum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_patch_default.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_maximum_set_gen.py index b5a77a5d385f..75fec8c1f79b 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_patch_default.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_patch_default.py + python endpoints_list_credentials_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,14 +31,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.endpoints.update( + response = client.endpoints.list_credentials( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", - endpoint_resource={"properties": {"type": "default"}}, + endpoint_name="zctvtuhbhezloxvc", ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsPatchDefault.json +# x-ms-original-file: 2027-01-01/Endpoints_ListCredentials_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_credentials.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_minimum_set_gen.py similarity index 89% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_credentials.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_minimum_set_gen.py index 0ab64a25f79f..5cbd168effe1 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_credentials.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_credentials_minimum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_post_list_credentials.py + python endpoints_list_credentials_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -33,11 +33,11 @@ def main(): response = client.endpoints.list_credentials( resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", - endpoint_name="default", + endpoint_name="yfaebuxkhicaact", ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsPostListCredentials.json +# x-ms-original-file: 2027-01-01/Endpoints_ListCredentials_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_maximum_set_gen.py new file mode 100644 index 000000000000..89996ea2961f --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_maximum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_list_ingress_gateway_credentials_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.list_ingress_gateway_credentials( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="csjtwwrsv", + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_ListIngressGatewayCredentials_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_minimum_set_gen.py new file mode 100644 index 000000000000..e631c550c63b --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_ingress_gateway_credentials_minimum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_list_ingress_gateway_credentials_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.list_ingress_gateway_credentials( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="acwtmooqweqqgfcz", + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_ListIngressGatewayCredentials_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_managed_proxy_details.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_managed_proxy_details.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_maximum_set_gen.py index c7c1d7a6de45..41ffbfebf084 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_managed_proxy_details.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_post_list_managed_proxy_details.py + python endpoints_list_managed_proxy_details_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,13 +32,13 @@ def main(): ) response = client.endpoints.list_managed_proxy_details( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006", - endpoint_name="default", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="bjamsbnl", managed_proxy_request={"hostname": "r.proxy.arc.com", "service": "127.0.0.1:65035", "serviceName": "WAC"}, ) print(response) -# x-ms-original-file: 2024-12-01/EndpointsPostListManagedProxyDetails.json +# x-ms-original-file: 2027-01-01/Endpoints_ListManagedProxyDetails_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_minimum_set_gen.py new file mode 100644 index 000000000000..394a7da73ddf --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_managed_proxy_details_minimum_set_gen.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_list_managed_proxy_details_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.list_managed_proxy_details( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="ujpppanchofwgjdv", + managed_proxy_request={"service": "127.0.0.1:65035"}, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_ListManagedProxyDetails_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_maximum_set_gen.py similarity index 93% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_maximum_set_gen.py index f2119dc657ab..86246082edcf 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_list_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python endpoints_list.py + python endpoints_list_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2024-12-01/EndpointsList.json +# x-ms-original-file: 2027-01-01/Endpoints_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_ingress_gateway_credentials.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_ingress_gateway_credentials.py deleted file mode 100644 index e47dfa6dae19..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_post_list_ingress_gateway_credentials.py +++ /dev/null @@ -1,43 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python endpoints_post_list_ingress_gateway_credentials.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.endpoints.list_ingress_gateway_credentials( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.ArcPlaceHolder/ProvisionedClusters/cluster0", - endpoint_name="default", - ) - print(response) - - -# x-ms-original-file: 2024-12-01/EndpointsPostListIngressGatewayCredentials.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_maximum_set_gen.py new file mode 100644 index 000000000000..52040e335fdd --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_maximum_set_gen.py @@ -0,0 +1,49 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_update_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.update( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="rukckncxq", + endpoint_resource={ + "properties": { + "resourceId": "/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace", + "type": "custom", + } + }, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_Update_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_minimum_set_gen.py new file mode 100644 index 000000000000..5512625cc680 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/endpoints_update_minimum_set_gen.py @@ -0,0 +1,57 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python endpoints_update_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.endpoints.update( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="xmbtuwprx", + endpoint_resource={ + "id": "str", + "name": "str", + "properties": {"type": "str", "provisioningState": "str", "resourceId": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Endpoints_Update_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_maximum_set_gen.py similarity index 91% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_maximum_set_gen.py index 1066b00687da..32754071c84b 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python generate_aws_template_post.py + python generate_aws_template_post_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2024-12-01/GenerateAwsTemplate_Post.json +# x-ms-original-file: 2027-01-01/GenerateAwsTemplate_Post_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_minimum_set_gen.py similarity index 83% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_minimum_set_gen.py index 2336cdc8064f..a2efa0aeada6 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_aws_template_post_minimum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_configurations_get.py + python generate_aws_template_post_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,12 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.solution_configurations.get( - resource_uri="ymuj", - solution_configuration="tks", + response = client.generate_aws_template.post( + generate_aws_template_request={"connectorId": "pnxcfjidglabnwxit"}, ) print(response) -# x-ms-original-file: 2024-12-01/SolutionConfigurations_Get.json +# x-ms-original-file: 2027-01-01/GenerateAwsTemplate_Post_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_maximum_set_gen.py new file mode 100644 index 000000000000..f36de84be852 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_maximum_set_gen.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python generate_gcp_template_post_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.generate_gcp_template.post( + generate_gcp_template_request={ + "connectorId": "lvrdneuerxztxiixlzswcbm", + "gcpCloudProfile": { + "organizationProperties": { + "excludedFolderIds": ["xxl"], + "excludedProjectNumbers": ["sepdnfxmhcrubtklwllxfbhju"], + "managementProjectId": "mjubieitixhpmid", + "managementProjectNumber": "mjubieitixhpm", + "organizationId": "vqlzghfdinlamurmg", + }, + "projectProperties": {"projectId": "mjubieitixhpmid", "projectNumber": "mjubieitixhpm"}, + }, + "gcpTemplateFormat": "terraform", + "solutionTypes": [{"solutionSettings": {}, "solutionType": "hjyownzpfxwiufmd"}], + }, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/GenerateGcpTemplate_Post_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_minimum_set_gen.py similarity index 82% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_minimum_set_gen.py index 5e17790500da..416965fbedac 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/generate_gcp_template_post_minimum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python inventory_get.py + python generate_gcp_template_post_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,12 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.inventory.get( - resource_uri="ymuj", - solution_configuration="zarfsraogroxlaqjjnwixtn", - inventory_id="xofprmcboosrbd", + response = client.generate_gcp_template.post( + generate_gcp_template_request={"connectorId": "lvrdneuerxztxiixlzswcbm"}, ) print(response) -# x-ms-original-file: 2024-12-01/Inventory_Get.json +# x-ms-original-file: 2027-01-01/GenerateGcpTemplate_Post_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get_maximum_set_gen.py new file mode 100644 index 000000000000..e77c2c6b32fd --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_get_maximum_set_gen.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python inventory_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.inventory.get( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + inventory_id="pr", + ) + print(response) + + +# x-ms-original-file: 2027-01-01/Inventory_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration_maximum_set_gen.py new file mode 100644 index 000000000000..76debcd63662 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration_maximum_set_gen.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python inventory_list_by_solution_configuration_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.inventory.list_by_solution_configuration( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2027-01-01/Inventory_ListBySolutionConfiguration_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_maximum_set_gen.py similarity index 92% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_maximum_set_gen.py index 37c83bea655e..d5179ec43a18 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python operations_list.py + python operations_list_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-12-01/OperationsList.json +# x-ms-original-file: 2027-01-01/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_minimum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_minimum_set_gen.py index 09ee5a33bd61..359ee9f9e484 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/operations_list_minimum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_configurations_list.py + python operations_list_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,11 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.solution_configurations.list( - resource_uri="ymuj", - ) + response = client.operations.list() for item in response: print(item) -# x-ms-original-file: 2024-12-01/SolutionConfigurations_List.json +# x-ms-original-file: 2027-01-01/Operations_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update_maximum_set_gen.py similarity index 67% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update_maximum_set_gen.py index 2ae2b64558f6..d400407bf7b2 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_create_or_update_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_create_or_update.py + python public_cloud_connectors_create_or_update_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,9 +31,10 @@ def main(): ) response = client.public_cloud_connectors.begin_create_or_update( - resource_group_name="rgpublicCloud", - public_cloud_connector="advjwoakdusalamomg", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", resource={ + "kind": "AWS", "location": "jpiglusfxynfcewcjwvvnn", "properties": { "awsCloudProfile": { @@ -41,6 +42,16 @@ def main(): "excludedAccounts": ["rwgqpukglvbqmogqcliqolucp"], "isOrganizationalAccount": True, }, + "gcpCloudProfile": { + "organizationProperties": { + "excludedFolderIds": ["xxl"], + "excludedProjectNumbers": ["sepdnfxmhcrubtklwllxfbhju"], + "managementProjectId": "mjubieitixhpmid", + "managementProjectNumber": "mjubieitixhpm", + "organizationId": "vqlzghfdinlamurmg", + }, + "projectProperties": {"projectId": "mjubieitixhpmid", "projectNumber": "mjubieitixhpm"}, + }, "hostType": "AWS", }, "tags": {}, @@ -49,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_CreateOrUpdate.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_CreateOrUpdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete_maximum_set_gen.py index 28be4687c3bd..996d4e922e67 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_delete_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_delete.py + python public_cloud_connectors_delete_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,11 +31,11 @@ def main(): ) client.public_cloud_connectors.delete( - resource_group_name="rgpublicCloud", - public_cloud_connector="skcfyjvflkhibdywjay", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", ) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_Delete.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get_maximum_set_gen.py similarity index 85% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get_maximum_set_gen.py index 0e6d58803435..533a5a6f62ee 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_get_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_get.py + python public_cloud_connectors_get_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.public_cloud_connectors.get( - resource_group_name="rgpublicCloud", - public_cloud_connector="rzygvnpsnrdylwzdbsscjazvamyxmh", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", ) print(response) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_Get.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_maximum_set_gen.py similarity index 85% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_maximum_set_gen.py index 34a973973d0b..4908e284bf2c 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_list_by_resource_group.py + python public_cloud_connectors_list_by_resource_group_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.public_cloud_connectors.list_by_resource_group( - resource_group_name="rgpublicCloud", + resource_group_name="rghybridconnectivity", ) for item in response: print(item) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_ListByResourceGroup.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_minimum_set_gen.py similarity index 81% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_minimum_set_gen.py index 2e16b13759e5..42cf95c7be51 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/inventory_list_by_solution_configuration.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_resource_group_minimum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python inventory_list_by_solution_configuration.py + python public_cloud_connectors_list_by_resource_group_minimum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.inventory.list_by_solution_configuration( - resource_uri="ymuj", - solution_configuration="wsxt", + response = client.public_cloud_connectors.list_by_resource_group( + resource_group_name="rghybridconnectivity", ) for item in response: print(item) -# x-ms-original-file: 2024-12-01/Inventory_ListBySolutionConfiguration.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_ListByResourceGroup_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_maximum_set_gen.py similarity index 88% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_maximum_set_gen.py index 666105c95057..fff03865acbc 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_list_by_subscription.py + python public_cloud_connectors_list_by_subscription_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_ListBySubscription.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_minimum_set_gen.py new file mode 100644 index 000000000000..aabcea115d8a --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_list_by_subscription_minimum_set_gen.py @@ -0,0 +1,40 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python public_cloud_connectors_list_by_subscription_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.public_cloud_connectors.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_ListBySubscription_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions_maximum_set_gen.py index f23d2eaddce1..27d051ffd9b4 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_test_permissions_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_test_permissions.py + python public_cloud_connectors_test_permissions_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.public_cloud_connectors.begin_test_permissions( - resource_group_name="rgpublicCloud", - public_cloud_connector="rzygvnpsnrdylwzdbsscjazvamyxmh", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", ).result() print(response) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_TestPermissions.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_TestPermissions_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update_maximum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update_maximum_set_gen.py index d7f0b0bb4c65..8bbe7703221a 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/public_cloud_connectors_update_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python public_cloud_connectors_update.py + python public_cloud_connectors_update_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,13 +31,13 @@ def main(): ) response = client.public_cloud_connectors.update( - resource_group_name="rgpublicCloud", - public_cloud_connector="svtirlbyqpepbzyessjenlueeznhg", + resource_group_name="rghybridconnectivity", + public_cloud_connector="abc", properties={"properties": {"awsCloudProfile": {"excludedAccounts": ["zrbtd"]}}, "tags": {}}, ) print(response) -# x-ms-original-file: 2024-12-01/PublicCloudConnectors_Update.json +# x-ms-original-file: 2027-01-01/PublicCloudConnectors_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_ssh.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_create_orupdate_maximum_set_gen.py similarity index 71% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_ssh.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_create_orupdate_maximum_set_gen.py index 5be08c0943f7..5f0f1bc76716 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_ssh.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_create_orupdate_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_put_ssh.py + python service_configurations_create_orupdate_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,14 +32,20 @@ def main(): ) response = client.service_configurations.create_orupdate( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="SSH", - service_configuration_resource={"properties": {"port": 22, "serviceName": "SSH"}}, + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="djevinbielhfx", + service_configuration_name="inlnklujw", + service_configuration_resource={ + "properties": { + "port": 22, + "resourceId": "/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + "serviceName": "SSH", + } + }, ) print(response) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsPutSSH.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_CreateOrupdate_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_ssh.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_ssh.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_maximum_set_gen.py index 91f6675db329..5661ad4da55b 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_ssh.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_delete_ssh.py + python service_configurations_delete_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,12 +32,12 @@ def main(): ) client.service_configurations.delete( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="SSH", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="ureaofizl", + service_configuration_name="ptkmrkoxmvcmvhdzxkd", ) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsDeleteSSH.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_minimum_set_gen.py new file mode 100644 index 000000000000..226d82115443 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_delete_minimum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python service_configurations_delete_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.service_configurations.delete( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="ykrzxbnhnszoikyge", + service_configuration_name="qwaxkaulnvwsspqjblxrlxtlyfr", + ) + + +# x-ms-original-file: 2027-01-01/ServiceConfigurations_Delete_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_ssh.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_maximum_set_gen.py similarity index 84% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_ssh.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_maximum_set_gen.py index 62e5f3f1e435..28b719b584ed 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_ssh.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_get_ssh.py + python service_configurations_get_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,13 +32,13 @@ def main(): ) response = client.service_configurations.get( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="SSH", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="qxkrgoqcdbdduowdxphfmfjpe", + service_configuration_name="bdahzuetmihmfsvxrtegqzkybmjbfu", ) print(response) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsGetSSH.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_wac.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_wac.py deleted file mode 100644 index 82e103a95f6e..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_get_wac.py +++ /dev/null @@ -1,44 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python service_configurations_get_wac.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.service_configurations.get( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="WAC", - ) - print(response) - - -# x-ms-original-file: 2024-12-01/ServiceConfigurationsGetWAC.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list_by_endpoint_resource_maximum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list_by_endpoint_resource_maximum_set_gen.py index 1853241e8583..0b507ee9501b 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_list_by_endpoint_resource_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_list.py + python service_configurations_list_by_endpoint_resource_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,13 +32,13 @@ def main(): ) response = client.service_configurations.list_by_endpoint_resource( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="azklihfwffrqohr", ) for item in response: print(item) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsList.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_ListByEndpointResource_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_wac.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_wac.py deleted file mode 100644 index ea4eacb31787..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_put_wac.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python service_configurations_put_wac.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.service_configurations.create_orupdate( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="WAC", - service_configuration_resource={"properties": {"port": 6516, "serviceName": "WAC"}}, - ) - print(response) - - -# x-ms-original-file: 2024-12-01/ServiceConfigurationsPutWAC.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_patch_ssh.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_update_maximum_set_gen.py similarity index 85% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_patch_ssh.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_update_maximum_set_gen.py index ea10444f75ff..841fab51f584 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_patch_ssh.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/service_configurations_update_maximum_set_gen.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python service_configurations_patch_ssh.py + python service_configurations_update_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -32,14 +32,14 @@ def main(): ) response = client.service_configurations.update( - resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default", - endpoint_name="default", - service_configuration_name="SSH", + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + endpoint_name="bsbpgdlspjhyjgpoxxsoptu", + service_configuration_name="dcdbyycehygofsazwxadc", service_configuration_resource={"properties": {"port": 22}}, ) print(response) -# x-ms-original-file: 2024-12-01/ServiceConfigurationsPatchSSH.json +# x-ms-original-file: 2027-01-01/ServiceConfigurations_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update.py deleted file mode 100644 index 26f4bbdefbea..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python solution_configurations_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.solution_configurations.create_or_update( - resource_uri="ymuj", - solution_configuration="keebwujt", - resource={"properties": {"solutionSettings": {}, "solutionType": "nmtqllkyohwtsthxaimsye"}}, - ) - print(response) - - -# x-ms-original-file: 2024-12-01/SolutionConfigurations_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update_maximum_set_gen.py new file mode 100644 index 000000000000..005587c20bbb --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_create_or_update_maximum_set_gen.py @@ -0,0 +1,50 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_create_or_update_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.create_or_update( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + resource={ + "properties": { + "solutionSettings": {}, + "solutionType": "nmtqllkyohwtsthxaimsye", + "status": "AuthorizationPending", + } + }, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_CreateOrUpdate_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete.py deleted file mode 100644 index 3debd7031a00..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python solution_configurations_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.solution_configurations.delete( - resource_uri="ymuj", - solution_configuration="stu", - ) - - -# x-ms-original-file: 2024-12-01/SolutionConfigurations_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete_maximum_set_gen.py new file mode 100644 index 000000000000..c5a41fcfe208 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_delete_maximum_set_gen.py @@ -0,0 +1,42 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_delete_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.solution_configurations.delete( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + ) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_Delete_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get_maximum_set_gen.py new file mode 100644 index 000000000000..2981d80cb6ff --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_get_maximum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_get_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.get( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + ) + print(response) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_Get_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_maximum_set_gen.py new file mode 100644 index 000000000000..cf99bda57597 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_maximum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_list_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.list( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_List_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_minimum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_minimum_set_gen.py new file mode 100644 index 000000000000..cfd4ab156713 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_list_minimum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_list_minimum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.list( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_List_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now.py deleted file mode 100644 index a7eb795625ee..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python solution_configurations_sync_now.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.solution_configurations.begin_sync_now( - resource_uri="ymuj", - solution_configuration="tks", - ).result() - print(response) - - -# x-ms-original-file: 2024-12-01/SolutionConfigurations_SyncNow.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now_maximum_set_gen.py new file mode 100644 index 000000000000..03edd9c6fb20 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_sync_now_maximum_set_gen.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_sync_now_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.begin_sync_now( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + ).result() + print(response) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_SyncNow_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update.py deleted file mode 100644 index 2093d7a5b254..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-hybridconnectivity -# USAGE - python solution_configurations_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = HybridConnectivityMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - response = client.solution_configurations.update( - resource_uri="ymuj", - solution_configuration="dxt", - properties={"properties": {"solutionSettings": {}, "solutionType": "myzljlstvmgkp"}}, - ) - print(response) - - -# x-ms-original-file: 2024-12-01/SolutionConfigurations_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update_maximum_set_gen.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update_maximum_set_gen.py new file mode 100644 index 000000000000..f85b409fba28 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_configurations_update_maximum_set_gen.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-hybridconnectivity +# USAGE + python solution_configurations_update_maximum_set_gen.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = HybridConnectivityMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.solution_configurations.update( + resource_uri="subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine", + solution_configuration="abc", + properties={"properties": {"solutionSettings": {}, "solutionType": "myzljlstvmgkp"}}, + ) + print(response) + + +# x-ms-original-file: 2027-01-01/SolutionConfigurations_Update_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get_maximum_set_gen.py similarity index 85% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get_maximum_set_gen.py index fa0ca5cada1b..4e494eed3d1c 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_get_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_types_get.py + python solution_types_get_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.solution_types.get( - resource_group_name="rgpublicCloud", - solution_type="lulzqllpu", + resource_group_name="rghybridconnectivity", + solution_type="uekzhgszlxyljiagul", ) print(response) -# x-ms-original-file: 2024-12-01/SolutionTypes_Get.json +# x-ms-original-file: 2027-01-01/SolutionTypes_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group_maximum_set_gen.py similarity index 86% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group_maximum_set_gen.py index abfbfd9cd169..2c0c67ef1165 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_resource_group_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_types_list_by_resource_group.py + python solution_types_list_by_resource_group_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,12 +31,12 @@ def main(): ) response = client.solution_types.list_by_resource_group( - resource_group_name="rgpublicCloud", + resource_group_name="rghybridconnectivity", ) for item in response: print(item) -# x-ms-original-file: 2024-12-01/SolutionTypes_ListByResourceGroup.json +# x-ms-original-file: 2027-01-01/SolutionTypes_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription_maximum_set_gen.py similarity index 89% rename from sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription.py rename to sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription_maximum_set_gen.py index 08db69b66d5d..cd14b14c9cdc 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_samples/solution_types_list_by_subscription_maximum_set_gen.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-hybridconnectivity # USAGE - python solution_types_list_by_subscription.py + python solution_types_list_by_subscription_maximum_set_gen.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2024-12-01/SolutionTypes_ListBySubscription.json +# x-ms-original-file: 2027-01-01/SolutionTypes_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations.py new file mode 100644 index 000000000000..7ee66a9fe94b --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridconnectivity import HybridConnectivityMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridConnectivityMgmtGenerateGcpTemplateOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridConnectivityMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_generate_gcp_template_post(self, resource_group): + response = self.client.generate_gcp_template.post( + generate_gcp_template_request={ + "connectorId": "str", + "gcpCloudProfile": { + "organizationProperties": { + "managementProjectId": "str", + "managementProjectNumber": "str", + "organizationId": "str", + "excludedFolderIds": ["str"], + "excludedProjectNumbers": ["str"], + }, + "projectProperties": {"projectId": "str", "projectNumber": "str"}, + }, + "gcpTemplateFormat": "str", + "solutionTypes": [{"solutionType": "str", "solutionSettings": {}}], + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations_async.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations_async.py new file mode 100644 index 000000000000..3b1439878716 --- /dev/null +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_generate_gcp_template_operations_async.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.hybridconnectivity.aio import HybridConnectivityMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestHybridConnectivityMgmtGenerateGcpTemplateOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(HybridConnectivityMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_generate_gcp_template_post(self, resource_group): + response = await self.client.generate_gcp_template.post( + generate_gcp_template_request={ + "connectorId": "str", + "gcpCloudProfile": { + "organizationProperties": { + "managementProjectId": "str", + "managementProjectNumber": "str", + "organizationId": "str", + "excludedFolderIds": ["str"], + "excludedProjectNumbers": ["str"], + }, + "projectProperties": {"projectId": "str", "projectNumber": "str"}, + }, + "gcpTemplateFormat": "str", + "solutionTypes": [{"solutionType": "str", "solutionSettings": {}}], + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations.py index db734cbd0900..0223c8a18bca 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations.py @@ -38,15 +38,26 @@ def test_public_cloud_connectors_begin_create_or_update(self, resource_group): resource={ "location": "str", "id": "str", + "kind": "str", "name": "str", "properties": { + "hostType": "str", "awsCloudProfile": { "accountId": "str", "excludedAccounts": ["str"], "isOrganizationalAccount": bool, }, - "hostType": "str", "connectorPrimaryIdentifier": "str", + "gcpCloudProfile": { + "organizationProperties": { + "managementProjectId": "str", + "managementProjectNumber": "str", + "organizationId": "str", + "excludedFolderIds": ["str"], + "excludedProjectNumbers": ["str"], + }, + "projectProperties": {"projectId": "str", "projectNumber": "str"}, + }, "provisioningState": "str", }, "systemData": { @@ -74,7 +85,12 @@ def test_public_cloud_connectors_update(self, resource_group): properties={ "id": "str", "name": "str", - "properties": {"awsCloudProfile": {"excludedAccounts": ["str"]}}, + "properties": { + "awsCloudProfile": {"excludedAccounts": ["str"]}, + "gcpCloudProfile": { + "organizationProperties": {"excludedFolderIds": ["str"], "excludedProjectNumbers": ["str"]} + }, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations_async.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations_async.py index 56d7587dbf9f..71ae890ef569 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations_async.py +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/generated_tests/test_hybrid_connectivity_mgmt_public_cloud_connectors_operations_async.py @@ -40,15 +40,26 @@ async def test_public_cloud_connectors_begin_create_or_update(self, resource_gro resource={ "location": "str", "id": "str", + "kind": "str", "name": "str", "properties": { + "hostType": "str", "awsCloudProfile": { "accountId": "str", "excludedAccounts": ["str"], "isOrganizationalAccount": bool, }, - "hostType": "str", "connectorPrimaryIdentifier": "str", + "gcpCloudProfile": { + "organizationProperties": { + "managementProjectId": "str", + "managementProjectNumber": "str", + "organizationId": "str", + "excludedFolderIds": ["str"], + "excludedProjectNumbers": ["str"], + }, + "projectProperties": {"projectId": "str", "projectNumber": "str"}, + }, "provisioningState": "str", }, "systemData": { @@ -77,7 +88,12 @@ async def test_public_cloud_connectors_update(self, resource_group): properties={ "id": "str", "name": "str", - "properties": {"awsCloudProfile": {"excludedAccounts": ["str"]}}, + "properties": { + "awsCloudProfile": {"excludedAccounts": ["str"]}, + "gcpCloudProfile": { + "organizationProperties": {"excludedFolderIds": ["str"], "excludedProjectNumbers": ["str"]} + }, + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/pyproject.toml b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/pyproject.toml index 540da07d41af..df4007a6fc16 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/pyproject.toml +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/pyproject.toml @@ -1,6 +1,88 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-hybridconnectivity" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Hybridconnectivity Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +requires-python = ">=3.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.hybridconnectivity._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false pyright = false type_check_samples = false verifytypes = false + +[packaging] +package_name = "azure-mgmt-hybridconnectivity" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "Hybridconnectivity Management" +package_doc_id = "" +is_stable = true +is_arm = true +need_msrestazure = false +need_azuremgmtcore = true +sample_link = "" +exclude_folders = "" +title = "HybridConnectivityMgmtClient" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/sdk_packaging.toml b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/sdk_packaging.toml deleted file mode 100644 index 0fdff035cd3b..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/sdk_packaging.toml +++ /dev/null @@ -1,12 +0,0 @@ -[packaging] -package_name = "azure-mgmt-hybridconnectivity" -package_nspkg = "azure-mgmt-nspkg" -package_pprint_name = "Hybridconnectivity Management" -package_doc_id = "" -is_stable = true -is_arm = true -need_msrestazure = false -need_azuremgmtcore = true -sample_link = "" -exclude_folders = "" -title = "HybridConnectivityMgmtClient" diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/setup.py b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/setup.py deleted file mode 100644 index 2903ec83b38d..000000000000 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/setup.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-hybridconnectivity" -PACKAGE_PPRINT_NAME = "Hybridconnectivity Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "Development Status :: 4 - Beta", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.3.2", - ], - python_requires=">=3.8", -) diff --git a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/tsp-location.yaml b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/tsp-location.yaml index 86e8c4272404..483401d6df3e 100644 --- a/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/tsp-location.yaml +++ b/sdk/hybridconnectivity/azure-mgmt-hybridconnectivity/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/hybridconnectivity/HybridConnectivity.Management -commit: 3db6867b8e524ea6d1bc7a3bbb989fe50dd2f184 +commit: 47515ad36204e02e14c3b62414beebca92abb4a2 repo: Azure/azure-rest-api-specs additionalDirectories: