From 38b9d807389b3784c9886b3068a3dc289b6affb2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 8 Nov 2022 23:54:27 +0000 Subject: [PATCH] CodeGen from PR 21483 in Azure/azure-rest-api-specs Merge 6305e7f0150afb44bb33468bddd748237b19d981 into 0686bc24c06e63f08fb6300a216f3eabeb73b9dd --- .../azure-mgmt-appcontainers/_meta.json | 8 +- .../azure/mgmt/appcontainers/__init__.py | 4 +- .../mgmt/appcontainers/_configuration.py | 12 +- .../_container_apps_api_client.py | 80 +++++----- .../azure/mgmt/appcontainers/_version.py | 2 +- .../azure/mgmt/appcontainers/aio/__init__.py | 4 +- .../mgmt/appcontainers/aio/_configuration.py | 12 +- .../aio/_container_apps_api_client.py | 80 +++++----- .../appcontainers/aio/operations/__init__.py | 28 ++-- ..._available_workload_profiles_operations.py | 24 ++- .../operations/_billing_meters_operations.py | 9 +- .../operations/_certificates_operations.py | 40 +++-- ...ed_environments_certificates_operations.py | 40 +++-- ...environments_dapr_components_operations.py | 40 +++-- .../_connected_environments_operations.py | 69 +++++++-- ...nected_environments_storages_operations.py | 21 ++- ..._container_apps_auth_configs_operations.py | 36 ++++- .../_container_apps_diagnostics_operations.py | 53 +++++-- .../operations/_container_apps_operations.py | 81 +++++++--- ...ainer_apps_revision_replicas_operations.py | 13 +- .../_container_apps_revisions_operations.py | 40 +++-- ...ntainer_apps_source_controls_operations.py | 44 ++++-- .../operations/_dapr_components_operations.py | 40 +++-- ...aged_environment_diagnostics_operations.py | 13 +- ...ged_environments_diagnostics_operations.py | 9 +- .../_managed_environments_operations.py | 90 +++++++++--- ...anaged_environments_storages_operations.py | 21 ++- .../aio/operations/_namespaces_operations.py | 9 +- .../aio/operations/_operations.py | 24 ++- .../mgmt/appcontainers/models/__init__.py | 4 + .../_container_apps_api_client_enums.py | 11 ++ .../mgmt/appcontainers/models/_models_py3.py | 132 +++++++++++++++-- .../mgmt/appcontainers/operations/__init__.py | 28 ++-- ..._available_workload_profiles_operations.py | 26 +++- .../operations/_billing_meters_operations.py | 11 +- .../operations/_certificates_operations.py | 50 +++++-- ...ed_environments_certificates_operations.py | 50 +++++-- ...environments_dapr_components_operations.py | 50 +++++-- .../_connected_environments_operations.py | 83 ++++++++--- ...nected_environments_storages_operations.py | 29 +++- ..._container_apps_auth_configs_operations.py | 44 ++++-- .../_container_apps_diagnostics_operations.py | 63 +++++--- .../operations/_container_apps_operations.py | 99 +++++++++---- ...ainer_apps_revision_replicas_operations.py | 17 ++- .../_container_apps_revisions_operations.py | 50 +++++-- ...ntainer_apps_source_controls_operations.py | 52 +++++-- .../operations/_dapr_components_operations.py | 50 +++++-- ...aged_environment_diagnostics_operations.py | 17 ++- ...ged_environments_diagnostics_operations.py | 11 +- .../_managed_environments_operations.py | 106 +++++++++---- ...anaged_environments_storages_operations.py | 29 +++- .../operations/_namespaces_operations.py | 11 +- .../appcontainers/operations/_operations.py | 26 +++- .../activate_container_app's_revision.py | 42 ++++++ .../analyze_custom_hostname.py | 41 ++++++ .../generated_samples/billing_meters_get.py | 41 ++++++ .../certificates_check_name_availability.py | 45 ++++++ .../container_apps_check_name_availability.py | 42 ++++++ .../generated_samples/create_environments.py | 66 +++++++++ .../create_kube_environments.py | 53 +++++++ .../create_or_update_certificate.py | 42 ++++++ .../create_or_update_container_app.py | 139 ++++++++++++++++++ ...ate_or_update_container_app_auth_config.py | 51 +++++++ ..._or_update_container_app_source_control.py | 62 ++++++++ .../create_or_update_dapr_component.py | 58 ++++++++ ...r_component_with_secret_store_component.py | 58 ++++++++ ...e_or_update_dapr_component_with_secrets.py | 58 ++++++++ .../create_or_update_environments_storage.py | 52 +++++++ .../create_or_update_tcp_app.py | 77 ++++++++++ .../deactivate_container_app's_revision.py | 42 ++++++ .../generated_samples/delete_certificate.py | 42 ++++++ ...vironment_by_connected_environment_name.py | 41 ++++++ .../generated_samples/delete_container_app.py | 41 ++++++ .../delete_container_app_auth_config.py | 42 ++++++ .../delete_container_app_source_control.py | 42 ++++++ .../delete_dapr_component.py | 42 ++++++ .../delete_environment_by_name.py | 41 ++++++ ...ents_storage_properties_by_subscription.py | 42 ++++++ .../generated_samples/get_certificate.py | 42 ++++++ ...vironment_by_connected_environment_name.py | 41 ++++++ .../get_container_app's_auth_config.py | 42 ++++++ .../get_container_app's_diagnostics_info.py | 42 ++++++ .../get_container_app's_revision.py | 42 ++++++ .../get_container_app's_revision_replica.py | 43 ++++++ .../get_container_app's_source_control.py | 42 ++++++ .../generated_samples/get_container_app.py | 41 ++++++ .../get_container_app_auth_token.py | 41 ++++++ .../generated_samples/get_dapr_component.py | 42 ++++++ ...r_component_with_secret_store_component.py | 42 ++++++ .../get_dapr_component_with_secrets.py | 42 ++++++ ...gnostic_data_for_a_managed_environments.py | 42 ++++++ .../get_environments_by_name.py | 41 ++++++ .../get_managed_environment_auth_token.py | 41 ++++++ ...gnostic_data_for_a_managed_environments.py | 41 ++++++ ...e_diagnostics_for_a_given_container_app.py | 42 ++++++ .../generated_samples/list_all_operations.py | 39 +++++ .../list_app's_source_controls.py | 42 ++++++ .../list_auth_configs_by_container_apps.py | 42 ++++++ ...t_certificates_by_connected_environment.py | 42 ++++++ ...ist_certificates_by_managed_environment.py | 42 ++++++ ..._connected_environments_by_subscription.py | 39 +++++ .../list_container_app's_replicas.py | 42 ++++++ .../list_container_app's_revisions.py | 42 ++++++ .../list_container_apps_by_resource_group.py | 41 ++++++ .../list_container_apps_by_subscription.py | 39 +++++ .../list_container_apps_secrets.py | 42 ++++++ .../generated_samples/list_dapr_components.py | 42 ++++++ .../list_environments_by_resource_group.py | 41 ++++++ .../list_environments_by_subscription.py | 39 +++++ ...t_environments_storages_by_subscription.py | 41 ++++++ .../generated_samples/patch_certificate.py | 43 ++++++ .../generated_samples/patch_container_app.py | 127 ++++++++++++++++ .../patch_managed_environment.py | 41 ++++++ .../restart_container_app's_revision.py | 42 ++++++ 114 files changed, 4348 insertions(+), 526 deletions(-) create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/activate_container_app's_revision.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/analyze_custom_hostname.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_environments.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_kube_environments.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_certificate.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app_auth_config.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app_source_control.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component_with_secret_store_component.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component_with_secrets.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_environments_storage.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_tcp_app.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/deactivate_container_app's_revision.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_certificate.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_connected_environment_by_connected_environment_name.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app_auth_config.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app_source_control.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_dapr_component.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_environment_by_name.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_a_environments_storage_properties_by_subscription.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_certificate.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_connected_environment_by_connected_environment_name.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_auth_config.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_diagnostics_info.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_revision.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_revision_replica.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_source_control.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app_auth_token.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component_with_secret_store_component.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component_with_secrets.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_diagnostic_data_for_a_managed_environments.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_environments_by_name.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_managed_environment_auth_token.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_the_list_of_available_diagnostic_data_for_a_managed_environments.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_the_list_of_available_diagnostics_for_a_given_container_app.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_all_operations.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_app's_source_controls.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_auth_configs_by_container_apps.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_certificates_by_connected_environment.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_certificates_by_managed_environment.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_connected_environments_by_subscription.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_app's_replicas.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_app's_revisions.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_by_resource_group.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_by_subscription.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_secrets.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_dapr_components.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_by_resource_group.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_by_subscription.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_storages_by_subscription.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_certificate.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_container_app.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_managed_environment.py create mode 100644 sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/restart_container_app's_revision.py diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json index c4c741e489f61..8d57b857f261c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json +++ b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json @@ -1,11 +1,11 @@ { + "commit": "6faf2db1817e38ae95abc113578b237d0f96187f", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.1.9", + "@autorest/python@6.2.1", "@autorest/modelerfour@4.24.3" ], - "commit": "339675bcbc8172eacbe283470405e1e578632afc", - "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/app/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.9 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/app/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py index 984d644c26bc4..46da2919c02e8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py @@ -18,7 +18,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ContainerAppsAPIClient"] +__all__ = [ + "ContainerAppsAPIClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py index cbde29809fff4..78cfa8eff9851 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from ._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -29,14 +35,14 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-06-01-preview") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: Literal["2022-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py index 08f349abb1508..f2374b262bf5c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py @@ -49,6 +49,25 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations :vartype container_apps_auth_configs: azure.mgmt.appcontainers.operations.ContainerAppsAuthConfigsOperations + :ivar available_workload_profiles: AvailableWorkloadProfilesOperations operations + :vartype available_workload_profiles: + azure.mgmt.appcontainers.operations.AvailableWorkloadProfilesOperations + :ivar billing_meters: BillingMetersOperations operations + :vartype billing_meters: azure.mgmt.appcontainers.operations.BillingMetersOperations + :ivar connected_environments: ConnectedEnvironmentsOperations operations + :vartype connected_environments: + azure.mgmt.appcontainers.operations.ConnectedEnvironmentsOperations + :ivar connected_environments_certificates: ConnectedEnvironmentsCertificatesOperations + operations + :vartype connected_environments_certificates: + azure.mgmt.appcontainers.operations.ConnectedEnvironmentsCertificatesOperations + :ivar connected_environments_dapr_components: ConnectedEnvironmentsDaprComponentsOperations + operations + :vartype connected_environments_dapr_components: + azure.mgmt.appcontainers.operations.ConnectedEnvironmentsDaprComponentsOperations + :ivar connected_environments_storages: ConnectedEnvironmentsStoragesOperations operations + :vartype connected_environments_storages: + azure.mgmt.appcontainers.operations.ConnectedEnvironmentsStoragesOperations :ivar container_apps: ContainerAppsOperations operations :vartype container_apps: azure.mgmt.appcontainers.operations.ContainerAppsOperations :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations @@ -57,8 +76,6 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw :ivar container_apps_revision_replicas: ContainerAppsRevisionReplicasOperations operations :vartype container_apps_revision_replicas: azure.mgmt.appcontainers.operations.ContainerAppsRevisionReplicasOperations - :ivar dapr_components: DaprComponentsOperations operations - :vartype dapr_components: azure.mgmt.appcontainers.operations.DaprComponentsOperations :ivar container_apps_diagnostics: ContainerAppsDiagnosticsOperations operations :vartype container_apps_diagnostics: azure.mgmt.appcontainers.operations.ContainerAppsDiagnosticsOperations @@ -77,39 +94,22 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw :vartype certificates: azure.mgmt.appcontainers.operations.CertificatesOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.appcontainers.operations.NamespacesOperations + :ivar dapr_components: DaprComponentsOperations operations + :vartype dapr_components: azure.mgmt.appcontainers.operations.DaprComponentsOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: azure.mgmt.appcontainers.operations.ManagedEnvironmentsStoragesOperations :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations :vartype container_apps_source_controls: azure.mgmt.appcontainers.operations.ContainerAppsSourceControlsOperations - :ivar connected_environments: ConnectedEnvironmentsOperations operations - :vartype connected_environments: - azure.mgmt.appcontainers.operations.ConnectedEnvironmentsOperations - :ivar connected_environments_certificates: ConnectedEnvironmentsCertificatesOperations - operations - :vartype connected_environments_certificates: - azure.mgmt.appcontainers.operations.ConnectedEnvironmentsCertificatesOperations - :ivar connected_environments_dapr_components: ConnectedEnvironmentsDaprComponentsOperations - operations - :vartype connected_environments_dapr_components: - azure.mgmt.appcontainers.operations.ConnectedEnvironmentsDaprComponentsOperations - :ivar connected_environments_storages: ConnectedEnvironmentsStoragesOperations operations - :vartype connected_environments_storages: - azure.mgmt.appcontainers.operations.ConnectedEnvironmentsStoragesOperations - :ivar available_workload_profiles: AvailableWorkloadProfilesOperations operations - :vartype available_workload_profiles: - azure.mgmt.appcontainers.operations.AvailableWorkloadProfilesOperations - :ivar billing_meters: BillingMetersOperations operations - :vartype billing_meters: azure.mgmt.appcontainers.operations.BillingMetersOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2022-10-01". 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 Retry-After header is present. @@ -134,6 +134,22 @@ def __init__( self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.available_workload_profiles = AvailableWorkloadProfilesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.billing_meters = BillingMetersOperations(self._client, self._config, self._serialize, self._deserialize) + self.connected_environments = ConnectedEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.connected_environments_certificates = ConnectedEnvironmentsCertificatesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.connected_environments_dapr_components = ConnectedEnvironmentsDaprComponentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.connected_environments_storages = ConnectedEnvironmentsStoragesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_revisions = ContainerAppsRevisionsOperations( self._client, self._config, self._serialize, self._deserialize @@ -141,7 +157,6 @@ def __init__( self.container_apps_revision_replicas = ContainerAppsRevisionReplicasOperations( self._client, self._config, self._serialize, self._deserialize ) - self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_diagnostics = ContainerAppsDiagnosticsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -157,28 +172,13 @@ def __init__( ) self.certificates = CertificatesOperations(self._client, self._config, self._serialize, self._deserialize) self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) + self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations( self._client, self._config, self._serialize, self._deserialize ) self.container_apps_source_controls = ContainerAppsSourceControlsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.connected_environments = ConnectedEnvironmentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connected_environments_certificates = ConnectedEnvironmentsCertificatesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connected_environments_dapr_components = ConnectedEnvironmentsDaprComponentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connected_environments_storages = ConnectedEnvironmentsStoragesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.available_workload_profiles = AvailableWorkloadProfilesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.billing_meters = BillingMetersOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py index e32dc6ec42180..e5754a47ce68f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_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 = "1.0.0b1" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py index 7532ceec9286a..b2eb2e97d38c3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py @@ -15,7 +15,9 @@ _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ["ContainerAppsAPIClient"] +__all__ = [ + "ContainerAppsAPIClient", +] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py index 5ed33657cd90c..6676781f6a9a3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration @@ -14,6 +15,11 @@ from .._version import VERSION +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -29,14 +35,14 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2022-06-01-preview") # type: str + api_version = kwargs.pop("api_version", "2022-10-01") # type: Literal["2022-10-01"] if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py index e146e167ea835..fecb89a4d2ce6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py @@ -49,6 +49,25 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations :vartype container_apps_auth_configs: azure.mgmt.appcontainers.aio.operations.ContainerAppsAuthConfigsOperations + :ivar available_workload_profiles: AvailableWorkloadProfilesOperations operations + :vartype available_workload_profiles: + azure.mgmt.appcontainers.aio.operations.AvailableWorkloadProfilesOperations + :ivar billing_meters: BillingMetersOperations operations + :vartype billing_meters: azure.mgmt.appcontainers.aio.operations.BillingMetersOperations + :ivar connected_environments: ConnectedEnvironmentsOperations operations + :vartype connected_environments: + azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsOperations + :ivar connected_environments_certificates: ConnectedEnvironmentsCertificatesOperations + operations + :vartype connected_environments_certificates: + azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsCertificatesOperations + :ivar connected_environments_dapr_components: ConnectedEnvironmentsDaprComponentsOperations + operations + :vartype connected_environments_dapr_components: + azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsDaprComponentsOperations + :ivar connected_environments_storages: ConnectedEnvironmentsStoragesOperations operations + :vartype connected_environments_storages: + azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsStoragesOperations :ivar container_apps: ContainerAppsOperations operations :vartype container_apps: azure.mgmt.appcontainers.aio.operations.ContainerAppsOperations :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations @@ -57,8 +76,6 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw :ivar container_apps_revision_replicas: ContainerAppsRevisionReplicasOperations operations :vartype container_apps_revision_replicas: azure.mgmt.appcontainers.aio.operations.ContainerAppsRevisionReplicasOperations - :ivar dapr_components: DaprComponentsOperations operations - :vartype dapr_components: azure.mgmt.appcontainers.aio.operations.DaprComponentsOperations :ivar container_apps_diagnostics: ContainerAppsDiagnosticsOperations operations :vartype container_apps_diagnostics: azure.mgmt.appcontainers.aio.operations.ContainerAppsDiagnosticsOperations @@ -77,39 +94,22 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw :vartype certificates: azure.mgmt.appcontainers.aio.operations.CertificatesOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.appcontainers.aio.operations.NamespacesOperations + :ivar dapr_components: DaprComponentsOperations operations + :vartype dapr_components: azure.mgmt.appcontainers.aio.operations.DaprComponentsOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsStoragesOperations :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations :vartype container_apps_source_controls: azure.mgmt.appcontainers.aio.operations.ContainerAppsSourceControlsOperations - :ivar connected_environments: ConnectedEnvironmentsOperations operations - :vartype connected_environments: - azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsOperations - :ivar connected_environments_certificates: ConnectedEnvironmentsCertificatesOperations - operations - :vartype connected_environments_certificates: - azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsCertificatesOperations - :ivar connected_environments_dapr_components: ConnectedEnvironmentsDaprComponentsOperations - operations - :vartype connected_environments_dapr_components: - azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsDaprComponentsOperations - :ivar connected_environments_storages: ConnectedEnvironmentsStoragesOperations operations - :vartype connected_environments_storages: - azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsStoragesOperations - :ivar available_workload_profiles: AvailableWorkloadProfilesOperations operations - :vartype available_workload_profiles: - azure.mgmt.appcontainers.aio.operations.AvailableWorkloadProfilesOperations - :ivar billing_meters: BillingMetersOperations operations - :vartype billing_meters: azure.mgmt.appcontainers.aio.operations.BillingMetersOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2022-06-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2022-10-01". 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 Retry-After header is present. @@ -134,6 +134,22 @@ def __init__( self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.available_workload_profiles = AvailableWorkloadProfilesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.billing_meters = BillingMetersOperations(self._client, self._config, self._serialize, self._deserialize) + self.connected_environments = ConnectedEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.connected_environments_certificates = ConnectedEnvironmentsCertificatesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.connected_environments_dapr_components = ConnectedEnvironmentsDaprComponentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.connected_environments_storages = ConnectedEnvironmentsStoragesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_revisions = ContainerAppsRevisionsOperations( self._client, self._config, self._serialize, self._deserialize @@ -141,7 +157,6 @@ def __init__( self.container_apps_revision_replicas = ContainerAppsRevisionReplicasOperations( self._client, self._config, self._serialize, self._deserialize ) - self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_diagnostics = ContainerAppsDiagnosticsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -157,28 +172,13 @@ def __init__( ) self.certificates = CertificatesOperations(self._client, self._config, self._serialize, self._deserialize) self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) + self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations( self._client, self._config, self._serialize, self._deserialize ) self.container_apps_source_controls = ContainerAppsSourceControlsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.connected_environments = ConnectedEnvironmentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connected_environments_certificates = ConnectedEnvironmentsCertificatesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connected_environments_dapr_components = ConnectedEnvironmentsDaprComponentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.connected_environments_storages = ConnectedEnvironmentsStoragesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.available_workload_profiles = AvailableWorkloadProfilesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.billing_meters = BillingMetersOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py index 09ebc13d8cceb..13d3cd51244e7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py @@ -7,10 +7,15 @@ # -------------------------------------------------------------------------- from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations +from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations +from ._billing_meters_operations import BillingMetersOperations +from ._connected_environments_operations import ConnectedEnvironmentsOperations +from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations +from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations +from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations from ._container_apps_operations import ContainerAppsOperations from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations -from ._dapr_components_operations import DaprComponentsOperations from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations @@ -18,14 +23,9 @@ from ._managed_environments_operations import ManagedEnvironmentsOperations from ._certificates_operations import CertificatesOperations from ._namespaces_operations import NamespacesOperations +from ._dapr_components_operations import DaprComponentsOperations from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations -from ._connected_environments_operations import ConnectedEnvironmentsOperations -from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations -from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations -from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations -from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations -from ._billing_meters_operations import BillingMetersOperations from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import @@ -33,10 +33,15 @@ __all__ = [ "ContainerAppsAuthConfigsOperations", + "AvailableWorkloadProfilesOperations", + "BillingMetersOperations", + "ConnectedEnvironmentsOperations", + "ConnectedEnvironmentsCertificatesOperations", + "ConnectedEnvironmentsDaprComponentsOperations", + "ConnectedEnvironmentsStoragesOperations", "ContainerAppsOperations", "ContainerAppsRevisionsOperations", "ContainerAppsRevisionReplicasOperations", - "DaprComponentsOperations", "ContainerAppsDiagnosticsOperations", "ManagedEnvironmentDiagnosticsOperations", "ManagedEnvironmentsDiagnosticsOperations", @@ -44,14 +49,9 @@ "ManagedEnvironmentsOperations", "CertificatesOperations", "NamespacesOperations", + "DaprComponentsOperations", "ManagedEnvironmentsStoragesOperations", "ContainerAppsSourceControlsOperations", - "ConnectedEnvironmentsOperations", - "ConnectedEnvironmentsCertificatesOperations", - "ConnectedEnvironmentsDaprComponentsOperations", - "ConnectedEnvironmentsStoragesOperations", - "AvailableWorkloadProfilesOperations", - "BillingMetersOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py index 321f04e95ce77..8e6da181957b4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._available_workload_profiles_operations import build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +75,9 @@ def get(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailableW _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableWorkloadProfilesCollection] error_map = { @@ -97,10 +104,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py index ef8b13a0f2614..15b9237105198 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._billing_meters_operations import build_get_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +79,9 @@ async def get(self, location: str, **kwargs: Any) -> _models.BillingMeterCollect _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.BillingMeterCollection] request = build_get_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py index c3fa29537bb1a..d1be37010c6cb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CertificateCollection] error_map = { @@ -108,10 +115,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -174,7 +188,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] request = build_get_request( @@ -318,7 +334,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] @@ -400,7 +418,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -540,7 +560,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py index 4d23e3368f2d3..f319b218dc805 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CertificateCollection] error_map = { @@ -108,10 +115,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -174,7 +188,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] request = build_get_request( @@ -318,7 +334,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] @@ -400,7 +418,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -540,7 +560,9 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py index d9a30bc9c8b60..ed7daffe6a3c2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_secrets_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponentsCollection] error_map = { @@ -108,10 +115,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -174,7 +188,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponent] request = build_get_request( @@ -318,7 +334,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponent] @@ -397,7 +415,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -460,7 +480,9 @@ async def list_secrets( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprSecretsCollection] request = build_list_secrets_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py index abca55a4e5214..fb2a165343e05 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -40,6 +41,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,9 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Connecte _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentCollection] error_map = { @@ -105,10 +112,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -159,7 +173,9 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentCollection] error_map = { @@ -186,10 +202,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -248,7 +271,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironment] request = build_get_request( @@ -301,7 +326,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironment] @@ -464,7 +491,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironment] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -521,7 +550,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -580,7 +611,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -647,7 +680,9 @@ async def update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironment] request = build_update_request( @@ -785,7 +820,9 @@ async def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py index 37630e7e29bcf..27cb4ac0ac215 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,9 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentStoragesCollection] request = build_list_request( @@ -150,7 +157,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentStorage] request = build_get_request( @@ -294,7 +303,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentStorage] @@ -373,7 +384,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py index 67857e8db5bb4..5c7996f214e41 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -35,6 +36,10 @@ build_list_by_container_app_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,9 @@ def list_by_container_app( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AuthConfigCollection] error_map = { @@ -107,10 +114,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -173,7 +187,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AuthConfig] request = build_get_request( @@ -317,7 +333,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AuthConfig] @@ -396,7 +414,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py index 29c9bb680bd2b..4af3021097e24 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_revisions_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,9 @@ def list_detectors( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiagnosticsCollection] error_map = { @@ -109,10 +116,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -175,7 +189,9 @@ async def get_detector( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Diagnostics] request = build_get_detector_request( @@ -234,7 +250,9 @@ def list_revisions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RevisionCollection] error_map = { @@ -263,10 +281,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -329,7 +354,9 @@ async def get_revision( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Revision] request = build_get_revision_request( @@ -392,7 +419,9 @@ async def get_root(self, resource_group_name: str, container_app_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerApp] request = build_get_root_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py index f83e8ecb44087..32cbaa396b0b8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -42,6 +43,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,9 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Containe _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerAppCollection] error_map = { @@ -105,10 +112,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -157,7 +171,9 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerAppCollection] error_map = { @@ -184,10 +200,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -246,7 +269,9 @@ async def get(self, resource_group_name: str, container_app_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerApp] request = build_get_request( @@ -299,7 +324,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerApp] @@ -465,7 +492,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerApp] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -522,7 +551,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -581,7 +612,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -637,7 +670,9 @@ async def _update_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -792,7 +827,9 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -864,7 +901,9 @@ async def list_custom_host_name_analysis( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomHostnameAnalysisResult] request = build_list_custom_host_name_analysis_request( @@ -929,7 +968,9 @@ async def list_secrets( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SecretsCollection] request = build_list_secrets_request( @@ -993,7 +1034,9 @@ async def get_auth_token( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerAppAuthToken] request = build_get_auth_token_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py index b3d3fa7eb4887..60ba9d0141b66 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -30,6 +31,10 @@ build_list_replicas_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +91,9 @@ async def get_replica( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Replica] request = build_get_replica_request( @@ -154,7 +161,9 @@ async def list_replicas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicaCollection] request = build_list_replicas_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py index 5b78642d2c07e..9c4c25fabdb1d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_restart_revision_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,9 @@ def list_revisions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RevisionCollection] error_map = { @@ -111,10 +118,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -177,7 +191,9 @@ async def get_revision( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Revision] request = build_get_revision_request( @@ -244,7 +260,9 @@ async def activate_revision( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_activate_revision_request( @@ -307,7 +325,9 @@ async def deactivate_revision( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deactivate_revision_request( @@ -370,7 +390,9 @@ async def restart_revision( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_revision_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py index e507ed394a806..1a9d49e7bf2f9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,6 +38,10 @@ build_list_by_container_app_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,7 +86,9 @@ def list_by_container_app( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlCollection] error_map = { @@ -109,10 +116,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -175,7 +189,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControl] request = build_get_request( @@ -230,7 +246,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControl] @@ -408,7 +426,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControl] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -466,7 +486,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -528,7 +550,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py index 4f776236c2def..056f9cafe743d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -36,6 +37,10 @@ build_list_secrets_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +85,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponentsCollection] error_map = { @@ -108,10 +115,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -174,7 +188,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponent] request = build_get_request( @@ -318,7 +334,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponent] @@ -397,7 +415,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -460,7 +480,9 @@ async def list_secrets( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprSecretsCollection] request = build_list_secrets_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py index d392dc357c2e8..71374ddbd7e1e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -30,6 +31,10 @@ build_list_detectors_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +87,9 @@ async def list_detectors( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiagnosticsCollection] request = build_list_detectors_request( @@ -148,7 +155,9 @@ async def get_detector( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Diagnostics] request = build_get_detector_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py index cde345f82e39d..4a7fba67e4f24 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._managed_environments_diagnostics_operations import build_get_root_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,9 @@ async def get_root( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironment] request = build_get_root_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py index baf963e306de7..41e51c83e3323 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -41,6 +42,10 @@ build_update_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,7 +84,9 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ManagedE _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentsCollection] error_map = { @@ -105,10 +112,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -160,7 +174,9 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentsCollection] error_map = { @@ -187,10 +203,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -249,7 +272,9 @@ async def get(self, resource_group_name: str, environment_name: str, **kwargs: A _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironment] request = build_get_request( @@ -302,7 +327,9 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironment] @@ -468,7 +495,9 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironment] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -525,7 +554,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -584,7 +615,9 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -640,7 +673,9 @@ async def _update_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -795,7 +830,9 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] @@ -865,7 +902,9 @@ async def get_auth_token( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentAuthToken] request = build_get_auth_token_request( @@ -923,7 +962,9 @@ def list_workload_profile_states( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadProfileStatesCollection] error_map = { @@ -951,10 +992,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py index 5be2614126188..1bac692218138 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -32,6 +33,10 @@ build_list_request, ) +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,7 +89,9 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentStoragesCollection] request = build_list_request( @@ -150,7 +157,9 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentStorage] request = build_get_request( @@ -294,7 +303,9 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentStorage] @@ -373,7 +384,9 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py index e33552674ac1b..18f50833443f7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from ..._vendor import _convert_request from ...operations._namespaces_operations import build_check_name_availability_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -151,7 +156,9 @@ async def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py index f755d32945980..215a22cd34f47 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -29,6 +30,10 @@ from ..._vendor import _convert_request from ...operations._operations import build_list_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,7 +70,9 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableOperations] error_map = { @@ -90,10 +97,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py index d13809f587b95..0a940586d0373 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py @@ -55,6 +55,7 @@ from ._models_py3 import ContainerAppSecret from ._models_py3 import ContainerResources from ._models_py3 import CookieExpiration +from ._models_py3 import CorsPolicy from ._models_py3 import CustomDomain from ._models_py3 import CustomDomainConfiguration from ._models_py3 import CustomHostnameAnalysisResult @@ -173,6 +174,7 @@ from ._container_apps_api_client_enums import EnvironmentProvisioningState from ._container_apps_api_client_enums import ExtendedLocationTypes from ._container_apps_api_client_enums import ForwardProxyConvention +from ._container_apps_api_client_enums import IngressClientCertificateMode from ._container_apps_api_client_enums import IngressTransportMethod from ._container_apps_api_client_enums import LogLevel from ._container_apps_api_client_enums import ManagedEnvironmentOutBoundType @@ -239,6 +241,7 @@ "ContainerAppSecret", "ContainerResources", "CookieExpiration", + "CorsPolicy", "CustomDomain", "CustomDomainConfiguration", "CustomHostnameAnalysisResult", @@ -356,6 +359,7 @@ "EnvironmentProvisioningState", "ExtendedLocationTypes", "ForwardProxyConvention", + "IngressClientCertificateMode", "IngressTransportMethod", "LogLevel", "ManagedEnvironmentOutBoundType", diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py index 986746c3cb36a..63aa0c907fd72 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py @@ -165,6 +165,17 @@ class ForwardProxyConvention(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM = "Custom" +class IngressClientCertificateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Client certificate mode for mTLS authentication. Ignore indicates server drops client + certificate on forwarding. Accept indicates server forwards client certificate but does not + require a client certificate. Require indicates server requires a client certificate. + """ + + IGNORE = "ignore" + ACCEPT = "accept" + REQUIRE = "require" + + class IngressTransportMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Ingress transport protocol.""" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py index 13891f015946b..c16dfc4d91003 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py @@ -13,13 +13,18 @@ from .. import _serialization -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from .. import models as _models if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -1565,7 +1570,7 @@ def __init__( self, *, secrets: Optional[List["_models.Secret"]] = None, - active_revisions_mode: Optional[Union[str, "_models.ActiveRevisionsMode"]] = None, + active_revisions_mode: Union[str, "_models.ActiveRevisionsMode"] = "Single", ingress: Optional["_models.Ingress"] = None, registries: Optional[List["_models.RegistryCredentials"]] = None, dapr: Optional["_models.Dapr"] = None, @@ -1949,6 +1954,8 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib :vartype workload_profile_type: str :ivar latest_revision_name: Name of the latest revision of the Container App. :vartype latest_revision_name: str + :ivar latest_ready_revision_name: Name of the latest ready revision of the Container App. + :vartype latest_ready_revision_name: str :ivar latest_revision_fqdn: Fully Qualified Domain Name of the latest revision of the Container App. :vartype latest_revision_fqdn: str @@ -1972,6 +1979,7 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib "location": {"required": True}, "provisioning_state": {"readonly": True}, "latest_revision_name": {"readonly": True}, + "latest_ready_revision_name": {"readonly": True}, "latest_revision_fqdn": {"readonly": True}, "custom_domain_verification_id": {"readonly": True}, "outbound_ip_addresses": {"readonly": True}, @@ -1992,6 +2000,7 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib "environment_id": {"key": "properties.environmentId", "type": "str"}, "workload_profile_type": {"key": "properties.workloadProfileType", "type": "str"}, "latest_revision_name": {"key": "properties.latestRevisionName", "type": "str"}, + "latest_ready_revision_name": {"key": "properties.latestReadyRevisionName", "type": "str"}, "latest_revision_fqdn": {"key": "properties.latestRevisionFqdn", "type": "str"}, "custom_domain_verification_id": {"key": "properties.customDomainVerificationId", "type": "str"}, "configuration": {"key": "properties.configuration", "type": "Configuration"}, @@ -2043,6 +2052,7 @@ def __init__( self.environment_id = environment_id self.workload_profile_type = workload_profile_type self.latest_revision_name = None + self.latest_ready_revision_name = None self.latest_revision_fqdn = None self.custom_domain_verification_id = None self.configuration = configuration @@ -2490,6 +2500,72 @@ def __init__( self.time_to_expiration = time_to_expiration +class CorsPolicy(_serialization.Model): + """Cross-Origin-Resource-Sharing policy. + + All required parameters must be populated in order to send to Azure. + + :ivar allowed_origins: allowed origins. Required. + :vartype allowed_origins: list[str] + :ivar allowed_methods: allowed HTTP methods. + :vartype allowed_methods: list[str] + :ivar allowed_headers: allowed HTTP headers. + :vartype allowed_headers: list[str] + :ivar expose_headers: expose HTTP headers. + :vartype expose_headers: list[str] + :ivar max_age: max time client can cache the result. + :vartype max_age: int + :ivar allow_credentials: allow credential or not. + :vartype allow_credentials: bool + """ + + _validation = { + "allowed_origins": {"required": True}, + } + + _attribute_map = { + "allowed_origins": {"key": "allowedOrigins", "type": "[str]"}, + "allowed_methods": {"key": "allowedMethods", "type": "[str]"}, + "allowed_headers": {"key": "allowedHeaders", "type": "[str]"}, + "expose_headers": {"key": "exposeHeaders", "type": "[str]"}, + "max_age": {"key": "maxAge", "type": "int"}, + "allow_credentials": {"key": "allowCredentials", "type": "bool"}, + } + + def __init__( + self, + *, + allowed_origins: List[str], + allowed_methods: Optional[List[str]] = None, + allowed_headers: Optional[List[str]] = None, + expose_headers: Optional[List[str]] = None, + max_age: Optional[int] = None, + allow_credentials: Optional[bool] = None, + **kwargs + ): + """ + :keyword allowed_origins: allowed origins. Required. + :paramtype allowed_origins: list[str] + :keyword allowed_methods: allowed HTTP methods. + :paramtype allowed_methods: list[str] + :keyword allowed_headers: allowed HTTP headers. + :paramtype allowed_headers: list[str] + :keyword expose_headers: expose HTTP headers. + :paramtype expose_headers: list[str] + :keyword max_age: max time client can cache the result. + :paramtype max_age: int + :keyword allow_credentials: allow credential or not. + :paramtype allow_credentials: bool + """ + super().__init__(**kwargs) + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.allowed_headers = allowed_headers + self.expose_headers = expose_headers + self.max_age = max_age + self.allow_credentials = allow_credentials + + class CustomDomain(_serialization.Model): """Custom Domain of a Container App. @@ -2551,7 +2627,7 @@ class CustomDomainConfiguration(_serialization.Model): :ivar certificate_value: PFX or PEM blob. :vartype certificate_value: bytes :ivar certificate_password: Certificate password. - :vartype certificate_password: bytes + :vartype certificate_password: str :ivar expiration_date: Certificate expiration date. :vartype expiration_date: ~datetime.datetime :ivar thumbprint: Certificate thumbprint. @@ -2571,7 +2647,7 @@ class CustomDomainConfiguration(_serialization.Model): "custom_domain_verification_id": {"key": "customDomainVerificationId", "type": "str"}, "dns_suffix": {"key": "dnsSuffix", "type": "str"}, "certificate_value": {"key": "certificateValue", "type": "bytearray"}, - "certificate_password": {"key": "certificatePassword", "type": "bytearray"}, + "certificate_password": {"key": "certificatePassword", "type": "str"}, "expiration_date": {"key": "expirationDate", "type": "iso-8601"}, "thumbprint": {"key": "thumbprint", "type": "str"}, "subject_name": {"key": "subjectName", "type": "str"}, @@ -2582,7 +2658,7 @@ def __init__( *, dns_suffix: Optional[str] = None, certificate_value: Optional[bytes] = None, - certificate_password: Optional[bytes] = None, + certificate_password: Optional[str] = None, **kwargs ): """ @@ -2591,7 +2667,7 @@ def __init__( :keyword certificate_value: PFX or PEM blob. :paramtype certificate_value: bytes :keyword certificate_password: Certificate password. - :paramtype certificate_password: bytes + :paramtype certificate_password: str """ super().__init__(**kwargs) self.custom_domain_verification_id = None @@ -2918,9 +2994,9 @@ class Dapr(_serialization.Model): def __init__( self, *, - enabled: Optional[bool] = None, + enabled: bool = False, app_id: Optional[str] = None, - app_protocol: Optional[Union[str, "_models.AppProtocol"]] = None, + app_protocol: Union[str, "_models.AppProtocol"] = "http", app_port: Optional[int] = None, http_read_buffer_size: Optional[int] = None, http_max_request_size: Optional[int] = None, @@ -4525,7 +4601,7 @@ def __init__( self.custom_open_id_connect_providers = custom_open_id_connect_providers -class Ingress(_serialization.Model): +class Ingress(_serialization.Model): # pylint: disable=too-many-instance-attributes """Container App Ingress configuration. Variables are only populated by the server, and will be ignored when sending a request. @@ -4551,6 +4627,14 @@ class Ingress(_serialization.Model): :ivar ip_security_restrictions: Rules to restrict incoming IP address. :vartype ip_security_restrictions: list[~azure.mgmt.appcontainers.models.IpSecurityRestrictionRule] + :ivar client_certificate_mode: Client certificate mode for mTLS authentication. Ignore + indicates server drops client certificate on forwarding. Accept indicates server forwards + client certificate but does not require a client certificate. Require indicates server requires + a client certificate. Known values are: "ignore", "accept", and "require". + :vartype client_certificate_mode: str or + ~azure.mgmt.appcontainers.models.IngressClientCertificateMode + :ivar cors_policy: CORS policy for container app. + :vartype cors_policy: ~azure.mgmt.appcontainers.models.CorsPolicy """ _validation = { @@ -4567,6 +4651,8 @@ class Ingress(_serialization.Model): "custom_domains": {"key": "customDomains", "type": "[CustomDomain]"}, "allow_insecure": {"key": "allowInsecure", "type": "bool"}, "ip_security_restrictions": {"key": "ipSecurityRestrictions", "type": "[IpSecurityRestrictionRule]"}, + "client_certificate_mode": {"key": "clientCertificateMode", "type": "str"}, + "cors_policy": {"key": "corsPolicy", "type": "CorsPolicy"}, } def __init__( @@ -4575,11 +4661,13 @@ def __init__( external: bool = False, target_port: Optional[int] = None, exposed_port: Optional[int] = None, - transport: Optional[Union[str, "_models.IngressTransportMethod"]] = None, + transport: Union[str, "_models.IngressTransportMethod"] = "auto", traffic: Optional[List["_models.TrafficWeight"]] = None, custom_domains: Optional[List["_models.CustomDomain"]] = None, - allow_insecure: Optional[bool] = None, + allow_insecure: bool = False, ip_security_restrictions: Optional[List["_models.IpSecurityRestrictionRule"]] = None, + client_certificate_mode: Optional[Union[str, "_models.IngressClientCertificateMode"]] = None, + cors_policy: Optional["_models.CorsPolicy"] = None, **kwargs ): """ @@ -4602,6 +4690,14 @@ def __init__( :keyword ip_security_restrictions: Rules to restrict incoming IP address. :paramtype ip_security_restrictions: list[~azure.mgmt.appcontainers.models.IpSecurityRestrictionRule] + :keyword client_certificate_mode: Client certificate mode for mTLS authentication. Ignore + indicates server drops client certificate on forwarding. Accept indicates server forwards + client certificate but does not require a client certificate. Require indicates server requires + a client certificate. Known values are: "ignore", "accept", and "require". + :paramtype client_certificate_mode: str or + ~azure.mgmt.appcontainers.models.IngressClientCertificateMode + :keyword cors_policy: CORS policy for container app. + :paramtype cors_policy: ~azure.mgmt.appcontainers.models.CorsPolicy """ super().__init__(**kwargs) self.fqdn = None @@ -4613,6 +4709,8 @@ def __init__( self.custom_domains = custom_domains self.allow_insecure = allow_insecure self.ip_security_restrictions = ip_security_restrictions + self.client_certificate_mode = client_certificate_mode + self.cors_policy = cors_policy class InitContainer(BaseContainer): @@ -5327,7 +5425,13 @@ class OpenIdConnectClientCredential(_serialization.Model): "client_secret_setting_name": {"key": "clientSecretSettingName", "type": "str"}, } - def __init__(self, *, method: Optional[str] = None, client_secret_setting_name: Optional[str] = None, **kwargs): + def __init__( + self, + *, + method: Optional[Literal["ClientSecretPost"]] = None, + client_secret_setting_name: Optional[str] = None, + **kwargs + ): """ :keyword method: The method that should be used to authenticate the user. Default value is "ClientSecretPost". diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py index 09ebc13d8cceb..13d3cd51244e7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py @@ -7,10 +7,15 @@ # -------------------------------------------------------------------------- from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations +from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations +from ._billing_meters_operations import BillingMetersOperations +from ._connected_environments_operations import ConnectedEnvironmentsOperations +from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations +from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations +from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations from ._container_apps_operations import ContainerAppsOperations from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations -from ._dapr_components_operations import DaprComponentsOperations from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations @@ -18,14 +23,9 @@ from ._managed_environments_operations import ManagedEnvironmentsOperations from ._certificates_operations import CertificatesOperations from ._namespaces_operations import NamespacesOperations +from ._dapr_components_operations import DaprComponentsOperations from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations -from ._connected_environments_operations import ConnectedEnvironmentsOperations -from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations -from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations -from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations -from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations -from ._billing_meters_operations import BillingMetersOperations from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import @@ -33,10 +33,15 @@ __all__ = [ "ContainerAppsAuthConfigsOperations", + "AvailableWorkloadProfilesOperations", + "BillingMetersOperations", + "ConnectedEnvironmentsOperations", + "ConnectedEnvironmentsCertificatesOperations", + "ConnectedEnvironmentsDaprComponentsOperations", + "ConnectedEnvironmentsStoragesOperations", "ContainerAppsOperations", "ContainerAppsRevisionsOperations", "ContainerAppsRevisionReplicasOperations", - "DaprComponentsOperations", "ContainerAppsDiagnosticsOperations", "ManagedEnvironmentDiagnosticsOperations", "ManagedEnvironmentsDiagnosticsOperations", @@ -44,14 +49,9 @@ "ManagedEnvironmentsOperations", "CertificatesOperations", "NamespacesOperations", + "DaprComponentsOperations", "ManagedEnvironmentsStoragesOperations", "ContainerAppsSourceControlsOperations", - "ConnectedEnvironmentsOperations", - "ConnectedEnvironmentsCertificatesOperations", - "ConnectedEnvironmentsDaprComponentsOperations", - "ConnectedEnvironmentsStoragesOperations", - "AvailableWorkloadProfilesOperations", - "BillingMetersOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py index d6ce4e8757aa9..94d1d81697813 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +105,9 @@ def get(self, location: str, **kwargs: Any) -> Iterable["_models.AvailableWorklo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableWorkloadProfilesCollection] error_map = { @@ -127,10 +134,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py index f144e6ff3c3cd..2ab89d385c53f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -38,7 +43,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +109,9 @@ def get(self, location: str, **kwargs: Any) -> _models.BillingMeterCollection: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.BillingMeterCollection] request = build_get_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py index 6928df5b4526f..21fe141614347 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -249,7 +254,9 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CertificateCollection] error_map = { @@ -277,10 +284,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -343,7 +357,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] request = build_get_request( @@ -487,7 +503,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] @@ -569,7 +587,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -709,7 +729,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py index d6f97acf78438..a936996021490 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +122,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -158,7 +163,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +201,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -267,7 +272,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CertificateCollection] error_map = { @@ -295,10 +302,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -361,7 +375,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] request = build_get_request( @@ -505,7 +521,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] @@ -587,7 +605,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -727,7 +747,9 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.Certificate] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py index 779feac1797e4..8ddbe06f39ca9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -248,7 +253,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponentsCollection] error_map = { @@ -276,10 +283,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -342,7 +356,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponent] request = build_get_request( @@ -486,7 +502,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponent] @@ -565,7 +583,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -628,7 +648,9 @@ def list_secrets( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprSecretsCollection] request = build_list_secrets_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py index f509dd34c3bec..48606d593fc3a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +71,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +103,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +136,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -233,7 +238,7 @@ def build_check_name_availability_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -297,7 +302,9 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ConnectedEnvi _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentCollection] error_map = { @@ -323,10 +330,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -376,7 +390,9 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentCollection] error_map = { @@ -403,10 +419,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -465,7 +488,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironment] request = build_get_request( @@ -518,7 +543,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironment] @@ -678,7 +705,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironment] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -735,7 +764,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -792,7 +823,9 @@ def begin_delete(self, resource_group_name: str, connected_environment_name: str _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -859,7 +892,9 @@ def update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironment] request = build_update_request( @@ -997,7 +1032,9 @@ def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py index 71704372352f7..080919042ff1f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +225,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentStoragesCollection] request = build_list_request( @@ -286,7 +293,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentStorage] request = build_get_request( @@ -430,7 +439,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ConnectedEnvironmentStorage] @@ -509,7 +520,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py index 7f6395b291b55..d56521b1b918b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_container_app_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,7 +219,9 @@ def list_by_container_app( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AuthConfigCollection] error_map = { @@ -242,10 +249,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -308,7 +322,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AuthConfig] request = build_get_request( @@ -452,7 +468,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.AuthConfig] @@ -531,7 +549,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py index a5c4d407195b7..16302e6ce39fa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_detectors_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_get_detector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +119,7 @@ def build_list_revisions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,7 @@ def build_get_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +188,7 @@ def build_get_root_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +256,9 @@ def list_detectors( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiagnosticsCollection] error_map = { @@ -279,10 +286,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -345,7 +359,9 @@ def get_detector( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Diagnostics] request = build_get_detector_request( @@ -404,7 +420,9 @@ def list_revisions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RevisionCollection] error_map = { @@ -433,10 +451,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -499,7 +524,9 @@ def get_revision( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Revision] request = build_get_revision_request( @@ -562,7 +589,9 @@ def get_root(self, resource_group_name: str, container_app_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerApp] request = build_get_root_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py index a04bf0466c8df..ab56d9939f44b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +71,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +103,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +136,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -241,7 +246,7 @@ def build_list_custom_host_name_analysis_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -276,7 +281,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -309,7 +314,7 @@ def build_get_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -369,7 +374,9 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ContainerApp" _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerAppCollection] error_map = { @@ -395,10 +402,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -447,7 +461,9 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerAppCollection] error_map = { @@ -474,10 +490,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -536,7 +559,9 @@ def get(self, resource_group_name: str, container_app_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerApp] request = build_get_request( @@ -589,7 +614,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerApp] @@ -755,7 +782,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerApp] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -812,7 +841,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -869,7 +900,9 @@ def begin_delete(self, resource_group_name: str, container_app_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -925,7 +958,9 @@ def _update_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1080,7 +1115,9 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1152,7 +1189,9 @@ def list_custom_host_name_analysis( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.CustomHostnameAnalysisResult] request = build_list_custom_host_name_analysis_request( @@ -1217,7 +1256,9 @@ def list_secrets( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SecretsCollection] request = build_list_secrets_request( @@ -1281,7 +1322,9 @@ def get_auth_token( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerAppAuthToken] request = build_get_auth_token_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py index db1709a516e8a..5d7e0e7d5b835 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +50,7 @@ def build_get_replica_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +85,7 @@ def build_list_replicas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +165,9 @@ def get_replica( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Replica] request = build_get_replica_request( @@ -228,7 +235,9 @@ def list_replicas( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ReplicaCollection] request = build_list_replicas_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py index f63b88b0b0a02..c6a73af67fbdb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +52,7 @@ def build_list_revisions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +87,7 @@ def build_get_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -116,7 +121,7 @@ def build_activate_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -150,7 +155,7 @@ def build_deactivate_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +189,7 @@ def build_restart_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -254,7 +259,9 @@ def list_revisions( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.RevisionCollection] error_map = { @@ -283,10 +290,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -349,7 +363,9 @@ def get_revision( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Revision] request = build_get_revision_request( @@ -416,7 +432,9 @@ def activate_revision( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_activate_revision_request( @@ -479,7 +497,9 @@ def deactivate_revision( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_deactivate_revision_request( @@ -542,7 +562,9 @@ def restart_revision( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_restart_revision_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py index 77ef5a7ad2ca4..a1cefd1eb158d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +49,7 @@ def build_list_by_container_app_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +116,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -148,7 +153,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,7 +221,9 @@ def list_by_container_app( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControlCollection] error_map = { @@ -244,10 +251,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -310,7 +324,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControl] request = build_get_request( @@ -365,7 +381,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControl] @@ -543,7 +561,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.SourceControl] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -601,7 +621,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -663,7 +685,9 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py index 675f149988b3c..aedf3232f2638 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +114,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -146,7 +151,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -180,7 +185,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +251,9 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponentsCollection] error_map = { @@ -274,10 +281,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -340,7 +354,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponent] request = build_get_request( @@ -484,7 +500,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprComponent] @@ -563,7 +581,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -626,7 +646,9 @@ def list_secrets( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DaprSecretsCollection] request = build_list_secrets_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py index 6f005941581f4..80e0d07a953ba 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_detectors_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_get_detector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +154,9 @@ def list_detectors( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.DiagnosticsCollection] request = build_list_detectors_request( @@ -215,7 +222,9 @@ def get_detector( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.Diagnostics] request = build_get_detector_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py index ff20ef06339af..61e20c79de5ef 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_get_root_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +118,9 @@ def get_root(self, resource_group_name: str, environment_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironment] request = build_get_root_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py index 1c09fd041f992..7251fdd0160a0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,6 +32,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +47,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +71,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +103,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +136,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -167,7 +172,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +205,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -236,7 +241,7 @@ def build_get_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -269,7 +274,7 @@ def build_list_workload_profile_states_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,7 +334,9 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ManagedEnviro _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentsCollection] error_map = { @@ -355,10 +362,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -407,7 +421,9 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentsCollection] error_map = { @@ -434,10 +450,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" @@ -496,7 +519,9 @@ def get(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironment] request = build_get_request( @@ -549,7 +574,9 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironment] @@ -715,7 +742,9 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironment] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -772,7 +801,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( @@ -829,7 +860,9 @@ def begin_delete(self, resource_group_name: str, environment_name: str, **kwargs _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -885,7 +918,9 @@ def _update_initial( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] @@ -1040,7 +1075,9 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[None] polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] @@ -1110,7 +1147,9 @@ def get_auth_token( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.EnvironmentAuthToken] request = build_get_auth_token_request( @@ -1167,7 +1206,9 @@ def list_workload_profile_states( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkloadProfileStatesCollection] error_map = { @@ -1195,10 +1236,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py index ead40f6107008..36526cfae017a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -144,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -220,7 +225,9 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentStoragesCollection] request = build_list_request( @@ -286,7 +293,9 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentStorage] request = build_get_request( @@ -430,7 +439,9 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedEnvironmentStorage] @@ -509,7 +520,9 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[None] request = build_delete_request( diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py index d555f94dcc04b..4b0bd2760a002 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,6 +28,10 @@ from .._serialization import Serializer from .._vendor import _convert_request, _format_url_section +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_check_name_availability_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] accept = _headers.pop("Accept", "application/json") @@ -190,7 +195,9 @@ def check_name_availability( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] cls = kwargs.pop("cls", None) # type: ClsType[_models.CheckNameAvailabilityResponse] diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py index 369b6b60807f5..68ea02cb6a05b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py @@ -6,8 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -from urllib.parse import parse_qs, urljoin, urlparse +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,6 +30,10 @@ from .._serialization import Serializer from .._vendor import _convert_request +if sys.version_info >= (3, 8): + from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports +else: + from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -40,7 +45,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01-preview")) # type: str + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) # type: Literal["2022-10-01"] accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +91,9 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + api_version = kwargs.pop( + "api_version", _params.pop("api-version", self._config.api_version) + ) # type: Literal["2022-10-01"] cls = kwargs.pop("cls", None) # type: ClsType[_models.AvailableOperations] error_map = { @@ -111,10 +118,17 @@ def prepare_request(next_link=None): else: # make call to next link with the client's api-version - _parsed_next_link = urlparse(next_link) - _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) _next_request_params["api-version"] = self._config.api_version - request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) request = _convert_request(request) request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/activate_container_app's_revision.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/activate_container_app's_revision.py new file mode 100644 index 0000000000000..75affd37697f1 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/activate_container_app's_revision.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python activate_container_app's_revision.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps_revisions.activate_revision( + resource_group_name="rg", + container_app_name="testcontainerApp0", + revision_name="testcontainerApp0-pjxhsye", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Revisions_Activate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/analyze_custom_hostname.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/analyze_custom_hostname.py new file mode 100644 index 0000000000000..a8fa1c03918f8 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/analyze_custom_hostname.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python analyze_custom_hostname.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.list_custom_host_name_analysis( + resource_group_name="rg", + container_app_name="testcontainerApp0", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_ListCustomHostNameAnalysis.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py new file mode 100644 index 0000000000000..a48837036b6d3 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python billing_meters_get.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.available_workload_profiles.get( + location="East US", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/AvailableWorkloadProfiles_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py new file mode 100644 index 0000000000000..370b3a75d9c57 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py @@ -0,0 +1,45 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python certificates_check_name_availability.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments.check_name_availability( + resource_group_name="examplerg", + connected_environment_name="testcontainerenv", + check_name_availability_request={ + "name": "testcertificatename", + "type": "Microsoft.App/connectedEnvironments/certificates", + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py new file mode 100644 index 0000000000000..9b5b62b2072e0 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python container_apps_check_name_availability.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.namespaces.check_name_availability( + resource_group_name="examplerg", + environment_name="testcontainerenv", + check_name_availability_request={"name": "testcappname", "type": "Microsoft.App/containerApps"}, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_CheckNameAvailability.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_environments.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_environments.py new file mode 100644 index 0000000000000..7d0452fb76f2d --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_environments.py @@ -0,0 +1,66 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_environments.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.managed_environments.begin_create_or_update( + resource_group_name="examplerg", + environment_name="testcontainerenv", + environment_envelope={ + "location": "East US", + "properties": { + "appLogsConfiguration": {"logAnalyticsConfiguration": {"customerId": "string", "sharedKey": "string"}}, + "customDomainConfiguration": { + "certificatePassword": "private key password", + "certificateValue": "Y2VydA==", + "dnsSuffix": "www.my-name.com", + }, + "daprAIConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/", + "vnetConfiguration": { + "outboundSettings": { + "outBoundType": "UserDefinedRouting", + "virtualNetworkApplianceIp": "192.168.1.20", + } + }, + "workloadProfiles": [ + {"maximumCount": 12, "minimumCount": 3, "workloadProfileType": "GeneralPurpose"}, + {"maximumCount": 6, "minimumCount": 3, "workloadProfileType": "MemoryOptimized"}, + {"maximumCount": 6, "minimumCount": 3, "workloadProfileType": "ComputeOptimized"}, + ], + "zoneRedundant": True, + }, + "sku": {"name": "Premium"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ManagedEnvironments_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_kube_environments.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_kube_environments.py new file mode 100644 index 0000000000000..558ad9a14b3db --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_kube_environments.py @@ -0,0 +1,53 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_kube_environments.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments.begin_create_or_update( + resource_group_name="examplerg", + connected_environment_name="testenv", + environment_envelope={ + "location": "East US", + "properties": { + "customDomainConfiguration": { + "certificatePassword": "private key password", + "certificateValue": "PFX-or-PEM-blob", + "dnsSuffix": "www.my-name.com", + }, + "daprAIConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/", + "staticIp": "1.2.3.4", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironments_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_certificate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_certificate.py new file mode 100644 index 0000000000000..b79a72da57b74 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_certificate.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_certificate.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments_certificates.create_or_update( + resource_group_name="examplerg", + connected_environment_name="testcontainerenv", + certificate_name="certificate-firendly-name", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app.py new file mode 100644 index 0000000000000..0593c67204a9a --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app.py @@ -0,0 +1,139 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_container_app.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.begin_create_or_update( + resource_group_name="rg", + container_app_name="testcontainerApp0", + container_app_envelope={ + "location": "East US", + "properties": { + "configuration": { + "dapr": { + "appPort": 3000, + "appProtocol": "http", + "enableApiLogging": True, + "enabled": True, + "httpMaxRequestSize": 10, + "httpReadBufferSize": 30, + "logLevel": "debug", + }, + "ingress": { + "clientCertificateMode": "accept", + "corsPolicy": { + "allowCredentials": True, + "allowedHeaders": ["HEADER1", "HEADER2"], + "allowedMethods": ["GET", "POST"], + "allowedOrigins": ["https://a.test.com", "https://b.test.com"], + "exposeHeaders": ["HEADER3", "HEADER4"], + "maxAge": 1234, + }, + "customDomains": [ + { + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com", + "name": "www.my-name.com", + }, + { + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com", + "name": "www.my-other-name.com", + }, + ], + "external": True, + "ipSecurityRestrictions": [ + { + "action": "Allow", + "description": "Allowing all IP's within the subnet below to access containerapp", + "ipAddressRange": "192.168.1.1/32", + "name": "Allow work IP A subnet", + }, + { + "action": "Allow", + "description": "Allowing all IP's within the subnet below to access containerapp", + "ipAddressRange": "192.168.1.1/8", + "name": "Allow work IP B subnet", + }, + ], + "targetPort": 3000, + "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], + }, + "maxInactiveRevisions": 10, + }, + "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", + "template": { + "containers": [ + { + "image": "repo/testcontainerApp0:v1", + "name": "testcontainerApp0", + "probes": [ + { + "httpGet": { + "httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}], + "path": "/health", + "port": 8080, + }, + "initialDelaySeconds": 3, + "periodSeconds": 3, + "type": "Liveness", + } + ], + } + ], + "initContainers": [ + { + "args": ["-c", "while true; do echo hello; sleep 10;done"], + "command": ["/bin/sh"], + "image": "repo/testcontainerApp0:v4", + "name": "testinitcontainerApp0", + "resources": {"cpu": 0.2, "memory": "100Mi"}, + } + ], + "scale": { + "maxReplicas": 5, + "minReplicas": 1, + "rules": [ + { + "custom": {"metadata": {"concurrentRequests": "50"}, "type": "http"}, + "name": "httpscalingrule", + } + ], + }, + }, + "workloadProfileType": "GeneralPurpose", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app_auth_config.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app_auth_config.py new file mode 100644 index 0000000000000..cb4d57bf42080 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app_auth_config.py @@ -0,0 +1,51 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_container_app_auth_config.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_auth_configs.create_or_update( + resource_group_name="workerapps-rg-xj", + container_app_name="testcanadacentral", + auth_config_name="current", + auth_config_envelope={ + "properties": { + "globalValidation": {"unauthenticatedClientAction": "AllowAnonymous"}, + "identityProviders": { + "facebook": {"registration": {"appId": "123", "appSecretSettingName": "facebook-secret"}} + }, + "platform": {"enabled": True}, + } + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/AuthConfigs_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app_source_control.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app_source_control.py new file mode 100644 index 0000000000000..ae38db53dc45c --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_container_app_source_control.py @@ -0,0 +1,62 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_container_app_source_control.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_source_controls.begin_create_or_update( + resource_group_name="workerapps-rg-xj", + container_app_name="testcanadacentral", + source_control_name="current", + source_control_envelope={ + "properties": { + "branch": "master", + "githubActionConfiguration": { + "azureCredentials": { + "clientId": "", + "clientSecret": "", + "tenantId": "", + }, + "contextPath": "./", + "image": "image/tag", + "registryInfo": { + "registryPassword": "", + "registryUrl": "xwang971reg.azurecr.io", + "registryUserName": "xwang971reg", + }, + }, + "repoUrl": "https://github.com/xwang971/ghatest", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/SourceControls_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component.py new file mode 100644 index 0000000000000..972c71da65e72 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component.py @@ -0,0 +1,58 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_dapr_component.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments_dapr_components.create_or_update( + resource_group_name="examplerg", + connected_environment_name="myenvironment", + component_name="reddog", + dapr_component_envelope={ + "properties": { + "componentType": "state.azure.cosmosdb", + "ignoreErrors": False, + "initTimeout": "50s", + "metadata": [ + {"name": "url", "value": ""}, + {"name": "database", "value": "itemsDB"}, + {"name": "collection", "value": "items"}, + {"name": "masterkey", "secretRef": "masterkey"}, + ], + "scopes": ["container-app-1", "container-app-2"], + "secrets": [{"name": "masterkey", "value": "keyvalue"}], + "version": "v1", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component_with_secret_store_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component_with_secret_store_component.py new file mode 100644 index 0000000000000..6fcab235f32c1 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component_with_secret_store_component.py @@ -0,0 +1,58 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_dapr_component_with_secret_store_component.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.dapr_components.create_or_update( + resource_group_name="examplerg", + environment_name="myenvironment", + component_name="reddog", + dapr_component_envelope={ + "properties": { + "componentType": "state.azure.cosmosdb", + "ignoreErrors": False, + "initTimeout": "50s", + "metadata": [ + {"name": "url", "value": ""}, + {"name": "database", "value": "itemsDB"}, + {"name": "collection", "value": "items"}, + {"name": "masterkey", "secretRef": "masterkey"}, + ], + "scopes": ["container-app-1", "container-app-2"], + "secretStoreComponent": "my-secret-store", + "version": "v1", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component_with_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component_with_secrets.py new file mode 100644 index 0000000000000..cd6bb2f61d0e7 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_dapr_component_with_secrets.py @@ -0,0 +1,58 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_dapr_component_with_secrets.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.dapr_components.create_or_update( + resource_group_name="examplerg", + environment_name="myenvironment", + component_name="reddog", + dapr_component_envelope={ + "properties": { + "componentType": "state.azure.cosmosdb", + "ignoreErrors": False, + "initTimeout": "50s", + "metadata": [ + {"name": "url", "value": ""}, + {"name": "database", "value": "itemsDB"}, + {"name": "collection", "value": "items"}, + {"name": "masterkey", "secretRef": "masterkey"}, + ], + "scopes": ["container-app-1", "container-app-2"], + "secrets": [{"name": "masterkey", "value": "keyvalue"}], + "version": "v1", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/DaprComponents_CreateOrUpdate_Secrets.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_environments_storage.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_environments_storage.py new file mode 100644 index 0000000000000..cf0dec41de91c --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_environments_storage.py @@ -0,0 +1,52 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_environments_storage.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments_storages.create_or_update( + resource_group_name="examplerg", + connected_environment_name="env", + storage_name="jlaw-demo1", + storage_envelope={ + "properties": { + "azureFile": { + "accessMode": "ReadOnly", + "accountKey": "key", + "accountName": "account1", + "shareName": "share1", + } + } + }, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_tcp_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_tcp_app.py new file mode 100644 index 0000000000000..0eb185ebbde7c --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/create_or_update_tcp_app.py @@ -0,0 +1,77 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python create_or_update_tcp_app.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.begin_create_or_update( + resource_group_name="rg", + container_app_name="testcontainerAppTcp", + container_app_envelope={ + "location": "East US", + "properties": { + "configuration": { + "ingress": { + "exposedPort": 4000, + "external": True, + "targetPort": 3000, + "traffic": [{"revisionName": "testcontainerAppTcp-ab1234", "weight": 100}], + "transport": "tcp", + } + }, + "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", + "template": { + "containers": [ + { + "image": "repo/testcontainerAppTcp:v1", + "name": "testcontainerAppTcp", + "probes": [ + { + "initialDelaySeconds": 3, + "periodSeconds": 3, + "tcpSocket": {"port": 8080}, + "type": "Liveness", + } + ], + } + ], + "scale": { + "maxReplicas": 5, + "minReplicas": 1, + "rules": [{"name": "tcpscalingrule", "tcp": {"metadata": {"concurrentConnections": "50"}}}], + }, + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_TcpApp_CreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/deactivate_container_app's_revision.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/deactivate_container_app's_revision.py new file mode 100644 index 0000000000000..5a322195e42bf --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/deactivate_container_app's_revision.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python deactivate_container_app's_revision.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps_revisions.deactivate_revision( + resource_group_name="rg", + container_app_name="testcontainerApp0", + revision_name="testcontainerApp0-pjxhsye", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Revisions_Deactivate.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_certificate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_certificate.py new file mode 100644 index 0000000000000..7bc6f6d7f7647 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_certificate.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python delete_certificate.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments_certificates.delete( + resource_group_name="examplerg", + connected_environment_name="testcontainerenv", + certificate_name="certificate-firendly-name", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsCertificate_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_connected_environment_by_connected_environment_name.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_connected_environment_by_connected_environment_name.py new file mode 100644 index 0000000000000..d5a2fde5403d1 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_connected_environment_by_connected_environment_name.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python delete_connected_environment_by_connected_environment_name.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments.begin_delete( + resource_group_name="examplerg", + connected_environment_name="examplekenv", + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironments_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app.py new file mode 100644 index 0000000000000..ad03208a2036c --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python delete_container_app.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.begin_delete( + resource_group_name="rg", + container_app_name="testWorkerApp0", + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app_auth_config.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app_auth_config.py new file mode 100644 index 0000000000000..05ded2446f7bd --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app_auth_config.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python delete_container_app_auth_config.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_auth_configs.delete( + resource_group_name="workerapps-rg-xj", + container_app_name="testcanadacentral", + auth_config_name="current", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/AuthConfigs_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app_source_control.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app_source_control.py new file mode 100644 index 0000000000000..4bb969912e7bf --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_container_app_source_control.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python delete_container_app_source_control.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_source_controls.begin_delete( + resource_group_name="workerapps-rg-xj", + container_app_name="testcanadacentral", + source_control_name="current", + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/SourceControls_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_dapr_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_dapr_component.py new file mode 100644 index 0000000000000..953ea6e746467 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_dapr_component.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python delete_dapr_component.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments_dapr_components.delete( + resource_group_name="examplerg", + connected_environment_name="myenvironment", + component_name="reddog", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsDaprComponents_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_environment_by_name.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_environment_by_name.py new file mode 100644 index 0000000000000..a58976f3128c6 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/delete_environment_by_name.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python delete_environment_by_name.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.managed_environments.begin_delete( + resource_group_name="examplerg", + environment_name="examplekenv", + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ManagedEnvironments_Delete.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_a_environments_storage_properties_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_a_environments_storage_properties_by_subscription.py new file mode 100644 index 0000000000000..9b58e0894242e --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_a_environments_storage_properties_by_subscription.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_a_environments_storage_properties_by_subscription.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments_storages.get( + resource_group_name="examplerg", + connected_environment_name="env", + storage_name="jlaw-demo1", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsStorages_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_certificate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_certificate.py new file mode 100644 index 0000000000000..ac4d6f7eda821 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_certificate.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_certificate.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments_certificates.get( + resource_group_name="examplerg", + connected_environment_name="testcontainerenv", + certificate_name="certificate-firendly-name", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsCertificate_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_connected_environment_by_connected_environment_name.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_connected_environment_by_connected_environment_name.py new file mode 100644 index 0000000000000..7bddde61e573d --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_connected_environment_by_connected_environment_name.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_connected_environment_by_connected_environment_name.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments.get( + resource_group_name="examplerg", + connected_environment_name="examplekenv", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironments_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_auth_config.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_auth_config.py new file mode 100644 index 0000000000000..ed847838788f7 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_auth_config.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_container_app's_auth_config.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_auth_configs.get( + resource_group_name="workerapps-rg-xj", + container_app_name="testcanadacentral", + auth_config_name="current", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/AuthConfigs_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_diagnostics_info.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_diagnostics_info.py new file mode 100644 index 0000000000000..69d8bbe2affa4 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_diagnostics_info.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_container_app's_diagnostics_info.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="f07f3711-b45e-40fe-a941-4e6d93f851e6", + ) + + response = client.container_apps_diagnostics.get_detector( + resource_group_name="mikono-workerapp-test-rg", + container_app_name="mikono-capp-stage1", + detector_name="cappcontainerappnetworkIO", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerAppsDiagnostics_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_revision.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_revision.py new file mode 100644 index 0000000000000..0dcd304c028b4 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_revision.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_container_app's_revision.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps_revisions.get_revision( + resource_group_name="rg", + container_app_name="testcontainerApp0", + revision_name="testcontainerApp0-pjxhsye", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Revisions_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_revision_replica.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_revision_replica.py new file mode 100644 index 0000000000000..e2520559178e5 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_revision_replica.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_container_app's_revision_replica.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_revision_replicas.get_replica( + resource_group_name="workerapps-rg-xj", + container_app_name="myapp", + revision_name="myapp--0wlqy09", + replica_name="myapp--0wlqy09-5d9774cff-5wnd8", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Replicas_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_source_control.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_source_control.py new file mode 100644 index 0000000000000..b058a94df7b93 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app's_source_control.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_container_app's_source_control.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_source_controls.get( + resource_group_name="workerapps-rg-xj", + container_app_name="testcanadacentral", + source_control_name="current", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/SourceControls_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app.py new file mode 100644 index 0000000000000..fb9e67125cc56 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_container_app.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.get( + resource_group_name="rg", + container_app_name="testcontainerApp0", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app_auth_token.py new file mode 100644 index 0000000000000..e010d2043d35b --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_container_app_auth_token.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_container_app_auth_token.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps.get_auth_token( + resource_group_name="rg", + container_app_name="testcontainerApp0", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_GetAuthToken.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component.py new file mode 100644 index 0000000000000..ede424900b9e5 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_dapr_component.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments_dapr_components.get( + resource_group_name="examplerg", + connected_environment_name="myenvironment", + component_name="reddog", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsDaprComponents_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component_with_secret_store_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component_with_secret_store_component.py new file mode 100644 index 0000000000000..e909796392d4d --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component_with_secret_store_component.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_dapr_component_with_secret_store_component.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.dapr_components.get( + resource_group_name="examplerg", + environment_name="myenvironment", + component_name="reddog", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/DaprComponents_Get_SecretStoreComponent.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component_with_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component_with_secrets.py new file mode 100644 index 0000000000000..9c53078bdb6ee --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_dapr_component_with_secrets.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_dapr_component_with_secrets.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.dapr_components.get( + resource_group_name="examplerg", + environment_name="myenvironment", + component_name="reddog", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/DaprComponents_Get_Secrets.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_diagnostic_data_for_a_managed_environments.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_diagnostic_data_for_a_managed_environments.py new file mode 100644 index 0000000000000..06f75417fed14 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_diagnostic_data_for_a_managed_environments.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_diagnostic_data_for_a_managed_environments.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="f07f3711-b45e-40fe-a941-4e6d93f851e6", + ) + + response = client.managed_environment_diagnostics.get_detector( + resource_group_name="mikono-workerapp-test-rg", + environment_name="mikonokubeenv", + detector_name="ManagedEnvAvailabilityMetrics", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ManagedEnvironmentDiagnostics_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_environments_by_name.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_environments_by_name.py new file mode 100644 index 0000000000000..416c6a207d4f0 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_environments_by_name.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_environments_by_name.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.managed_environments_diagnostics.get_root( + resource_group_name="examplerg", + environment_name="jlaw-demo1", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ManagedEnvironments_Get.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_managed_environment_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_managed_environment_auth_token.py new file mode 100644 index 0000000000000..c486fdbe870da --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_managed_environment_auth_token.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_managed_environment_auth_token.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.managed_environments.get_auth_token( + resource_group_name="rg", + environment_name="testenv", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ManagedEnvironments_GetAuthToken.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_the_list_of_available_diagnostic_data_for_a_managed_environments.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_the_list_of_available_diagnostic_data_for_a_managed_environments.py new file mode 100644 index 0000000000000..742a6d9593af8 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_the_list_of_available_diagnostic_data_for_a_managed_environments.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_the_list_of_available_diagnostic_data_for_a_managed_environments.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="f07f3711-b45e-40fe-a941-4e6d93f851e6", + ) + + response = client.managed_environment_diagnostics.list_detectors( + resource_group_name="mikono-workerapp-test-rg", + environment_name="mikonokubeenv", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ManagedEnvironmentDiagnostics_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_the_list_of_available_diagnostics_for_a_given_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_the_list_of_available_diagnostics_for_a_given_container_app.py new file mode 100644 index 0000000000000..90d28331e72a4 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/get_the_list_of_available_diagnostics_for_a_given_container_app.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python get_the_list_of_available_diagnostics_for_a_given_container_app.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="f07f3711-b45e-40fe-a941-4e6d93f851e6", + ) + + response = client.container_apps_diagnostics.list_detectors( + resource_group_name="mikono-workerapp-test-rg", + container_app_name="mikono-capp-stage1", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerAppsDiagnostics_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_all_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_all_operations.py new file mode 100644 index 0000000000000..bd0425db8f640 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_all_operations.py @@ -0,0 +1,39 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_all_operations.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Operations_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_app's_source_controls.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_app's_source_controls.py new file mode 100644 index 0000000000000..c76cbbaf1bc69 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_app's_source_controls.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_app's_source_controls.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_source_controls.list_by_container_app( + resource_group_name="workerapps-rg-xj", + container_app_name="testcanadacentral", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/SourceControls_ListByContainer.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_auth_configs_by_container_apps.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_auth_configs_by_container_apps.py new file mode 100644 index 0000000000000..04ca9b789960b --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_auth_configs_by_container_apps.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_auth_configs_by_container_apps.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_auth_configs.list_by_container_app( + resource_group_name="workerapps-rg-xj", + container_app_name="testcanadacentral", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/AuthConfigs_ListByContainer.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_certificates_by_connected_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_certificates_by_connected_environment.py new file mode 100644 index 0000000000000..4dba5ddc52cf5 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_certificates_by_connected_environment.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_certificates_by_connected_environment.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments_certificates.list( + resource_group_name="examplerg", + connected_environment_name="testcontainerenv", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_certificates_by_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_certificates_by_managed_environment.py new file mode 100644 index 0000000000000..6890e1b782840 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_certificates_by_managed_environment.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_certificates_by_managed_environment.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.certificates.list( + resource_group_name="examplerg", + environment_name="testcontainerenv", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Certificates_ListByManagedEnvironment.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_connected_environments_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_connected_environments_by_subscription.py new file mode 100644 index 0000000000000..3e47101a69346 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_connected_environments_by_subscription.py @@ -0,0 +1,39 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_connected_environments_by_subscription.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironments_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_app's_replicas.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_app's_replicas.py new file mode 100644 index 0000000000000..2e187b9140560 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_app's_replicas.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_container_app's_replicas.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="651f8027-33e8-4ec4-97b4-f6e9f3dc8744", + ) + + response = client.container_apps_revision_replicas.list_replicas( + resource_group_name="workerapps-rg-xj", + container_app_name="myapp", + revision_name="myapp--0wlqy09", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Replicas_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_app's_revisions.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_app's_revisions.py new file mode 100644 index 0000000000000..e9a0895b81ab7 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_app's_revisions.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_container_app's_revisions.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps_revisions.list_revisions( + resource_group_name="rg", + container_app_name="testcontainerApp0", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Revisions_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_by_resource_group.py new file mode 100644 index 0000000000000..bd79eb8dd81f0 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_by_resource_group.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_container_apps_by_resource_group.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.list_by_resource_group( + resource_group_name="rg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_by_subscription.py new file mode 100644 index 0000000000000..7c12f7fd6a0c3 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_by_subscription.py @@ -0,0 +1,39 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_container_apps_by_subscription.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_secrets.py new file mode 100644 index 0000000000000..5bbe3e5effabd --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_container_apps_secrets.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_container_apps_secrets.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments_dapr_components.list_secrets( + resource_group_name="examplerg", + connected_environment_name="myenvironment", + component_name="reddog", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_dapr_components.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_dapr_components.py new file mode 100644 index 0000000000000..8edd9288229ce --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_dapr_components.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_dapr_components.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments_dapr_components.list( + resource_group_name="examplerg", + connected_environment_name="myenvironment", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsDaprComponents_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_by_resource_group.py new file mode 100644 index 0000000000000..6f2a62f7db1f4 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_by_resource_group.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_environments_by_resource_group.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments.list_by_resource_group( + resource_group_name="examplerg", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironments_ListByResourceGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_by_subscription.py new file mode 100644 index 0000000000000..05ceae1922005 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_by_subscription.py @@ -0,0 +1,39 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_environments_by_subscription.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.managed_environments.list_by_subscription() + for item in response: + print(item) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ManagedEnvironments_ListBySubscription.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_storages_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_storages_by_subscription.py new file mode 100644 index 0000000000000..1adc0175ae834 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/list_environments_storages_by_subscription.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python list_environments_storages_by_subscription.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", + ) + + response = client.connected_environments_storages.list( + resource_group_name="examplerg", + connected_environment_name="managedEnv", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsStorages_List.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_certificate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_certificate.py new file mode 100644 index 0000000000000..4e625449c4e07 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_certificate.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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python patch_certificate.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments_certificates.update( + resource_group_name="examplerg", + connected_environment_name="testcontainerenv", + certificate_name="certificate-firendly-name", + certificate_envelope={"tags": {"tag1": "value1", "tag2": "value2"}}, + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironmentsCertificates_Patch.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_container_app.py new file mode 100644 index 0000000000000..888eab472a380 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_container_app.py @@ -0,0 +1,127 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python patch_container_app.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps.begin_update( + resource_group_name="rg", + container_app_name="testcontainerApp0", + container_app_envelope={ + "location": "East US", + "properties": { + "configuration": { + "dapr": { + "appPort": 3000, + "appProtocol": "http", + "enableApiLogging": True, + "enabled": True, + "httpMaxRequestSize": 10, + "httpReadBufferSize": 30, + "logLevel": "debug", + }, + "ingress": { + "customDomains": [ + { + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com", + "name": "www.my-name.com", + }, + { + "bindingType": "SniEnabled", + "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com", + "name": "www.my-other-name.com", + }, + ], + "external": True, + "ipSecurityRestrictions": [ + { + "action": "Allow", + "description": "Allowing all IP's within the subnet below to access containerapp", + "ipAddressRange": "192.168.1.1/32", + "name": "Allow work IP A subnet", + }, + { + "action": "Allow", + "description": "Allowing all IP's within the subnet below to access containerapp", + "ipAddressRange": "192.168.1.1/8", + "name": "Allow work IP B subnet", + }, + ], + "targetPort": 3000, + "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], + }, + "maxInactiveRevisions": 10, + }, + "template": { + "containers": [ + { + "image": "repo/testcontainerApp0:v1", + "name": "testcontainerApp0", + "probes": [ + { + "httpGet": { + "httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}], + "path": "/health", + "port": 8080, + }, + "initialDelaySeconds": 3, + "periodSeconds": 3, + "type": "Liveness", + } + ], + } + ], + "initContainers": [ + { + "image": "repo/testcontainerApp0:v4", + "name": "testinitcontainerApp0", + "resources": {"cpu": 0.2, "memory": "100Mi"}, + } + ], + "scale": { + "maxReplicas": 5, + "minReplicas": 1, + "rules": [ + { + "custom": {"metadata": {"concurrentRequests": "50"}, "type": "http"}, + "name": "httpscalingrule", + } + ], + }, + }, + }, + "tags": {"tag1": "value1", "tag2": "value2"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ContainerApps_Patch.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_managed_environment.py new file mode 100644 index 0000000000000..c91e92db90970 --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/patch_managed_environment.py @@ -0,0 +1,41 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python patch_managed_environment.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.connected_environments.update( + resource_group_name="examplerg", + connected_environment_name="testenv", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/ConnectedEnvironments_Patch.json +if __name__ == "__main__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/restart_container_app's_revision.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/restart_container_app's_revision.py new file mode 100644 index 0000000000000..4b258765b536e --- /dev/null +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/restart_container_app's_revision.py @@ -0,0 +1,42 @@ +# 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) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.appcontainers import ContainerAppsAPIClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-appcontainers +# USAGE + python restart_container_app's_revision.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 = ContainerAppsAPIClient( + credential=DefaultAzureCredential(), + subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + ) + + response = client.container_apps_revisions.restart_revision( + resource_group_name="rg", + container_app_name="testStaticSite0", + revision_name="testcontainerApp0-pjxhsye", + ) + print(response) + + +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2022-10-01/examples/Revisions_Restart.json +if __name__ == "__main__": + main()