From 9695b413f0576290e8c0d7db572baa564d01dc42 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 5 Aug 2022 09:14:06 +0000 Subject: [PATCH] CodeGen from PR 20092 in Azure/azure-rest-api-specs migrate to .net track 2 batch 2 (#20092) --- sdk/logic/azure-mgmt-logic/_meta.json | 6 +- .../azure/mgmt/logic/__init__.py | 13 +- .../mgmt/logic/_logic_management_client.py | 108 +- .../azure/mgmt/logic/_version.py | 2 +- .../azure/mgmt/logic/aio/__init__.py | 13 +- .../logic/aio/_logic_management_client.py | 108 +- .../mgmt/logic/aio/operations/__init__.py | 5 + ...tegration_account_agreements_operations.py | 122 +- ...tegration_account_assemblies_operations.py | 118 +- ...account_batch_configurations_operations.py | 101 +- ...gration_account_certificates_operations.py | 101 +- .../_integration_account_maps_operations.py | 122 +- ...integration_account_partners_operations.py | 122 +- ..._integration_account_schemas_operations.py | 122 +- ...integration_account_sessions_operations.py | 101 +- .../_integration_accounts_operations.py | 225 ++-- ...nment_managed_api_operations_operations.py | 48 +- ...ice_environment_managed_apis_operations.py | 152 ++- ...e_environment_network_health_operations.py | 46 +- ...ion_service_environment_skus_operations.py | 48 +- ...gration_service_environments_operations.py | 214 ++-- .../mgmt/logic/aio/operations/_operations.py | 48 +- .../azure/mgmt/logic/aio/operations/_patch.py | 19 + ...kflow_run_action_repetitions_operations.py | 84 +- ...epetitions_request_histories_operations.py | 65 +- ...run_action_request_histories_operations.py | 65 +- ...run_action_scope_repetitions_operations.py | 65 +- .../_workflow_run_actions_operations.py | 84 +- .../_workflow_run_operations_operations.py | 46 +- .../operations/_workflow_runs_operations.py | 80 +- .../_workflow_trigger_histories_operations.py | 80 +- .../_workflow_triggers_operations.py | 148 ++- .../_workflow_version_triggers_operations.py | 50 +- .../_workflow_versions_operations.py | 65 +- .../aio/operations/_workflows_operations.py | 325 +++-- .../azure/mgmt/logic/models/__init__.py | 6 +- .../models/_logic_management_client_enums.py | 93 +- .../azure/mgmt/logic/models/_models_py3.py | 1106 ++++++++--------- .../azure/mgmt/logic/models/_patch.py | 19 + .../azure/mgmt/logic/operations/__init__.py | 5 + ...tegration_account_agreements_operations.py | 226 ++-- ...tegration_account_assemblies_operations.py | 212 ++-- ...account_batch_configurations_operations.py | 178 +-- ...gration_account_certificates_operations.py | 180 +-- .../_integration_account_maps_operations.py | 226 ++-- ...integration_account_partners_operations.py | 226 ++-- ..._integration_account_schemas_operations.py | 226 ++-- ...integration_account_sessions_operations.py | 182 +-- .../_integration_accounts_operations.py | 438 ++++--- ...nment_managed_api_operations_operations.py | 67 +- ...ice_environment_managed_apis_operations.py | 229 ++-- ...e_environment_network_health_operations.py | 65 +- ...ion_service_environment_skus_operations.py | 67 +- ...gration_service_environments_operations.py | 352 +++--- .../mgmt/logic/operations/_operations.py | 67 +- .../azure/mgmt/logic/operations/_patch.py | 19 + ...kflow_run_action_repetitions_operations.py | 137 +- ...epetitions_request_histories_operations.py | 101 +- ...run_action_request_histories_operations.py | 101 +- ...run_action_scope_repetitions_operations.py | 101 +- .../_workflow_run_actions_operations.py | 141 ++- .../_workflow_run_operations_operations.py | 65 +- .../operations/_workflow_runs_operations.py | 137 +- .../_workflow_trigger_histories_operations.py | 137 +- .../_workflow_triggers_operations.py | 280 +++-- .../_workflow_version_triggers_operations.py | 76 +- .../_workflow_versions_operations.py | 103 +- .../logic/operations/_workflows_operations.py | 633 ++++++---- 68 files changed, 5411 insertions(+), 3911 deletions(-) create mode 100644 sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_patch.py create mode 100644 sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_patch.py create mode 100644 sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_patch.py diff --git a/sdk/logic/azure-mgmt-logic/_meta.json b/sdk/logic/azure-mgmt-logic/_meta.json index dced201649e5..1aecc5e2b8d1 100644 --- a/sdk/logic/azure-mgmt-logic/_meta.json +++ b/sdk/logic/azure-mgmt-logic/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.7.2", "use": [ - "@autorest/python@5.13.0", + "@autorest/python@5.16.0", "@autorest/modelerfour@4.19.3" ], - "commit": "2d6cb29af754f48a08f94cb6113bb1f01a4e0eb9", + "commit": "63f4e39c20223c20941614e776d33e699c3e2777", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/logic/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/logic/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/logic/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/__init__.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/__init__.py index ff14d90f5571..f06f40935465 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/__init__.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/__init__.py @@ -10,9 +10,14 @@ from ._version import VERSION __version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk __all__ = ['LogicManagementClient'] +__all__.extend([p for p in _patch_all if p not in __all__]) -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() +_patch_sdk() diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_logic_management_client.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_logic_management_client.py index 97028a93e61f..fa74b33044a3 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_logic_management_client.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_logic_management_client.py @@ -132,33 +132,87 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.workflows = WorkflowsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_versions = WorkflowVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_triggers = WorkflowTriggersOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_version_triggers = WorkflowVersionTriggersOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_trigger_histories = WorkflowTriggerHistoriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_runs = WorkflowRunsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_actions = WorkflowRunActionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_action_repetitions = WorkflowRunActionRepetitionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_action_repetitions_request_histories = WorkflowRunActionRepetitionsRequestHistoriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_action_request_histories = WorkflowRunActionRequestHistoriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_action_scope_repetitions = WorkflowRunActionScopeRepetitionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_operations = WorkflowRunOperationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_accounts = IntegrationAccountsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_assemblies = IntegrationAccountAssembliesOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_batch_configurations = IntegrationAccountBatchConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_schemas = IntegrationAccountSchemasOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_maps = IntegrationAccountMapsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_partners = IntegrationAccountPartnersOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_agreements = IntegrationAccountAgreementsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_certificates = IntegrationAccountCertificatesOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_sessions = IntegrationAccountSessionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environments = IntegrationServiceEnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environment_skus = IntegrationServiceEnvironmentSkusOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environment_network_health = IntegrationServiceEnvironmentNetworkHealthOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environment_managed_apis = IntegrationServiceEnvironmentManagedApisOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environment_managed_api_operations = IntegrationServiceEnvironmentManagedApiOperationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.workflows = WorkflowsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_versions = WorkflowVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_triggers = WorkflowTriggersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_version_triggers = WorkflowVersionTriggersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_trigger_histories = WorkflowTriggerHistoriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_runs = WorkflowRunsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_actions = WorkflowRunActionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_action_repetitions = WorkflowRunActionRepetitionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_action_repetitions_request_histories = WorkflowRunActionRepetitionsRequestHistoriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_action_request_histories = WorkflowRunActionRequestHistoriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_action_scope_repetitions = WorkflowRunActionScopeRepetitionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_operations = WorkflowRunOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_accounts = IntegrationAccountsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_assemblies = IntegrationAccountAssembliesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_batch_configurations = IntegrationAccountBatchConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_schemas = IntegrationAccountSchemasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_maps = IntegrationAccountMapsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_partners = IntegrationAccountPartnersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_agreements = IntegrationAccountAgreementsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_certificates = IntegrationAccountCertificatesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_sessions = IntegrationAccountSessionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environments = IntegrationServiceEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environment_skus = IntegrationServiceEnvironmentSkusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environment_network_health = IntegrationServiceEnvironmentNetworkHealthOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environment_managed_apis = IntegrationServiceEnvironmentManagedApisOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environment_managed_api_operations = IntegrationServiceEnvironmentManagedApiOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_version.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_version.py index 9f8bb24bdd99..e5754a47ce68 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_version.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/__init__.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/__init__.py index 23b8536c72c8..3ae8ca35a8b2 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/__init__.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/__init__.py @@ -7,9 +7,14 @@ # -------------------------------------------------------------------------- from ._logic_management_client import LogicManagementClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk __all__ = ['LogicManagementClient'] +__all__.extend([p for p in _patch_all if p not in __all__]) -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() +_patch_sdk() diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_logic_management_client.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_logic_management_client.py index 9585250c94f7..3fc5ec7a21e1 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_logic_management_client.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_logic_management_client.py @@ -134,33 +134,87 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.workflows = WorkflowsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_versions = WorkflowVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_triggers = WorkflowTriggersOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_version_triggers = WorkflowVersionTriggersOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_trigger_histories = WorkflowTriggerHistoriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_runs = WorkflowRunsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_actions = WorkflowRunActionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_action_repetitions = WorkflowRunActionRepetitionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_action_repetitions_request_histories = WorkflowRunActionRepetitionsRequestHistoriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_action_request_histories = WorkflowRunActionRequestHistoriesOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_action_scope_repetitions = WorkflowRunActionScopeRepetitionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.workflow_run_operations = WorkflowRunOperationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_accounts = IntegrationAccountsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_assemblies = IntegrationAccountAssembliesOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_batch_configurations = IntegrationAccountBatchConfigurationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_schemas = IntegrationAccountSchemasOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_maps = IntegrationAccountMapsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_partners = IntegrationAccountPartnersOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_agreements = IntegrationAccountAgreementsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_certificates = IntegrationAccountCertificatesOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_account_sessions = IntegrationAccountSessionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environments = IntegrationServiceEnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environment_skus = IntegrationServiceEnvironmentSkusOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environment_network_health = IntegrationServiceEnvironmentNetworkHealthOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environment_managed_apis = IntegrationServiceEnvironmentManagedApisOperations(self._client, self._config, self._serialize, self._deserialize) - self.integration_service_environment_managed_api_operations = IntegrationServiceEnvironmentManagedApiOperationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.workflows = WorkflowsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_versions = WorkflowVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_triggers = WorkflowTriggersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_version_triggers = WorkflowVersionTriggersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_trigger_histories = WorkflowTriggerHistoriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_runs = WorkflowRunsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_actions = WorkflowRunActionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_action_repetitions = WorkflowRunActionRepetitionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_action_repetitions_request_histories = WorkflowRunActionRepetitionsRequestHistoriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_action_request_histories = WorkflowRunActionRequestHistoriesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_action_scope_repetitions = WorkflowRunActionScopeRepetitionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.workflow_run_operations = WorkflowRunOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_accounts = IntegrationAccountsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_assemblies = IntegrationAccountAssembliesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_batch_configurations = IntegrationAccountBatchConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_schemas = IntegrationAccountSchemasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_maps = IntegrationAccountMapsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_partners = IntegrationAccountPartnersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_agreements = IntegrationAccountAgreementsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_certificates = IntegrationAccountCertificatesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_account_sessions = IntegrationAccountSessionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environments = IntegrationServiceEnvironmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environment_skus = IntegrationServiceEnvironmentSkusOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environment_network_health = IntegrationServiceEnvironmentNetworkHealthOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environment_managed_apis = IntegrationServiceEnvironmentManagedApisOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.integration_service_environment_managed_api_operations = IntegrationServiceEnvironmentManagedApiOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request( diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/__init__.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/__init__.py index 5c557560db0a..d3898f2257d7 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/__init__.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/__init__.py @@ -34,6 +34,9 @@ from ._integration_service_environment_managed_api_operations_operations import IntegrationServiceEnvironmentManagedApiOperationsOperations from ._operations import Operations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk __all__ = [ 'WorkflowsOperations', 'WorkflowVersionsOperations', @@ -63,3 +66,5 @@ 'IntegrationServiceEnvironmentManagedApiOperationsOperations', 'Operations', ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() \ No newline at end of file diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_agreements_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_agreements_operations.py index 5407f919c228..8beab06f5660 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_agreements_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_agreements_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountAgreementsOperations: - """IntegrationAccountAgreementsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_account_agreements` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountAgreementListResult"]: + ) -> AsyncIterable[_models.IntegrationAccountAgreementListResult]: """Gets a list of integration account agreements. :param resource_group_name: The resource group name. @@ -72,13 +71,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountAgreementListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountAgreementListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreementListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -90,9 +92,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -104,9 +108,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -147,7 +153,7 @@ async def get( integration_account_name: str, agreement_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountAgreement": + ) -> _models.IntegrationAccountAgreement: """Gets an integration account agreement. :param resource_group_name: The resource group name. @@ -161,13 +167,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreement"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountAgreement] request = build_get_request( @@ -177,11 +186,13 @@ async def get( agreement_name=agreement_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -209,9 +220,9 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, agreement_name: str, - agreement: "_models.IntegrationAccountAgreement", + agreement: _models.IntegrationAccountAgreement, **kwargs: Any - ) -> "_models.IntegrationAccountAgreement": + ) -> _models.IntegrationAccountAgreement: """Creates or updates an integration account agreement. :param resource_group_name: The resource group name. @@ -227,14 +238,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreement"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountAgreement] _json = self._serialize.body(agreement, 'IntegrationAccountAgreement') @@ -247,11 +261,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -298,13 +314,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -314,11 +333,13 @@ async def delete( # pylint: disable=inconsistent-return-statements agreement_name=agreement_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -342,9 +363,9 @@ async def list_content_callback_url( resource_group_name: str, integration_account_name: str, agreement_name: str, - list_content_callback_url: "_models.GetCallbackUrlParameters", + list_content_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. :param resource_group_name: The resource group name. @@ -360,14 +381,17 @@ async def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') @@ -380,11 +404,13 @@ async def list_content_callback_url( content_type=content_type, json=_json, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_assemblies_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_assemblies_operations.py index c73abcb18d22..15abd618ec86 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_assemblies_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_assemblies_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountAssembliesOperations: - """IntegrationAccountAssembliesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_account_assemblies` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -51,7 +50,7 @@ def list( resource_group_name: str, integration_account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.AssemblyCollection"]: + ) -> AsyncIterable[_models.AssemblyCollection]: """List the assemblies for an integration account. :param resource_group_name: The resource group name. @@ -63,13 +62,16 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.AssemblyCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.AssemblyCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -79,9 +81,11 @@ def prepare_request(next_link=None): integration_account_name=integration_account_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -91,9 +95,11 @@ def prepare_request(next_link=None): integration_account_name=integration_account_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -134,7 +140,7 @@ async def get( integration_account_name: str, assembly_artifact_name: str, **kwargs: Any - ) -> "_models.AssemblyDefinition": + ) -> _models.AssemblyDefinition: """Get an assembly for an integration account. :param resource_group_name: The resource group name. @@ -148,13 +154,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.AssemblyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.AssemblyDefinition] request = build_get_request( @@ -164,11 +173,13 @@ async def get( assembly_artifact_name=assembly_artifact_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -196,9 +207,9 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, - assembly_artifact: "_models.AssemblyDefinition", + assembly_artifact: _models.AssemblyDefinition, **kwargs: Any - ) -> "_models.AssemblyDefinition": + ) -> _models.AssemblyDefinition: """Create or update an assembly for an integration account. :param resource_group_name: The resource group name. @@ -214,14 +225,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.AssemblyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.AssemblyDefinition] _json = self._serialize.body(assembly_artifact, 'AssemblyDefinition') @@ -234,11 +248,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -285,13 +301,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -301,11 +320,13 @@ async def delete( # pylint: disable=inconsistent-return-statements assembly_artifact_name=assembly_artifact_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -330,7 +351,7 @@ async def list_content_callback_url( integration_account_name: str, assembly_artifact_name: str, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url for an integration account assembly. :param resource_group_name: The resource group name. @@ -344,13 +365,16 @@ async def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] request = build_list_content_callback_url_request( @@ -360,11 +384,13 @@ async def list_content_callback_url( assembly_artifact_name=assembly_artifact_name, api_version=api_version, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_batch_configurations_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_batch_configurations_operations.py index 4149df4eceed..c79e2eabae7b 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_batch_configurations_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_batch_configurations_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountBatchConfigurationsOperations: - """IntegrationAccountBatchConfigurationsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_account_batch_configurations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -51,7 +50,7 @@ def list( resource_group_name: str, integration_account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BatchConfigurationCollection"]: + ) -> AsyncIterable[_models.BatchConfigurationCollection]: """List the batch configurations for an integration account. :param resource_group_name: The resource group name. @@ -65,13 +64,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.BatchConfigurationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.BatchConfigurationCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfigurationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -81,9 +83,11 @@ def prepare_request(next_link=None): integration_account_name=integration_account_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -93,9 +97,11 @@ def prepare_request(next_link=None): integration_account_name=integration_account_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -136,7 +142,7 @@ async def get( integration_account_name: str, batch_configuration_name: str, **kwargs: Any - ) -> "_models.BatchConfiguration": + ) -> _models.BatchConfiguration: """Get a batch configuration for an integration account. :param resource_group_name: The resource group name. @@ -150,13 +156,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.BatchConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.BatchConfiguration] request = build_get_request( @@ -166,11 +175,13 @@ async def get( batch_configuration_name=batch_configuration_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -198,9 +209,9 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, batch_configuration_name: str, - batch_configuration: "_models.BatchConfiguration", + batch_configuration: _models.BatchConfiguration, **kwargs: Any - ) -> "_models.BatchConfiguration": + ) -> _models.BatchConfiguration: """Create or update a batch configuration for an integration account. :param resource_group_name: The resource group name. @@ -216,14 +227,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.BatchConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.BatchConfiguration] _json = self._serialize.body(batch_configuration, 'BatchConfiguration') @@ -236,11 +250,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -287,13 +303,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -303,11 +322,13 @@ async def delete( # pylint: disable=inconsistent-return-statements batch_configuration_name=batch_configuration_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_certificates_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_certificates_operations.py index 39925a3f11a9..aa42cc62e68c 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_certificates_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_certificates_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountCertificatesOperations: - """IntegrationAccountCertificatesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_account_certificates` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -52,7 +51,7 @@ def list( integration_account_name: str, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountCertificateListResult"]: + ) -> AsyncIterable[_models.IntegrationAccountCertificateListResult]: """Gets a list of integration account certificates. :param resource_group_name: The resource group name. @@ -68,13 +67,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountCertificateListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountCertificateListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificateListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -85,9 +87,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -98,9 +102,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -141,7 +147,7 @@ async def get( integration_account_name: str, certificate_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountCertificate": + ) -> _models.IntegrationAccountCertificate: """Gets an integration account certificate. :param resource_group_name: The resource group name. @@ -155,13 +161,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificate"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountCertificate] request = build_get_request( @@ -171,11 +180,13 @@ async def get( certificate_name=certificate_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -203,9 +214,9 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, certificate_name: str, - certificate: "_models.IntegrationAccountCertificate", + certificate: _models.IntegrationAccountCertificate, **kwargs: Any - ) -> "_models.IntegrationAccountCertificate": + ) -> _models.IntegrationAccountCertificate: """Creates or updates an integration account certificate. :param resource_group_name: The resource group name. @@ -221,14 +232,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificate"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountCertificate] _json = self._serialize.body(certificate, 'IntegrationAccountCertificate') @@ -241,11 +255,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -292,13 +308,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -308,11 +327,13 @@ async def delete( # pylint: disable=inconsistent-return-statements certificate_name=certificate_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_maps_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_maps_operations.py index 26a7b9d372bc..b27b67da517b 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_maps_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_maps_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountMapsOperations: - """IntegrationAccountMapsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_account_maps` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountMapListResult"]: + ) -> AsyncIterable[_models.IntegrationAccountMapListResult]: """Gets a list of integration account maps. :param resource_group_name: The resource group name. @@ -72,13 +71,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountMapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountMapListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -90,9 +92,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -104,9 +108,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -147,7 +153,7 @@ async def get( integration_account_name: str, map_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountMap": + ) -> _models.IntegrationAccountMap: """Gets an integration account map. :param resource_group_name: The resource group name. @@ -161,13 +167,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountMap] request = build_get_request( @@ -177,11 +186,13 @@ async def get( map_name=map_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -209,9 +220,9 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, map_name: str, - map: "_models.IntegrationAccountMap", + map: _models.IntegrationAccountMap, **kwargs: Any - ) -> "_models.IntegrationAccountMap": + ) -> _models.IntegrationAccountMap: """Creates or updates an integration account map. If the map is larger than 4 MB, you need to store the map in an Azure blob and use the blob's Shared Access Signature (SAS) URL as the 'contentLink' property value. @@ -229,14 +240,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountMap] _json = self._serialize.body(map, 'IntegrationAccountMap') @@ -249,11 +263,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -300,13 +316,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -316,11 +335,13 @@ async def delete( # pylint: disable=inconsistent-return-statements map_name=map_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -344,9 +365,9 @@ async def list_content_callback_url( resource_group_name: str, integration_account_name: str, map_name: str, - list_content_callback_url: "_models.GetCallbackUrlParameters", + list_content_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. :param resource_group_name: The resource group name. @@ -362,14 +383,17 @@ async def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') @@ -382,11 +406,13 @@ async def list_content_callback_url( content_type=content_type, json=_json, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_partners_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_partners_operations.py index cb733877681b..b802210bdc14 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_partners_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_partners_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountPartnersOperations: - """IntegrationAccountPartnersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_account_partners` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountPartnerListResult"]: + ) -> AsyncIterable[_models.IntegrationAccountPartnerListResult]: """Gets a list of integration account partners. :param resource_group_name: The resource group name. @@ -72,13 +71,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountPartnerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountPartnerListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartnerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -90,9 +92,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -104,9 +108,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -147,7 +153,7 @@ async def get( integration_account_name: str, partner_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountPartner": + ) -> _models.IntegrationAccountPartner: """Gets an integration account partner. :param resource_group_name: The resource group name. @@ -161,13 +167,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartner"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountPartner] request = build_get_request( @@ -177,11 +186,13 @@ async def get( partner_name=partner_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -209,9 +220,9 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, partner_name: str, - partner: "_models.IntegrationAccountPartner", + partner: _models.IntegrationAccountPartner, **kwargs: Any - ) -> "_models.IntegrationAccountPartner": + ) -> _models.IntegrationAccountPartner: """Creates or updates an integration account partner. :param resource_group_name: The resource group name. @@ -227,14 +238,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartner"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountPartner] _json = self._serialize.body(partner, 'IntegrationAccountPartner') @@ -247,11 +261,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -298,13 +314,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -314,11 +333,13 @@ async def delete( # pylint: disable=inconsistent-return-statements partner_name=partner_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -342,9 +363,9 @@ async def list_content_callback_url( resource_group_name: str, integration_account_name: str, partner_name: str, - list_content_callback_url: "_models.GetCallbackUrlParameters", + list_content_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. :param resource_group_name: The resource group name. @@ -360,14 +381,17 @@ async def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') @@ -380,11 +404,13 @@ async def list_content_callback_url( content_type=content_type, json=_json, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_schemas_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_schemas_operations.py index 59d98b7d3d96..1890eb89fff0 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_schemas_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_schemas_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountSchemasOperations: - """IntegrationAccountSchemasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_account_schemas` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountSchemaListResult"]: + ) -> AsyncIterable[_models.IntegrationAccountSchemaListResult]: """Gets a list of integration account schemas. :param resource_group_name: The resource group name. @@ -72,13 +71,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountSchemaListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSchemaListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchemaListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -90,9 +92,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -104,9 +108,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -147,7 +153,7 @@ async def get( integration_account_name: str, schema_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountSchema": + ) -> _models.IntegrationAccountSchema: """Gets an integration account schema. :param resource_group_name: The resource group name. @@ -161,13 +167,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchema"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSchema] request = build_get_request( @@ -177,11 +186,13 @@ async def get( schema_name=schema_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -209,9 +220,9 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, schema_name: str, - schema: "_models.IntegrationAccountSchema", + schema: _models.IntegrationAccountSchema, **kwargs: Any - ) -> "_models.IntegrationAccountSchema": + ) -> _models.IntegrationAccountSchema: """Creates or updates an integration account schema. :param resource_group_name: The resource group name. @@ -227,14 +238,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchema"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSchema] _json = self._serialize.body(schema, 'IntegrationAccountSchema') @@ -247,11 +261,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -298,13 +314,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -314,11 +333,13 @@ async def delete( # pylint: disable=inconsistent-return-statements schema_name=schema_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -342,9 +363,9 @@ async def list_content_callback_url( resource_group_name: str, integration_account_name: str, schema_name: str, - list_content_callback_url: "_models.GetCallbackUrlParameters", + list_content_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. :param resource_group_name: The resource group name. @@ -360,14 +381,17 @@ async def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') @@ -380,11 +404,13 @@ async def list_content_callback_url( content_type=content_type, json=_json, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_sessions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_sessions_operations.py index 6a781d525c6b..3649c8a6822e 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_sessions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_account_sessions_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountSessionsOperations: - """IntegrationAccountSessionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_account_sessions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountSessionListResult"]: + ) -> AsyncIterable[_models.IntegrationAccountSessionListResult]: """Gets a list of integration account sessions. :param resource_group_name: The resource group name. @@ -72,13 +71,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountSessionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSessionListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -90,9 +92,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -104,9 +108,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -147,7 +153,7 @@ async def get( integration_account_name: str, session_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountSession": + ) -> _models.IntegrationAccountSession: """Gets an integration account session. :param resource_group_name: The resource group name. @@ -161,13 +167,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSession"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSession] request = build_get_request( @@ -177,11 +186,13 @@ async def get( session_name=session_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -209,9 +220,9 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, session_name: str, - session: "_models.IntegrationAccountSession", + session: _models.IntegrationAccountSession, **kwargs: Any - ) -> "_models.IntegrationAccountSession": + ) -> _models.IntegrationAccountSession: """Creates or updates an integration account session. :param resource_group_name: The resource group name. @@ -227,14 +238,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSession"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSession] _json = self._serialize.body(session, 'IntegrationAccountSession') @@ -247,11 +261,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -298,13 +314,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -314,11 +333,13 @@ async def delete( # pylint: disable=inconsistent-return-statements session_name=session_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_accounts_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_accounts_operations.py index bac3564469d8..a6421797eaa6 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_accounts_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_accounts_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,33 +25,31 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationAccountsOperations: - """IntegrationAccountsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_accounts` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list_by_subscription( self, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountListResult"]: + ) -> AsyncIterable[_models.IntegrationAccountListResult]: """Gets a list of integration accounts by subscription. :param top: The number of items to be included in the result. Default value is None. @@ -62,13 +61,16 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -77,9 +79,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list_by_subscription.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -88,9 +92,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -130,7 +136,7 @@ def list_by_resource_group( resource_group_name: str, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountListResult"]: + ) -> AsyncIterable[_models.IntegrationAccountListResult]: """Gets a list of integration accounts by resource group. :param resource_group_name: The resource group name. @@ -144,13 +150,16 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -160,9 +169,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list_by_resource_group.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -172,9 +183,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -214,7 +227,7 @@ async def get( resource_group_name: str, integration_account_name: str, **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Gets an integration account. :param resource_group_name: The resource group name. @@ -226,13 +239,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccount] request = build_get_request( @@ -241,11 +257,13 @@ async def get( integration_account_name=integration_account_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -272,9 +290,9 @@ async def create_or_update( self, resource_group_name: str, integration_account_name: str, - integration_account: "_models.IntegrationAccount", + integration_account: _models.IntegrationAccount, **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Creates or updates an integration account. :param resource_group_name: The resource group name. @@ -288,14 +306,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccount] _json = self._serialize.body(integration_account, 'IntegrationAccount') @@ -307,11 +328,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -342,9 +365,9 @@ async def update( self, resource_group_name: str, integration_account_name: str, - integration_account: "_models.IntegrationAccount", + integration_account: _models.IntegrationAccount, **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Updates an integration account. :param resource_group_name: The resource group name. @@ -358,14 +381,17 @@ async def update( :rtype: ~azure.mgmt.logic.models.IntegrationAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccount] _json = self._serialize.body(integration_account, 'IntegrationAccount') @@ -377,11 +403,13 @@ async def update( content_type=content_type, json=_json, template_url=self.update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -421,13 +449,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -436,11 +467,13 @@ async def delete( # pylint: disable=inconsistent-return-statements integration_account_name=integration_account_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -463,9 +496,9 @@ async def list_callback_url( self, resource_group_name: str, integration_account_name: str, - parameters: "_models.GetCallbackUrlParameters", + parameters: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.CallbackUrl": + ) -> _models.CallbackUrl: """Gets the integration account callback URL. :param resource_group_name: The resource group name. @@ -479,14 +512,17 @@ async def list_callback_url( :rtype: ~azure.mgmt.logic.models.CallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.CallbackUrl] _json = self._serialize.body(parameters, 'GetCallbackUrlParameters') @@ -498,11 +534,13 @@ async def list_callback_url( content_type=content_type, json=_json, template_url=self.list_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -529,9 +567,9 @@ def list_key_vault_keys( self, resource_group_name: str, integration_account_name: str, - list_key_vault_keys: "_models.ListKeyVaultKeysDefinition", + list_key_vault_keys: _models.ListKeyVaultKeysDefinition, **kwargs: Any - ) -> AsyncIterable["_models.KeyVaultKeyCollection"]: + ) -> AsyncIterable[_models.KeyVaultKeyCollection]: """Gets the integration account's Key Vault keys. :param resource_group_name: The resource group name. @@ -546,14 +584,17 @@ def list_key_vault_keys( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.KeyVaultKeyCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.KeyVaultKeyCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyVaultKeyCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: _json = self._serialize.body(list_key_vault_keys, 'ListKeyVaultKeysDefinition') @@ -566,9 +607,11 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, template_url=self.list_key_vault_keys.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: _json = self._serialize.body(list_key_vault_keys, 'ListKeyVaultKeysDefinition') @@ -581,9 +624,11 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -622,7 +667,7 @@ async def log_tracking_events( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, integration_account_name: str, - log_tracking_events: "_models.TrackingEventsDefinition", + log_tracking_events: _models.TrackingEventsDefinition, **kwargs: Any ) -> None: """Logs the integration account's tracking events. @@ -638,14 +683,17 @@ async def log_tracking_events( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(log_tracking_events, 'TrackingEventsDefinition') @@ -657,11 +705,13 @@ async def log_tracking_events( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, template_url=self.log_tracking_events.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -684,9 +734,9 @@ async def regenerate_access_key( self, resource_group_name: str, integration_account_name: str, - regenerate_access_key: "_models.RegenerateActionParameter", + regenerate_access_key: _models.RegenerateActionParameter, **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Regenerates the integration account access key. :param resource_group_name: The resource group name. @@ -700,14 +750,17 @@ async def regenerate_access_key( :rtype: ~azure.mgmt.logic.models.IntegrationAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccount] _json = self._serialize.body(regenerate_access_key, 'RegenerateActionParameter') @@ -719,11 +772,13 @@ async def regenerate_access_key( content_type=content_type, json=_json, template_url=self.regenerate_access_key.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_managed_api_operations_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_managed_api_operations_operations.py index 16bc0f4b2cb3..fffa40208431 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_managed_api_operations_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_managed_api_operations_operations.py @@ -14,6 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -23,26 +24,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationServiceEnvironmentManagedApiOperationsOperations: - """IntegrationServiceEnvironmentManagedApiOperationsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_service_environment_managed_api_operations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -51,7 +50,7 @@ def list( integration_service_environment_name: str, api_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ApiOperationListResult"]: + ) -> AsyncIterable[_models.ApiOperationListResult]: """Gets the managed Api operations. :param resource_group: The resource group. @@ -67,13 +66,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ApiOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.ApiOperationListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -84,9 +86,11 @@ def prepare_request(next_link=None): api_name=api_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -97,9 +101,11 @@ def prepare_request(next_link=None): api_name=api_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_managed_apis_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_managed_apis_operations.py index d816c840903a..64925f7d47de 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_managed_apis_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_managed_apis_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -16,6 +16,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -26,26 +27,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationServiceEnvironmentManagedApisOperations: - """IntegrationServiceEnvironmentManagedApisOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_service_environment_managed_apis` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( resource_group: str, integration_service_environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationServiceEnvironmentManagedApiListResult"]: + ) -> AsyncIterable[_models.IntegrationServiceEnvironmentManagedApiListResult]: """Gets the integration service environment managed Apis. :param resource_group: The resource group. @@ -67,13 +66,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApiListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApiListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApiListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -83,9 +85,11 @@ def prepare_request(next_link=None): integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -95,9 +99,11 @@ def prepare_request(next_link=None): integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -138,7 +144,7 @@ async def get( integration_service_environment_name: str, api_name: str, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironmentManagedApi": + ) -> _models.IntegrationServiceEnvironmentManagedApi: """Gets the integration service environment managed Api. :param resource_group: The resource group name. @@ -152,13 +158,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] request = build_get_request( @@ -168,11 +177,13 @@ async def get( api_name=api_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -199,17 +210,20 @@ async def _put_initial( resource_group: str, integration_service_environment_name: str, api_name: str, - integration_service_environment_managed_api: "_models.IntegrationServiceEnvironmentManagedApi", + integration_service_environment_managed_api: _models.IntegrationServiceEnvironmentManagedApi, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironmentManagedApi": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] + ) -> _models.IntegrationServiceEnvironmentManagedApi: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] _json = self._serialize.body(integration_service_environment_managed_api, 'IntegrationServiceEnvironmentManagedApi') @@ -222,11 +236,13 @@ async def _put_initial( content_type=content_type, json=_json, template_url=self._put_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -257,9 +273,9 @@ async def begin_put( resource_group: str, integration_service_environment_name: str, api_name: str, - integration_service_environment_managed_api: "_models.IntegrationServiceEnvironmentManagedApi", + integration_service_environment_managed_api: _models.IntegrationServiceEnvironmentManagedApi, **kwargs: Any - ) -> AsyncLROPoller["_models.IntegrationServiceEnvironmentManagedApi"]: + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironmentManagedApi]: """Puts the integration service environment managed Api. :param resource_group: The resource group name. @@ -286,17 +302,20 @@ async def begin_put( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = await self._put_initial( + raw_result = await self._put_initial( # type: ignore resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, @@ -304,20 +323,27 @@ async def begin_put( api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling( + lro_delay, + + + **kwargs + )) # type: AsyncPollingMethod + elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( @@ -337,13 +363,16 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request_initial( @@ -353,11 +382,13 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements api_name=api_name, api_version=api_version, template_url=self._delete_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -402,21 +433,26 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str 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 ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._delete_initial( # type: ignore resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, api_version=api_version, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) @@ -426,8 +462,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling( + lro_delay, + + + **kwargs + )) # type: AsyncPollingMethod + elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_network_health_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_network_health_operations.py index 3c7864aac3eb..a485ccf7e65c 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_network_health_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_network_health_operations.py @@ -13,6 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -22,26 +23,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationServiceEnvironmentNetworkHealthOperations: - """IntegrationServiceEnvironmentNetworkHealthOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_service_environment_network_health` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace_async async def get( @@ -49,7 +48,7 @@ async def get( resource_group: str, integration_service_environment_name: str, **kwargs: Any - ) -> Dict[str, "_models.IntegrationServiceEnvironmentSubnetNetworkHealth"]: + ) -> Dict[str, _models.IntegrationServiceEnvironmentSubnetNetworkHealth]: """Gets the integration service environment network health. :param resource_group: The resource group. @@ -62,13 +61,16 @@ async def get( :rtype: dict[str, ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSubnetNetworkHealth] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.IntegrationServiceEnvironmentSubnetNetworkHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, _models.IntegrationServiceEnvironmentSubnetNetworkHealth]] request = build_get_request( @@ -77,11 +79,13 @@ async def get( integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_skus_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_skus_operations.py index c5fd6c5d254f..e22509568090 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_skus_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environment_skus_operations.py @@ -14,6 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -23,26 +24,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationServiceEnvironmentSkusOperations: - """IntegrationServiceEnvironmentSkusOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_service_environment_skus` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -50,7 +49,7 @@ def list( resource_group: str, integration_service_environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationServiceEnvironmentSkuList"]: + ) -> AsyncIterable[_models.IntegrationServiceEnvironmentSkuList]: """Gets a list of integration service environment Skus. :param resource_group: The resource group. @@ -64,13 +63,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentSkuList] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentSkuList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -80,9 +82,11 @@ def prepare_request(next_link=None): integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -92,9 +96,11 @@ def prepare_request(next_link=None): integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environments_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environments_operations.py index 1da1e65e6e82..0ba1d678b20c 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environments_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_integration_service_environments_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -16,6 +16,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -26,33 +27,31 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class IntegrationServiceEnvironmentsOperations: - """IntegrationServiceEnvironmentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`integration_service_environments` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list_by_subscription( self, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationServiceEnvironmentListResult"]: + ) -> AsyncIterable[_models.IntegrationServiceEnvironmentListResult]: """Gets a list of integration service environments by subscription. :param top: The number of items to be included in the result. Default value is None. @@ -64,13 +63,16 @@ def list_by_subscription( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -79,9 +81,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list_by_subscription.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -90,9 +94,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -132,7 +138,7 @@ def list_by_resource_group( resource_group: str, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationServiceEnvironmentListResult"]: + ) -> AsyncIterable[_models.IntegrationServiceEnvironmentListResult]: """Gets a list of integration service environments by resource group. :param resource_group: The resource group. @@ -146,13 +152,16 @@ def list_by_resource_group( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -162,9 +171,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list_by_resource_group.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -174,9 +185,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -216,7 +229,7 @@ async def get( resource_group: str, integration_service_environment_name: str, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": + ) -> _models.IntegrationServiceEnvironment: """Gets an integration service environment. :param resource_group: The resource group. @@ -228,13 +241,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.IntegrationServiceEnvironment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] request = build_get_request( @@ -243,11 +259,13 @@ async def get( integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -273,17 +291,20 @@ async def _create_or_update_initial( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: _models.IntegrationServiceEnvironment, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] + ) -> _models.IntegrationServiceEnvironment: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] _json = self._serialize.body(integration_service_environment, 'IntegrationServiceEnvironment') @@ -295,11 +316,13 @@ async def _create_or_update_initial( content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -329,9 +352,9 @@ async def begin_create_or_update( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: _models.IntegrationServiceEnvironment, **kwargs: Any - ) -> AsyncLROPoller["_models.IntegrationServiceEnvironment"]: + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironment]: """Creates or updates an integration service environment. :param resource_group: The resource group. @@ -354,37 +377,47 @@ async def begin_create_or_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._create_or_update_initial( # type: ignore resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, integration_service_environment=integration_service_environment, api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling( + lro_delay, + + + **kwargs + )) # type: AsyncPollingMethod + elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( @@ -401,17 +434,20 @@ async def _update_initial( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: _models.IntegrationServiceEnvironment, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] + ) -> _models.IntegrationServiceEnvironment: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] _json = self._serialize.body(integration_service_environment, 'IntegrationServiceEnvironment') @@ -423,11 +459,13 @@ async def _update_initial( content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -453,9 +491,9 @@ async def begin_update( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: _models.IntegrationServiceEnvironment, **kwargs: Any - ) -> AsyncLROPoller["_models.IntegrationServiceEnvironment"]: + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironment]: """Updates an integration service environment. :param resource_group: The resource group. @@ -478,37 +516,47 @@ async def begin_update( ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._update_initial( # type: ignore resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, integration_service_environment=integration_service_environment, api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling( + lro_delay, + + + **kwargs + )) # type: AsyncPollingMethod + elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( @@ -539,13 +587,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -554,11 +605,13 @@ async def delete( # pylint: disable=inconsistent-return-statements integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -594,13 +647,16 @@ async def restart( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_restart_request( @@ -609,11 +665,13 @@ async def restart( # pylint: disable=inconsistent-return-statements integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.restart.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_operations.py index 72b737962aea..a1a92c07ae2a 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_operations.py @@ -14,6 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -23,32 +24,30 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class Operations: - """Operations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`operations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( self, **kwargs: Any - ) -> AsyncIterable["_models.OperationListResult"]: + ) -> AsyncIterable[_models.OperationListResult]: """Lists all of the available Logic REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -56,31 +55,38 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: request = build_list_request( api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: request = build_list_request( api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_patch.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_patch.py new file mode 100644 index 000000000000..0ad201a8c586 --- /dev/null +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_patch.py @@ -0,0 +1,19 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_repetitions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_repetitions_operations.py index dc12b9967354..854c9471a53e 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_repetitions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_repetitions_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowRunActionRepetitionsOperations: - """WorkflowRunActionRepetitionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_run_action_repetitions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( run_name: str, action_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowRunActionRepetitionDefinitionCollection"]: + ) -> AsyncIterable[_models.WorkflowRunActionRepetitionDefinitionCollection]: """Get all of a workflow run action repetitions. :param resource_group_name: The resource group name. @@ -71,13 +70,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinitionCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -89,9 +91,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -103,9 +107,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -148,7 +154,7 @@ async def get( action_name: str, repetition_name: str, **kwargs: Any - ) -> "_models.WorkflowRunActionRepetitionDefinition": + ) -> _models.WorkflowRunActionRepetitionDefinition: """Get a workflow run action repetition. :param resource_group_name: The resource group name. @@ -166,13 +172,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinition] request = build_get_request( @@ -184,11 +193,13 @@ async def get( repetition_name=repetition_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -219,7 +230,7 @@ def list_expression_traces( action_name: str, repetition_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ExpressionTraces"]: + ) -> AsyncIterable[_models.ExpressionTraces]: """Lists a workflow run expression trace. :param resource_group_name: The resource group name. @@ -237,13 +248,16 @@ def list_expression_traces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ExpressionTraces] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.ExpressionTraces] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressionTraces"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -256,9 +270,11 @@ def prepare_request(next_link=None): repetition_name=repetition_name, api_version=api_version, template_url=self.list_expression_traces.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -271,9 +287,11 @@ def prepare_request(next_link=None): repetition_name=repetition_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_repetitions_request_histories_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_repetitions_request_histories_operations.py index 9b4e69a86e8b..4e58fc206bf1 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_repetitions_request_histories_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_repetitions_request_histories_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowRunActionRepetitionsRequestHistoriesOperations: - """WorkflowRunActionRepetitionsRequestHistoriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_run_action_repetitions_request_histories` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -54,7 +53,7 @@ def list( action_name: str, repetition_name: str, **kwargs: Any - ) -> AsyncIterable["_models.RequestHistoryListResult"]: + ) -> AsyncIterable[_models.RequestHistoryListResult]: """List a workflow run repetition request history. :param resource_group_name: The resource group name. @@ -74,13 +73,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.RequestHistoryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.RequestHistoryListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistoryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -93,9 +95,11 @@ def prepare_request(next_link=None): repetition_name=repetition_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -108,9 +112,11 @@ def prepare_request(next_link=None): repetition_name=repetition_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -154,7 +160,7 @@ async def get( repetition_name: str, request_history_name: str, **kwargs: Any - ) -> "_models.RequestHistory": + ) -> _models.RequestHistory: """Gets a workflow run repetition request history. :param resource_group_name: The resource group name. @@ -174,13 +180,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.RequestHistory :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.RequestHistory] request = build_get_request( @@ -193,11 +202,13 @@ async def get( request_history_name=request_history_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_request_histories_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_request_histories_operations.py index 96b348777095..200f3ab61a6f 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_request_histories_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_request_histories_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowRunActionRequestHistoriesOperations: - """WorkflowRunActionRequestHistoriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_run_action_request_histories` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( run_name: str, action_name: str, **kwargs: Any - ) -> AsyncIterable["_models.RequestHistoryListResult"]: + ) -> AsyncIterable[_models.RequestHistoryListResult]: """List a workflow run request history. :param resource_group_name: The resource group name. @@ -71,13 +70,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.RequestHistoryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.RequestHistoryListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistoryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -89,9 +91,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -103,9 +107,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -148,7 +154,7 @@ async def get( action_name: str, request_history_name: str, **kwargs: Any - ) -> "_models.RequestHistory": + ) -> _models.RequestHistory: """Gets a workflow run request history. :param resource_group_name: The resource group name. @@ -166,13 +172,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.RequestHistory :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.RequestHistory] request = build_get_request( @@ -184,11 +193,13 @@ async def get( request_history_name=request_history_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_scope_repetitions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_scope_repetitions_operations.py index b575d2d07687..ad21c6cb3566 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_scope_repetitions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_action_scope_repetitions_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowRunActionScopeRepetitionsOperations: - """WorkflowRunActionScopeRepetitionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_run_action_scope_repetitions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( run_name: str, action_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowRunActionRepetitionDefinitionCollection"]: + ) -> AsyncIterable[_models.WorkflowRunActionRepetitionDefinitionCollection]: """List the workflow run action scoped repetitions. :param resource_group_name: The resource group name. @@ -71,13 +70,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinitionCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -89,9 +91,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -103,9 +107,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -148,7 +154,7 @@ async def get( action_name: str, repetition_name: str, **kwargs: Any - ) -> "_models.WorkflowRunActionRepetitionDefinition": + ) -> _models.WorkflowRunActionRepetitionDefinition: """Get a workflow run action scoped repetition. :param resource_group_name: The resource group name. @@ -166,13 +172,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinition] request = build_get_request( @@ -184,11 +193,13 @@ async def get( repetition_name=repetition_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_actions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_actions_operations.py index 05eead647e8f..a26209283db2 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_actions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_actions_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowRunActionsOperations: - """WorkflowRunActionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_run_actions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -54,7 +53,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowRunActionListResult"]: + ) -> AsyncIterable[_models.WorkflowRunActionListResult]: """Gets a list of workflow run actions. :param resource_group_name: The resource group name. @@ -75,13 +74,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunActionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -94,9 +96,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -109,9 +113,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -153,7 +159,7 @@ async def get( run_name: str, action_name: str, **kwargs: Any - ) -> "_models.WorkflowRunAction": + ) -> _models.WorkflowRunAction: """Gets a workflow run action. :param resource_group_name: The resource group name. @@ -169,13 +175,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.WorkflowRunAction :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunAction"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunAction] request = build_get_request( @@ -186,11 +195,13 @@ async def get( action_name=action_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -220,7 +231,7 @@ def list_expression_traces( run_name: str, action_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ExpressionTraces"]: + ) -> AsyncIterable[_models.ExpressionTraces]: """Lists a workflow run expression trace. :param resource_group_name: The resource group name. @@ -236,13 +247,16 @@ def list_expression_traces( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ExpressionTraces] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.ExpressionTraces] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressionTraces"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -254,9 +268,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=self.list_expression_traces.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -268,9 +284,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_operations_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_operations_operations.py index e26956721aca..713c62a99747 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_operations_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_run_operations_operations.py @@ -13,6 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -22,26 +23,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowRunOperationsOperations: - """WorkflowRunOperationsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_run_operations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace_async async def get( @@ -51,7 +50,7 @@ async def get( run_name: str, operation_id: str, **kwargs: Any - ) -> "_models.WorkflowRun": + ) -> _models.WorkflowRun: """Gets an operation for a run. :param resource_group_name: The resource group name. @@ -67,13 +66,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.WorkflowRun :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRun"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRun] request = build_get_request( @@ -84,11 +86,13 @@ async def get( operation_id=operation_id, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_runs_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_runs_operations.py index 55d700a18ad0..abaed453e5e0 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_runs_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_runs_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowRunsOperations: - """WorkflowRunsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_runs` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowRunListResult"]: + ) -> AsyncIterable[_models.WorkflowRunListResult]: """Gets a list of workflow runs. :param resource_group_name: The resource group name. @@ -71,13 +70,16 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -89,9 +91,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -103,9 +107,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -146,7 +152,7 @@ async def get( workflow_name: str, run_name: str, **kwargs: Any - ) -> "_models.WorkflowRun": + ) -> _models.WorkflowRun: """Gets a workflow run. :param resource_group_name: The resource group name. @@ -160,13 +166,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.WorkflowRun :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRun"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRun] request = build_get_request( @@ -176,11 +185,13 @@ async def get( run_name=run_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -223,13 +234,16 @@ async def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_cancel_request( @@ -239,11 +253,13 @@ async def cancel( # pylint: disable=inconsistent-return-statements run_name=run_name, api_version=api_version, template_url=self.cancel.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_trigger_histories_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_trigger_histories_operations.py index 2c29d10e3d4a..a0d8af3dc9b2 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_trigger_histories_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_trigger_histories_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowTriggerHistoriesOperations: - """WorkflowTriggerHistoriesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_trigger_histories` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -54,7 +53,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowTriggerHistoryListResult"]: + ) -> AsyncIterable[_models.WorkflowTriggerHistoryListResult]: """Gets a list of workflow trigger histories. :param resource_group_name: The resource group name. @@ -75,13 +74,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowTriggerHistoryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerHistoryListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerHistoryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -94,9 +96,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -109,9 +113,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -153,7 +159,7 @@ async def get( trigger_name: str, history_name: str, **kwargs: Any - ) -> "_models.WorkflowTriggerHistory": + ) -> _models.WorkflowTriggerHistory: """Gets a workflow trigger history. :param resource_group_name: The resource group name. @@ -170,13 +176,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerHistory :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerHistory] request = build_get_request( @@ -187,11 +196,13 @@ async def get( history_name=history_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -238,13 +249,16 @@ async def resubmit( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_resubmit_request( @@ -255,11 +269,13 @@ async def resubmit( # pylint: disable=inconsistent-return-statements history_name=history_name, api_version=api_version, template_url=self.resubmit.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_triggers_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_triggers_operations.py index 589bbcfd817f..dffc11572b26 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_triggers_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_triggers_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowTriggersOperations: - """WorkflowTriggersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_triggers` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -53,7 +52,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowTriggerListResult"]: + ) -> AsyncIterable[_models.WorkflowTriggerListResult]: """Gets a list of workflow triggers. :param resource_group_name: The resource group name. @@ -71,13 +70,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowTriggerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -89,9 +91,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -103,9 +107,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -146,7 +152,7 @@ async def get( workflow_name: str, trigger_name: str, **kwargs: Any - ) -> "_models.WorkflowTrigger": + ) -> _models.WorkflowTrigger: """Gets a workflow trigger. :param resource_group_name: The resource group name. @@ -160,13 +166,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.WorkflowTrigger :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTrigger"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTrigger] request = build_get_request( @@ -176,11 +185,13 @@ async def get( trigger_name=trigger_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -223,13 +234,16 @@ async def reset( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_reset_request( @@ -239,11 +253,13 @@ async def reset( # pylint: disable=inconsistent-return-statements trigger_name=trigger_name, api_version=api_version, template_url=self.reset.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -282,13 +298,16 @@ async def run( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_run_request( @@ -298,11 +317,13 @@ async def run( # pylint: disable=inconsistent-return-statements trigger_name=trigger_name, api_version=api_version, template_url=self.run.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -327,7 +348,7 @@ async def get_schema_json( workflow_name: str, trigger_name: str, **kwargs: Any - ) -> "_models.JsonSchema": + ) -> _models.JsonSchema: """Get the trigger schema as JSON. :param resource_group_name: The resource group name. @@ -341,13 +362,16 @@ async def get_schema_json( :rtype: ~azure.mgmt.logic.models.JsonSchema :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JsonSchema"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.JsonSchema] request = build_get_schema_json_request( @@ -357,11 +381,13 @@ async def get_schema_json( trigger_name=trigger_name, api_version=api_version, template_url=self.get_schema_json.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -389,7 +415,7 @@ async def set_state( # pylint: disable=inconsistent-return-statements resource_group_name: str, workflow_name: str, trigger_name: str, - set_state: "_models.SetTriggerStateActionDefinition", + set_state: _models.SetTriggerStateActionDefinition, **kwargs: Any ) -> None: """Sets the state of a workflow trigger. @@ -407,14 +433,17 @@ async def set_state( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(set_state, 'SetTriggerStateActionDefinition') @@ -427,11 +456,13 @@ async def set_state( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, template_url=self.set_state.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -456,7 +487,7 @@ async def list_callback_url( workflow_name: str, trigger_name: str, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the callback URL for a workflow trigger. :param resource_group_name: The resource group name. @@ -470,13 +501,16 @@ async def list_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] request = build_list_callback_url_request( @@ -486,11 +520,13 @@ async def list_callback_url( trigger_name=trigger_name, api_version=api_version, template_url=self.list_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_version_triggers_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_version_triggers_operations.py index d4017437b6bc..27b6074db588 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_version_triggers_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_version_triggers_operations.py @@ -13,6 +13,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -22,26 +23,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowVersionTriggersOperations: - """WorkflowVersionTriggersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_version_triggers` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace_async async def list_callback_url( @@ -50,9 +49,9 @@ async def list_callback_url( workflow_name: str, version_id: str, trigger_name: str, - parameters: Optional["_models.GetCallbackUrlParameters"] = None, + parameters: Optional[_models.GetCallbackUrlParameters] = None, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the callback url for a trigger of a workflow version. :param resource_group_name: The resource group name. @@ -70,14 +69,17 @@ async def list_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] if parameters is not None: _json = self._serialize.body(parameters, 'GetCallbackUrlParameters') @@ -94,11 +96,13 @@ async def list_callback_url( content_type=content_type, json=_json, template_url=self.list_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_versions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_versions_operations.py index 943b46a2bbb0..89ad1a5ddb17 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_versions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflow_versions_operations.py @@ -15,6 +15,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -24,26 +25,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowVersionsOperations: - """WorkflowVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflow_versions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -52,7 +51,7 @@ def list( workflow_name: str, top: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowVersionListResult"]: + ) -> AsyncIterable[_models.WorkflowVersionListResult]: """Gets a list of workflow versions. :param resource_group_name: The resource group name. @@ -68,13 +67,16 @@ def list( ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowVersionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowVersionListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowVersionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -85,9 +87,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -98,9 +102,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -141,7 +147,7 @@ async def get( workflow_name: str, version_id: str, **kwargs: Any - ) -> "_models.WorkflowVersion": + ) -> _models.WorkflowVersion: """Gets a workflow version. :param resource_group_name: The resource group name. @@ -155,13 +161,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.WorkflowVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowVersion] request = build_get_request( @@ -171,11 +180,13 @@ async def get( version_id=version_id, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflows_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflows_operations.py index c4d57bd7ebb0..5c4dbc61fa46 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflows_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_workflows_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -16,6 +16,7 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling @@ -26,26 +27,24 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] class WorkflowsOperations: - """WorkflowsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.aio.LogicManagementClient`'s + :attr:`workflows` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list_by_subscription( @@ -53,7 +52,7 @@ def list_by_subscription( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowListResult"]: + ) -> AsyncIterable[_models.WorkflowListResult]: """Gets a list of workflows by subscription. :param top: The number of items to be included in the result. Default value is None. @@ -66,13 +65,16 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -82,9 +84,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list_by_subscription.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -94,9 +98,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -137,7 +143,7 @@ def list_by_resource_group( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowListResult"]: + ) -> AsyncIterable[_models.WorkflowListResult]: """Gets a list of workflows by resource group. :param resource_group_name: The resource group name. @@ -152,13 +158,16 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -169,9 +178,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list_by_resource_group.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -182,9 +193,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -224,7 +237,7 @@ async def get( resource_group_name: str, workflow_name: str, **kwargs: Any - ) -> "_models.Workflow": + ) -> _models.Workflow: """Gets a workflow. :param resource_group_name: The resource group name. @@ -236,13 +249,16 @@ async def get( :rtype: ~azure.mgmt.logic.models.Workflow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.Workflow] request = build_get_request( @@ -251,11 +267,13 @@ async def get( workflow_name=workflow_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -282,9 +300,9 @@ async def create_or_update( self, resource_group_name: str, workflow_name: str, - workflow: "_models.Workflow", + workflow: _models.Workflow, **kwargs: Any - ) -> "_models.Workflow": + ) -> _models.Workflow: """Creates or updates a workflow. :param resource_group_name: The resource group name. @@ -298,14 +316,17 @@ async def create_or_update( :rtype: ~azure.mgmt.logic.models.Workflow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.Workflow] _json = self._serialize.body(workflow, 'Workflow') @@ -317,11 +338,13 @@ async def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -353,7 +376,7 @@ async def update( resource_group_name: str, workflow_name: str, **kwargs: Any - ) -> "_models.Workflow": + ) -> _models.Workflow: """Updates a workflow. :param resource_group_name: The resource group name. @@ -365,13 +388,16 @@ async def update( :rtype: ~azure.mgmt.logic.models.Workflow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.Workflow] request = build_update_request( @@ -380,11 +406,13 @@ async def update( workflow_name=workflow_name, api_version=api_version, template_url=self.update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -424,13 +452,16 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -439,11 +470,13 @@ async def delete( # pylint: disable=inconsistent-return-statements workflow_name=workflow_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -479,13 +512,16 @@ async def disable( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_disable_request( @@ -494,11 +530,13 @@ async def disable( # pylint: disable=inconsistent-return-statements workflow_name=workflow_name, api_version=api_version, template_url=self.disable.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -534,13 +572,16 @@ async def enable( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_enable_request( @@ -549,11 +590,13 @@ async def enable( # pylint: disable=inconsistent-return-statements workflow_name=workflow_name, api_version=api_version, template_url=self.enable.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -576,7 +619,7 @@ async def generate_upgraded_definition( self, resource_group_name: str, workflow_name: str, - parameters: "_models.GenerateUpgradedDefinitionParameters", + parameters: _models.GenerateUpgradedDefinitionParameters, **kwargs: Any ) -> Any: """Generates the upgraded definition for a workflow. @@ -592,14 +635,17 @@ async def generate_upgraded_definition( :rtype: any :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Any] _json = self._serialize.body(parameters, 'GenerateUpgradedDefinitionParameters') @@ -611,11 +657,13 @@ async def generate_upgraded_definition( content_type=content_type, json=_json, template_url=self.generate_upgraded_definition.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -642,9 +690,9 @@ async def list_callback_url( self, resource_group_name: str, workflow_name: str, - list_callback_url: "_models.GetCallbackUrlParameters", + list_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the workflow callback Url. :param resource_group_name: The resource group name. @@ -658,14 +706,17 @@ async def list_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_callback_url, 'GetCallbackUrlParameters') @@ -677,11 +728,13 @@ async def list_callback_url( content_type=content_type, json=_json, template_url=self.list_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -721,13 +774,16 @@ async def list_swagger( :rtype: any :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[Any] request = build_list_swagger_request( @@ -736,11 +792,13 @@ async def list_swagger( workflow_name=workflow_name, api_version=api_version, template_url=self.list_swagger.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -766,17 +824,20 @@ async def _move_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workflow_name: str, - move: "_models.WorkflowReference", + move: _models.WorkflowReference, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(move, 'WorkflowReference') @@ -788,11 +849,13 @@ async def _move_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, template_url=self._move_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -814,7 +877,7 @@ async def begin_move( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workflow_name: str, - move: "_models.WorkflowReference", + move: _models.WorkflowReference, **kwargs: Any ) -> AsyncLROPoller[None]: """Moves an existing workflow. @@ -837,23 +900,28 @@ async def begin_move( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] 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 ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = await self._move_initial( + raw_result = await self._move_initial( # type: ignore resource_group_name=resource_group_name, workflow_name=workflow_name, move=move, api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) @@ -863,8 +931,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling( + lro_delay, + + + **kwargs + )) # type: AsyncPollingMethod + elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( @@ -882,7 +956,7 @@ async def regenerate_access_key( # pylint: disable=inconsistent-return-statemen self, resource_group_name: str, workflow_name: str, - key_type: "_models.RegenerateActionParameter", + key_type: _models.RegenerateActionParameter, **kwargs: Any ) -> None: """Regenerates the callback URL access key for request triggers. @@ -898,14 +972,17 @@ async def regenerate_access_key( # pylint: disable=inconsistent-return-statemen :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(key_type, 'RegenerateActionParameter') @@ -917,11 +994,13 @@ async def regenerate_access_key( # pylint: disable=inconsistent-return-statemen content_type=content_type, json=_json, template_url=self.regenerate_access_key.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -944,7 +1023,7 @@ async def validate_by_resource_group( # pylint: disable=inconsistent-return-sta self, resource_group_name: str, workflow_name: str, - validate: "_models.Workflow", + validate: _models.Workflow, **kwargs: Any ) -> None: """Validates the workflow. @@ -960,14 +1039,17 @@ async def validate_by_resource_group( # pylint: disable=inconsistent-return-sta :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(validate, 'Workflow') @@ -979,11 +1061,13 @@ async def validate_by_resource_group( # pylint: disable=inconsistent-return-sta content_type=content_type, json=_json, template_url=self.validate_by_resource_group.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1007,7 +1091,7 @@ async def validate_by_location( # pylint: disable=inconsistent-return-statement resource_group_name: str, location: str, workflow_name: str, - validate: "_models.Workflow", + validate: _models.Workflow, **kwargs: Any ) -> None: """Validates the workflow definition. @@ -1025,14 +1109,17 @@ async def validate_by_location( # pylint: disable=inconsistent-return-statement :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(validate, 'Workflow') @@ -1045,11 +1132,13 @@ async def validate_by_location( # pylint: disable=inconsistent-return-statement content_type=content_type, json=_json, template_url=self.validate_by_location.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/__init__.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/__init__.py index 5c09cf9afc92..5fd590c3f3c3 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/__init__.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/__init__.py @@ -261,7 +261,9 @@ X12DateFormat, X12TimeFormat, ) - +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk __all__ = [ 'AS2AcknowledgementConnectionSettings', 'AS2AgreementContent', @@ -515,3 +517,5 @@ 'X12DateFormat', 'X12TimeFormat', ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() \ No newline at end of file diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_logic_management_client_enums.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_logic_management_client_enums.py index 9ded384d1175..945b48c6dd56 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_logic_management_client_enums.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_logic_management_client_enums.py @@ -7,11 +7,10 @@ # -------------------------------------------------------------------------- from enum import Enum -from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta -class AgreementType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class AgreementType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The agreement type. """ @@ -20,7 +19,7 @@ class AgreementType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): X12 = "X12" EDIFACT = "Edifact" -class ApiDeploymentParameterVisibility(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class ApiDeploymentParameterVisibility(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The Api deployment parameter visibility. """ @@ -28,7 +27,7 @@ class ApiDeploymentParameterVisibility(with_metaclass(CaseInsensitiveEnumMeta, s DEFAULT = "Default" INTERNAL = "Internal" -class ApiTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class ApiTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The Api tier. """ @@ -37,13 +36,13 @@ class ApiTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): STANDARD = "Standard" PREMIUM = "Premium" -class ApiType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class ApiType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NOT_SPECIFIED = "NotSpecified" REST = "Rest" SOAP = "Soap" -class AzureAsyncOperationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class AzureAsyncOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The Azure async operation state. """ @@ -52,7 +51,7 @@ class AzureAsyncOperationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum PENDING = "Pending" CANCELED = "Canceled" -class DayOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The day of the week. """ @@ -64,7 +63,7 @@ class DayOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" SATURDAY = "Saturday" -class DaysOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class DaysOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): SUNDAY = "Sunday" MONDAY = "Monday" @@ -74,7 +73,7 @@ class DaysOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" SATURDAY = "Saturday" -class EdifactCharacterSet(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class EdifactCharacterSet(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The edifact character set. """ @@ -94,7 +93,7 @@ class EdifactCharacterSet(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): UNOY = "UNOY" KECA = "KECA" -class EdifactDecimalIndicator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class EdifactDecimalIndicator(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The edifact decimal indicator. """ @@ -102,7 +101,7 @@ class EdifactDecimalIndicator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum) COMMA = "Comma" DECIMAL = "Decimal" -class EncryptionAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class EncryptionAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The encryption algorithm. """ @@ -114,7 +113,7 @@ class EncryptionAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): AES192 = "AES192" AES256 = "AES256" -class ErrorResponseCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class ErrorResponseCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The error response code. """ @@ -123,7 +122,7 @@ class ErrorResponseCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INTERNAL_SERVER_ERROR = "InternalServerError" INVALID_OPERATION_ID = "InvalidOperationId" -class EventLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class EventLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The event level. """ @@ -134,7 +133,7 @@ class EventLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INFORMATIONAL = "Informational" VERBOSE = "Verbose" -class HashingAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class HashingAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The signing or hashing algorithm. """ @@ -146,7 +145,7 @@ class HashingAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SHA2384 = "SHA2384" SHA2512 = "SHA2512" -class IntegrationAccountSkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class IntegrationAccountSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The integration account sku name. """ @@ -155,7 +154,7 @@ class IntegrationAccountSkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enu BASIC = "Basic" STANDARD = "Standard" -class IntegrationServiceEnvironmentAccessEndpointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class IntegrationServiceEnvironmentAccessEndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The integration service environment access endpoint type. """ @@ -163,7 +162,7 @@ class IntegrationServiceEnvironmentAccessEndpointType(with_metaclass(CaseInsensi EXTERNAL = "External" INTERNAL = "Internal" -class IntegrationServiceEnvironmentNetworkDependencyCategoryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class IntegrationServiceEnvironmentNetworkDependencyCategoryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The integration service environment network dependency category type. """ @@ -180,7 +179,7 @@ class IntegrationServiceEnvironmentNetworkDependencyCategoryType(with_metaclass( SQL = "SQL" REGIONAL_SERVICE = "RegionalService" -class IntegrationServiceEnvironmentNetworkDependencyHealthState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class IntegrationServiceEnvironmentNetworkDependencyHealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The integration service environment network dependency health state. """ @@ -189,7 +188,7 @@ class IntegrationServiceEnvironmentNetworkDependencyHealthState(with_metaclass(C UNHEALTHY = "Unhealthy" UNKNOWN = "Unknown" -class IntegrationServiceEnvironmentNetworkEndPointAccessibilityState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class IntegrationServiceEnvironmentNetworkEndPointAccessibilityState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The integration service environment network endpoint accessibility state. """ @@ -198,7 +197,7 @@ class IntegrationServiceEnvironmentNetworkEndPointAccessibilityState(with_metacl AVAILABLE = "Available" NOT_AVAILABLE = "NotAvailable" -class IntegrationServiceEnvironmentSkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class IntegrationServiceEnvironmentSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The integration service environment sku name. """ @@ -206,7 +205,7 @@ class IntegrationServiceEnvironmentSkuName(with_metaclass(CaseInsensitiveEnumMet PREMIUM = "Premium" DEVELOPER = "Developer" -class IntegrationServiceEnvironmentSkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class IntegrationServiceEnvironmentSkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The integration service environment sku scale type. """ @@ -214,7 +213,7 @@ class IntegrationServiceEnvironmentSkuScaleType(with_metaclass(CaseInsensitiveEn AUTOMATIC = "Automatic" NONE = "None" -class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The key type. """ @@ -222,7 +221,7 @@ class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): PRIMARY = "Primary" SECONDARY = "Secondary" -class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of managed service identity. The type 'SystemAssigned' includes an implicitly created identity. The type 'None' will remove any identities from the resource. """ @@ -231,7 +230,7 @@ class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, En USER_ASSIGNED = "UserAssigned" NONE = "None" -class MapType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class MapType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The map type. """ @@ -241,7 +240,7 @@ class MapType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): XSLT30 = "Xslt30" LIQUID = "Liquid" -class MessageFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class MessageFilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The message filter type. """ @@ -249,13 +248,13 @@ class MessageFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INCLUDE = "Include" EXCLUDE = "Exclude" -class OpenAuthenticationProviderType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class OpenAuthenticationProviderType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Open authentication policy provider type. """ AAD = "AAD" -class ParameterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class ParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The parameter type. """ @@ -269,14 +268,14 @@ class ParameterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): OBJECT = "Object" SECURE_OBJECT = "SecureObject" -class PartnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class PartnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The partner type. """ NOT_SPECIFIED = "NotSpecified" B2_B = "B2B" -class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The recurrence frequency. """ @@ -289,14 +288,14 @@ class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MONTH = "Month" YEAR = "Year" -class SchemaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class SchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The schema type. """ NOT_SPECIFIED = "NotSpecified" XML = "Xml" -class SegmentTerminatorSuffix(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class SegmentTerminatorSuffix(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The segment terminator suffix. """ @@ -306,7 +305,7 @@ class SegmentTerminatorSuffix(with_metaclass(CaseInsensitiveEnumMeta, str, Enum) LF = "LF" CRLF = "CRLF" -class SigningAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class SigningAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The signing or hashing algorithm. """ @@ -317,7 +316,7 @@ class SigningAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SHA2384 = "SHA2384" SHA2512 = "SHA2512" -class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The sku name. """ @@ -328,7 +327,7 @@ class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): STANDARD = "Standard" PREMIUM = "Premium" -class StatusAnnotation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class StatusAnnotation(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status annotation. """ @@ -336,7 +335,7 @@ class StatusAnnotation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): PREVIEW = "Preview" PRODUCTION = "Production" -class SwaggerSchemaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class SwaggerSchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The swagger schema type. """ @@ -349,14 +348,14 @@ class SwaggerSchemaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): OBJECT = "Object" NULL = "Null" -class TrackEventsOperationOptions(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class TrackEventsOperationOptions(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The track events operation options. """ NONE = "None" DISABLE_SOURCE_INFO_ENRICH = "DisableSourceInfoEnrich" -class TrackingRecordType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class TrackingRecordType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The tracking record type. """ @@ -377,7 +376,7 @@ class TrackingRecordType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): EDIFACT_FUNCTIONAL_GROUP_ACKNOWLEDGMENT = "EdifactFunctionalGroupAcknowledgment" EDIFACT_TRANSACTION_SET_ACKNOWLEDGMENT = "EdifactTransactionSetAcknowledgment" -class TrailingSeparatorPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class TrailingSeparatorPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The trailing separator policy. """ @@ -386,7 +385,7 @@ class TrailingSeparatorPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum) OPTIONAL = "Optional" MANDATORY = "Mandatory" -class UsageIndicator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class UsageIndicator(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The usage indicator. """ @@ -395,7 +394,7 @@ class UsageIndicator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INFORMATION = "Information" PRODUCTION = "Production" -class WorkflowProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class WorkflowProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The workflow provisioning state. """ @@ -422,7 +421,7 @@ class WorkflowProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enu WAITING = "Waiting" IN_PROGRESS = "InProgress" -class WorkflowState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class WorkflowState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The workflow state. """ @@ -433,7 +432,7 @@ class WorkflowState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): DELETED = "Deleted" SUSPENDED = "Suspended" -class WorkflowStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class WorkflowStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The workflow status. """ @@ -451,7 +450,7 @@ class WorkflowStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ABORTED = "Aborted" IGNORED = "Ignored" -class WorkflowTriggerProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class WorkflowTriggerProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The workflow trigger provisioning state. """ @@ -474,7 +473,7 @@ class WorkflowTriggerProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, s UNREGISTERED = "Unregistered" COMPLETED = "Completed" -class WsdlImportMethod(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class WsdlImportMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The WSDL import method. """ @@ -482,7 +481,7 @@ class WsdlImportMethod(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SOAP_TO_REST = "SoapToRest" SOAP_PASS_THROUGH = "SoapPassThrough" -class X12CharacterSet(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class X12CharacterSet(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The X12 character set. """ @@ -491,7 +490,7 @@ class X12CharacterSet(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): EXTENDED = "Extended" UTF8 = "UTF8" -class X12DateFormat(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class X12DateFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The x12 date format. """ @@ -499,7 +498,7 @@ class X12DateFormat(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): CCYYMMDD = "CCYYMMDD" YYMMDD = "YYMMDD" -class X12TimeFormat(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): +class X12TimeFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The x12 time format. """ diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_models_py3.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_models_py3.py index 05491a1ea3db..74bc6b8bde03 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_models_py3.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_models_py3.py @@ -7,12 +7,14 @@ # -------------------------------------------------------------------------- import datetime -from typing import Any, Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._logic_management_client_enums import * +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + import __init__ as _models class AgreementContent(msrest.serialization.Model): @@ -35,9 +37,9 @@ class AgreementContent(msrest.serialization.Model): def __init__( self, *, - a_s2: Optional["AS2AgreementContent"] = None, - x12: Optional["X12AgreementContent"] = None, - edifact: Optional["EdifactAgreementContent"] = None, + a_s2: Optional["_models.AS2AgreementContent"] = None, + x12: Optional["_models.X12AgreementContent"] = None, + edifact: Optional["_models.EdifactAgreementContent"] = None, **kwargs ): """ @@ -65,8 +67,7 @@ class ApiDeploymentParameterMetadata(msrest.serialization.Model): :vartype display_name: str :ivar description: The description. :vartype description: str - :ivar visibility: The visibility. Possible values include: "NotSpecified", "Default", - "Internal". + :ivar visibility: The visibility. Known values are: "NotSpecified", "Default", "Internal". :vartype visibility: str or ~azure.mgmt.logic.models.ApiDeploymentParameterVisibility """ @@ -85,7 +86,7 @@ def __init__( is_required: Optional[bool] = None, display_name: Optional[str] = None, description: Optional[str] = None, - visibility: Optional[Union[str, "ApiDeploymentParameterVisibility"]] = None, + visibility: Optional[Union[str, "_models.ApiDeploymentParameterVisibility"]] = None, **kwargs ): """ @@ -97,8 +98,7 @@ def __init__( :paramtype display_name: str :keyword description: The description. :paramtype description: str - :keyword visibility: The visibility. Possible values include: "NotSpecified", "Default", - "Internal". + :keyword visibility: The visibility. Known values are: "NotSpecified", "Default", "Internal". :paramtype visibility: str or ~azure.mgmt.logic.models.ApiDeploymentParameterVisibility """ super(ApiDeploymentParameterMetadata, self).__init__(**kwargs) @@ -126,8 +126,8 @@ class ApiDeploymentParameterMetadataSet(msrest.serialization.Model): def __init__( self, *, - package_content_link: Optional["ApiDeploymentParameterMetadata"] = None, - redis_cache_connection_string: Optional["ApiDeploymentParameterMetadata"] = None, + package_content_link: Optional["_models.ApiDeploymentParameterMetadata"] = None, + redis_cache_connection_string: Optional["_models.ApiDeploymentParameterMetadata"] = None, **kwargs ): """ @@ -233,7 +233,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - properties: Optional["ApiOperationPropertiesDefinition"] = None, + properties: Optional["_models.ApiOperationPropertiesDefinition"] = None, **kwargs ): """ @@ -251,8 +251,7 @@ def __init__( class ApiOperationAnnotation(msrest.serialization.Model): """The Api Operation Annotation. - :ivar status: The status annotation. Possible values include: "NotSpecified", "Preview", - "Production". + :ivar status: The status annotation. Known values are: "NotSpecified", "Preview", "Production". :vartype status: str or ~azure.mgmt.logic.models.StatusAnnotation :ivar family: The family. :vartype family: str @@ -269,13 +268,13 @@ class ApiOperationAnnotation(msrest.serialization.Model): def __init__( self, *, - status: Optional[Union[str, "StatusAnnotation"]] = None, + status: Optional[Union[str, "_models.StatusAnnotation"]] = None, family: Optional[str] = None, revision: Optional[int] = None, **kwargs ): """ - :keyword status: The status annotation. Possible values include: "NotSpecified", "Preview", + :keyword status: The status annotation. Known values are: "NotSpecified", "Preview", "Production". :paramtype status: str or ~azure.mgmt.logic.models.StatusAnnotation :keyword family: The family. @@ -306,7 +305,7 @@ class ApiOperationListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["ApiOperation"]] = None, + value: Optional[List["_models.ApiOperation"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -374,10 +373,10 @@ def __init__( trigger: Optional[str] = None, trigger_hint: Optional[str] = None, pageable: Optional[bool] = None, - annotation: Optional["ApiOperationAnnotation"] = None, - api: Optional["ApiReference"] = None, - inputs_definition: Optional["SwaggerSchema"] = None, - responses_definition: Optional[Dict[str, "SwaggerSchema"]] = None, + annotation: Optional["_models.ApiOperationAnnotation"] = None, + api: Optional["_models.ApiReference"] = None, + inputs_definition: Optional["_models.SwaggerSchema"] = None, + responses_definition: Optional[Dict[str, "_models.SwaggerSchema"]] = None, is_webhook: Optional[bool] = None, is_notification: Optional[bool] = None, **kwargs @@ -484,7 +483,7 @@ class ApiReference(ResourceReference): :vartype swagger: any :ivar brand_color: The brand color of the api. :vartype brand_color: str - :ivar category: The tier. Possible values include: "NotSpecified", "Enterprise", "Standard", + :ivar category: The tier. Known values are: "NotSpecified", "Enterprise", "Standard", "Premium". :vartype category: str or ~azure.mgmt.logic.models.ApiTier :ivar integration_service_environment: The integration service environment reference. @@ -518,8 +517,8 @@ def __init__( icon_uri: Optional[str] = None, swagger: Optional[Any] = None, brand_color: Optional[str] = None, - category: Optional[Union[str, "ApiTier"]] = None, - integration_service_environment: Optional["ResourceReference"] = None, + category: Optional[Union[str, "_models.ApiTier"]] = None, + integration_service_environment: Optional["_models.ResourceReference"] = None, **kwargs ): """ @@ -535,7 +534,7 @@ def __init__( :paramtype swagger: any :keyword brand_color: The brand color of the api. :paramtype brand_color: str - :keyword category: The tier. Possible values include: "NotSpecified", "Enterprise", "Standard", + :keyword category: The tier. Known values are: "NotSpecified", "Enterprise", "Standard", "Premium". :paramtype category: str or ~azure.mgmt.logic.models.ApiTier :keyword integration_service_environment: The integration service environment reference. @@ -621,8 +620,7 @@ class ApiResourceGeneralInformation(msrest.serialization.Model): :vartype terms_of_use_url: str :ivar release_tag: The release tag. :vartype release_tag: str - :ivar tier: The tier. Possible values include: "NotSpecified", "Enterprise", "Standard", - "Premium". + :ivar tier: The tier. Known values are: "NotSpecified", "Enterprise", "Standard", "Premium". :vartype tier: str or ~azure.mgmt.logic.models.ApiTier """ @@ -643,7 +641,7 @@ def __init__( description: Optional[str] = None, terms_of_use_url: Optional[str] = None, release_tag: Optional[str] = None, - tier: Optional[Union[str, "ApiTier"]] = None, + tier: Optional[Union[str, "_models.ApiTier"]] = None, **kwargs ): """ @@ -657,8 +655,7 @@ def __init__( :paramtype terms_of_use_url: str :keyword release_tag: The release tag. :paramtype release_tag: str - :keyword tier: The tier. Possible values include: "NotSpecified", "Enterprise", "Standard", - "Premium". + :keyword tier: The tier. Known values are: "NotSpecified", "Enterprise", "Standard", "Premium". :paramtype tier: str or ~azure.mgmt.logic.models.ApiTier """ super(ApiResourceGeneralInformation, self).__init__(**kwargs) @@ -681,18 +678,18 @@ class ApiResourceMetadata(msrest.serialization.Model): :vartype hide_key: str :ivar tags: A set of tags. The tags. :vartype tags: dict[str, str] - :ivar api_type: The api type. Possible values include: "NotSpecified", "Rest", "Soap". + :ivar api_type: The api type. Known values are: "NotSpecified", "Rest", "Soap". :vartype api_type: str or ~azure.mgmt.logic.models.ApiType :ivar wsdl_service: The WSDL service. :vartype wsdl_service: ~azure.mgmt.logic.models.WsdlService - :ivar wsdl_import_method: The WSDL import method. Possible values include: "NotSpecified", + :ivar wsdl_import_method: The WSDL import method. Known values are: "NotSpecified", "SoapToRest", "SoapPassThrough". :vartype wsdl_import_method: str or ~azure.mgmt.logic.models.WsdlImportMethod :ivar connection_type: The connection type. :vartype connection_type: str - :ivar provisioning_state: The provisioning state. Possible values include: "NotSpecified", - "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", - "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + :ivar provisioning_state: The provisioning state. Known values are: "NotSpecified", "Accepted", + "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", + "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState :ivar deployment_parameters: The connector deployment parameters metadata. @@ -719,12 +716,12 @@ def __init__( brand_color: Optional[str] = None, hide_key: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - api_type: Optional[Union[str, "ApiType"]] = None, - wsdl_service: Optional["WsdlService"] = None, - wsdl_import_method: Optional[Union[str, "WsdlImportMethod"]] = None, + api_type: Optional[Union[str, "_models.ApiType"]] = None, + wsdl_service: Optional["_models.WsdlService"] = None, + wsdl_import_method: Optional[Union[str, "_models.WsdlImportMethod"]] = None, connection_type: Optional[str] = None, - provisioning_state: Optional[Union[str, "WorkflowProvisioningState"]] = None, - deployment_parameters: Optional["ApiDeploymentParameterMetadataSet"] = None, + provisioning_state: Optional[Union[str, "_models.WorkflowProvisioningState"]] = None, + deployment_parameters: Optional["_models.ApiDeploymentParameterMetadataSet"] = None, **kwargs ): """ @@ -736,16 +733,16 @@ def __init__( :paramtype hide_key: str :keyword tags: A set of tags. The tags. :paramtype tags: dict[str, str] - :keyword api_type: The api type. Possible values include: "NotSpecified", "Rest", "Soap". + :keyword api_type: The api type. Known values are: "NotSpecified", "Rest", "Soap". :paramtype api_type: str or ~azure.mgmt.logic.models.ApiType :keyword wsdl_service: The WSDL service. :paramtype wsdl_service: ~azure.mgmt.logic.models.WsdlService - :keyword wsdl_import_method: The WSDL import method. Possible values include: "NotSpecified", + :keyword wsdl_import_method: The WSDL import method. Known values are: "NotSpecified", "SoapToRest", "SoapPassThrough". :paramtype wsdl_import_method: str or ~azure.mgmt.logic.models.WsdlImportMethod :keyword connection_type: The connection type. :paramtype connection_type: str - :keyword provisioning_state: The provisioning state. Possible values include: "NotSpecified", + :keyword provisioning_state: The provisioning state. Known values are: "NotSpecified", "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". @@ -825,13 +822,13 @@ class ApiResourceProperties(msrest.serialization.Model): :vartype api_definitions: ~azure.mgmt.logic.models.ApiResourceDefinitions :ivar integration_service_environment: The integration service environment reference. :vartype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference - :ivar provisioning_state: The provisioning state. Possible values include: "NotSpecified", - "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", - "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + :ivar provisioning_state: The provisioning state. Known values are: "NotSpecified", "Accepted", + "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", + "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState - :ivar category: The category. Possible values include: "NotSpecified", "Enterprise", - "Standard", "Premium". + :ivar category: The category. Known values are: "NotSpecified", "Enterprise", "Standard", + "Premium". :vartype category: str or ~azure.mgmt.logic.models.ApiTier """ @@ -869,7 +866,7 @@ class ApiResourceProperties(msrest.serialization.Model): def __init__( self, *, - integration_service_environment: Optional["ResourceReference"] = None, + integration_service_environment: Optional["_models.ResourceReference"] = None, **kwargs ): """ @@ -965,7 +962,7 @@ def __init__( metadata: Optional[Any] = None, content: Optional[Any] = None, content_type: Optional[str] = None, - content_link: Optional["ContentLink"] = None, + content_link: Optional["_models.ContentLink"] = None, **kwargs ): """ @@ -1071,8 +1068,8 @@ class AS2AgreementContent(msrest.serialization.Model): def __init__( self, *, - receive_agreement: "AS2OneWayAgreement", - send_agreement: "AS2OneWayAgreement", + receive_agreement: "_models.AS2OneWayAgreement", + send_agreement: "_models.AS2OneWayAgreement", **kwargs ): """ @@ -1222,8 +1219,8 @@ class AS2MdnSettings(msrest.serialization.Model): :ivar send_inbound_mdn_to_message_box: Required. The value indicating whether to send inbound MDN to message box. :vartype send_inbound_mdn_to_message_box: bool - :ivar mic_hashing_algorithm: Required. The signing or hashing algorithm. Possible values - include: "NotSpecified", "None", "MD5", "SHA1", "SHA2256", "SHA2384", "SHA2512". + :ivar mic_hashing_algorithm: Required. The signing or hashing algorithm. Known values are: + "NotSpecified", "None", "MD5", "SHA1", "SHA2256", "SHA2384", "SHA2512". :vartype mic_hashing_algorithm: str or ~azure.mgmt.logic.models.HashingAlgorithm """ @@ -1256,7 +1253,7 @@ def __init__( send_mdn_asynchronously: bool, sign_outbound_mdn_if_optional: bool, send_inbound_mdn_to_message_box: bool, - mic_hashing_algorithm: Union[str, "HashingAlgorithm"], + mic_hashing_algorithm: Union[str, "_models.HashingAlgorithm"], receipt_delivery_url: Optional[str] = None, disposition_notification_to: Optional[str] = None, mdn_text: Optional[str] = None, @@ -1282,8 +1279,8 @@ def __init__( :keyword send_inbound_mdn_to_message_box: Required. The value indicating whether to send inbound MDN to message box. :paramtype send_inbound_mdn_to_message_box: bool - :keyword mic_hashing_algorithm: Required. The signing or hashing algorithm. Possible values - include: "NotSpecified", "None", "MD5", "SHA1", "SHA2256", "SHA2384", "SHA2512". + :keyword mic_hashing_algorithm: Required. The signing or hashing algorithm. Known values are: + "NotSpecified", "None", "MD5", "SHA1", "SHA2256", "SHA2384", "SHA2512". :paramtype mic_hashing_algorithm: str or ~azure.mgmt.logic.models.HashingAlgorithm """ super(AS2MdnSettings, self).__init__(**kwargs) @@ -1388,9 +1385,9 @@ class AS2OneWayAgreement(msrest.serialization.Model): def __init__( self, *, - sender_business_identity: "BusinessIdentity", - receiver_business_identity: "BusinessIdentity", - protocol_settings: "AS2ProtocolSettings", + sender_business_identity: "_models.BusinessIdentity", + receiver_business_identity: "_models.BusinessIdentity", + protocol_settings: "_models.AS2ProtocolSettings", **kwargs ): """ @@ -1452,13 +1449,13 @@ class AS2ProtocolSettings(msrest.serialization.Model): def __init__( self, *, - message_connection_settings: "AS2MessageConnectionSettings", - acknowledgement_connection_settings: "AS2AcknowledgementConnectionSettings", - mdn_settings: "AS2MdnSettings", - security_settings: "AS2SecuritySettings", - validation_settings: "AS2ValidationSettings", - envelope_settings: "AS2EnvelopeSettings", - error_settings: "AS2ErrorSettings", + message_connection_settings: "_models.AS2MessageConnectionSettings", + acknowledgement_connection_settings: "_models.AS2AcknowledgementConnectionSettings", + mdn_settings: "_models.AS2MdnSettings", + security_settings: "_models.AS2SecuritySettings", + validation_settings: "_models.AS2ValidationSettings", + envelope_settings: "_models.AS2EnvelopeSettings", + error_settings: "_models.AS2ErrorSettings", **kwargs ): """ @@ -1632,11 +1629,11 @@ class AS2ValidationSettings(msrest.serialization.Model): :ivar check_certificate_revocation_list_on_receive: Required. The value indicating whether to check for certificate revocation list on receive. :vartype check_certificate_revocation_list_on_receive: bool - :ivar encryption_algorithm: Required. The encryption algorithm. Possible values include: + :ivar encryption_algorithm: Required. The encryption algorithm. Known values are: "NotSpecified", "None", "DES3", "RC2", "AES128", "AES192", "AES256". :vartype encryption_algorithm: str or ~azure.mgmt.logic.models.EncryptionAlgorithm - :ivar signing_algorithm: The signing algorithm. Possible values include: "NotSpecified", - "Default", "SHA1", "SHA2256", "SHA2384", "SHA2512". + :ivar signing_algorithm: The signing algorithm. Known values are: "NotSpecified", "Default", + "SHA1", "SHA2256", "SHA2384", "SHA2512". :vartype signing_algorithm: str or ~azure.mgmt.logic.models.SigningAlgorithm """ @@ -1676,8 +1673,8 @@ def __init__( interchange_duplicates_validity_days: int, check_certificate_revocation_list_on_send: bool, check_certificate_revocation_list_on_receive: bool, - encryption_algorithm: Union[str, "EncryptionAlgorithm"], - signing_algorithm: Optional[Union[str, "SigningAlgorithm"]] = None, + encryption_algorithm: Union[str, "_models.EncryptionAlgorithm"], + signing_algorithm: Optional[Union[str, "_models.SigningAlgorithm"]] = None, **kwargs ): """ @@ -1704,11 +1701,11 @@ def __init__( :keyword check_certificate_revocation_list_on_receive: Required. The value indicating whether to check for certificate revocation list on receive. :paramtype check_certificate_revocation_list_on_receive: bool - :keyword encryption_algorithm: Required. The encryption algorithm. Possible values include: + :keyword encryption_algorithm: Required. The encryption algorithm. Known values are: "NotSpecified", "None", "DES3", "RC2", "AES128", "AES192", "AES256". :paramtype encryption_algorithm: str or ~azure.mgmt.logic.models.EncryptionAlgorithm - :keyword signing_algorithm: The signing algorithm. Possible values include: "NotSpecified", - "Default", "SHA1", "SHA2256", "SHA2384", "SHA2512". + :keyword signing_algorithm: The signing algorithm. Known values are: "NotSpecified", "Default", + "SHA1", "SHA2256", "SHA2384", "SHA2512". :paramtype signing_algorithm: str or ~azure.mgmt.logic.models.SigningAlgorithm """ super(AS2ValidationSettings, self).__init__(**kwargs) @@ -1738,7 +1735,7 @@ class AssemblyCollection(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["AssemblyDefinition"]] = None, + value: Optional[List["_models.AssemblyDefinition"]] = None, **kwargs ): """ @@ -1789,7 +1786,7 @@ class AssemblyDefinition(Resource): def __init__( self, *, - properties: "AssemblyProperties", + properties: "_models.AssemblyProperties", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs @@ -1859,7 +1856,7 @@ def __init__( metadata: Optional[Any] = None, content: Optional[Any] = None, content_type: Optional[str] = None, - content_link: Optional["ContentLink"] = None, + content_link: Optional["_models.ContentLink"] = None, assembly_version: Optional[str] = None, assembly_culture: Optional[str] = None, assembly_public_key_token: Optional[str] = None, @@ -1954,7 +1951,7 @@ def __init__( *, code: str, message: str, - details: Optional[List["AzureResourceErrorInfo"]] = None, + details: Optional[List["_models.AzureResourceErrorInfo"]] = None, **kwargs ): """ @@ -1984,7 +1981,7 @@ class B2BPartnerContent(msrest.serialization.Model): def __init__( self, *, - business_identities: Optional[List["BusinessIdentity"]] = None, + business_identities: Optional[List["_models.BusinessIdentity"]] = None, **kwargs ): """ @@ -2035,7 +2032,7 @@ class BatchConfiguration(Resource): def __init__( self, *, - properties: "BatchConfigurationProperties", + properties: "_models.BatchConfigurationProperties", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs @@ -2066,7 +2063,7 @@ class BatchConfigurationCollection(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["BatchConfiguration"]] = None, + value: Optional[List["_models.BatchConfiguration"]] = None, **kwargs ): """ @@ -2111,7 +2108,7 @@ def __init__( self, *, batch_group_name: str, - release_criteria: "BatchReleaseCriteria", + release_criteria: "_models.BatchReleaseCriteria", created_time: Optional[datetime.datetime] = None, changed_time: Optional[datetime.datetime] = None, metadata: Optional[Any] = None, @@ -2156,7 +2153,7 @@ def __init__( *, message_count: Optional[int] = None, batch_size: Optional[int] = None, - recurrence: Optional["WorkflowTriggerRecurrence"] = None, + recurrence: Optional["_models.WorkflowTriggerRecurrence"] = None, **kwargs ): """ @@ -2496,8 +2493,8 @@ class EdifactAgreementContent(msrest.serialization.Model): def __init__( self, *, - receive_agreement: "EdifactOneWayAgreement", - send_agreement: "EdifactOneWayAgreement", + receive_agreement: "_models.EdifactOneWayAgreement", + send_agreement: "_models.EdifactOneWayAgreement", **kwargs ): """ @@ -2530,10 +2527,10 @@ class EdifactDelimiterOverride(msrest.serialization.Model): :vartype segment_terminator: int :ivar repetition_separator: Required. The repetition separator. :vartype repetition_separator: int - :ivar segment_terminator_suffix: Required. The segment terminator suffix. Possible values - include: "NotSpecified", "None", "CR", "LF", "CRLF". + :ivar segment_terminator_suffix: Required. The segment terminator suffix. Known values are: + "NotSpecified", "None", "CR", "LF", "CRLF". :vartype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix - :ivar decimal_point_indicator: Required. The decimal point indicator. Possible values include: + :ivar decimal_point_indicator: Required. The decimal point indicator. Known values are: "NotSpecified", "Comma", "Decimal". :vartype decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator :ivar release_indicator: Required. The release indicator. @@ -2577,8 +2574,8 @@ def __init__( component_separator: int, segment_terminator: int, repetition_separator: int, - segment_terminator_suffix: Union[str, "SegmentTerminatorSuffix"], - decimal_point_indicator: Union[str, "EdifactDecimalIndicator"], + segment_terminator_suffix: Union[str, "_models.SegmentTerminatorSuffix"], + decimal_point_indicator: Union[str, "_models.EdifactDecimalIndicator"], release_indicator: int, message_id: Optional[str] = None, message_version: Optional[str] = None, @@ -2602,11 +2599,11 @@ def __init__( :paramtype segment_terminator: int :keyword repetition_separator: Required. The repetition separator. :paramtype repetition_separator: int - :keyword segment_terminator_suffix: Required. The segment terminator suffix. Possible values - include: "NotSpecified", "None", "CR", "LF", "CRLF". + :keyword segment_terminator_suffix: Required. The segment terminator suffix. Known values are: + "NotSpecified", "None", "CR", "LF", "CRLF". :paramtype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix - :keyword decimal_point_indicator: Required. The decimal point indicator. Possible values - include: "NotSpecified", "Comma", "Decimal". + :keyword decimal_point_indicator: Required. The decimal point indicator. Known values are: + "NotSpecified", "Comma", "Decimal". :paramtype decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator :keyword release_indicator: Required. The release indicator. :paramtype release_indicator: int @@ -3127,15 +3124,15 @@ class EdifactFramingSettings(msrest.serialization.Model): :vartype release_indicator: int :ivar repetition_separator: Required. The repetition separator. :vartype repetition_separator: int - :ivar character_set: Required. The EDIFACT frame setting characterSet. Possible values include: + :ivar character_set: Required. The EDIFACT frame setting characterSet. Known values are: "NotSpecified", "UNOB", "UNOA", "UNOC", "UNOD", "UNOE", "UNOF", "UNOG", "UNOH", "UNOI", "UNOJ", "UNOK", "UNOX", "UNOY", "KECA". :vartype character_set: str or ~azure.mgmt.logic.models.EdifactCharacterSet - :ivar decimal_point_indicator: Required. The EDIFACT frame setting decimal indicator. Possible - values include: "NotSpecified", "Comma", "Decimal". + :ivar decimal_point_indicator: Required. The EDIFACT frame setting decimal indicator. Known + values are: "NotSpecified", "Comma", "Decimal". :vartype decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator :ivar segment_terminator_suffix: Required. The EDIFACT frame setting segment terminator suffix. - Possible values include: "NotSpecified", "None", "CR", "LF", "CRLF". + Known values are: "NotSpecified", "None", "CR", "LF", "CRLF". :vartype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix """ @@ -3174,9 +3171,9 @@ def __init__( segment_terminator: int, release_indicator: int, repetition_separator: int, - character_set: Union[str, "EdifactCharacterSet"], - decimal_point_indicator: Union[str, "EdifactDecimalIndicator"], - segment_terminator_suffix: Union[str, "SegmentTerminatorSuffix"], + character_set: Union[str, "_models.EdifactCharacterSet"], + decimal_point_indicator: Union[str, "_models.EdifactDecimalIndicator"], + segment_terminator_suffix: Union[str, "_models.SegmentTerminatorSuffix"], service_code_list_directory_version: Optional[str] = None, character_encoding: Optional[str] = None, **kwargs @@ -3198,15 +3195,15 @@ def __init__( :paramtype release_indicator: int :keyword repetition_separator: Required. The repetition separator. :paramtype repetition_separator: int - :keyword character_set: Required. The EDIFACT frame setting characterSet. Possible values - include: "NotSpecified", "UNOB", "UNOA", "UNOC", "UNOD", "UNOE", "UNOF", "UNOG", "UNOH", - "UNOI", "UNOJ", "UNOK", "UNOX", "UNOY", "KECA". + :keyword character_set: Required. The EDIFACT frame setting characterSet. Known values are: + "NotSpecified", "UNOB", "UNOA", "UNOC", "UNOD", "UNOE", "UNOF", "UNOG", "UNOH", "UNOI", "UNOJ", + "UNOK", "UNOX", "UNOY", "KECA". :paramtype character_set: str or ~azure.mgmt.logic.models.EdifactCharacterSet - :keyword decimal_point_indicator: Required. The EDIFACT frame setting decimal indicator. - Possible values include: "NotSpecified", "Comma", "Decimal". + :keyword decimal_point_indicator: Required. The EDIFACT frame setting decimal indicator. Known + values are: "NotSpecified", "Comma", "Decimal". :paramtype decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator :keyword segment_terminator_suffix: Required. The EDIFACT frame setting segment terminator - suffix. Possible values include: "NotSpecified", "None", "CR", "LF", "CRLF". + suffix. Known values are: "NotSpecified", "None", "CR", "LF", "CRLF". :paramtype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix """ super(EdifactFramingSettings, self).__init__(**kwargs) @@ -3228,8 +3225,8 @@ class EdifactMessageFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar message_filter_type: Required. The message filter type. Possible values include: - "NotSpecified", "Include", "Exclude". + :ivar message_filter_type: Required. The message filter type. Known values are: "NotSpecified", + "Include", "Exclude". :vartype message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType """ @@ -3244,11 +3241,11 @@ class EdifactMessageFilter(msrest.serialization.Model): def __init__( self, *, - message_filter_type: Union[str, "MessageFilterType"], + message_filter_type: Union[str, "_models.MessageFilterType"], **kwargs ): """ - :keyword message_filter_type: Required. The message filter type. Possible values include: + :keyword message_filter_type: Required. The message filter type. Known values are: "NotSpecified", "Include", "Exclude". :paramtype message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType """ @@ -3316,9 +3313,9 @@ class EdifactOneWayAgreement(msrest.serialization.Model): def __init__( self, *, - sender_business_identity: "BusinessIdentity", - receiver_business_identity: "BusinessIdentity", - protocol_settings: "EdifactProtocolSettings", + sender_business_identity: "_models.BusinessIdentity", + receiver_business_identity: "_models.BusinessIdentity", + protocol_settings: "_models.EdifactProtocolSettings", **kwargs ): """ @@ -3461,17 +3458,17 @@ class EdifactProtocolSettings(msrest.serialization.Model): def __init__( self, *, - validation_settings: "EdifactValidationSettings", - framing_settings: "EdifactFramingSettings", - envelope_settings: "EdifactEnvelopeSettings", - acknowledgement_settings: "EdifactAcknowledgementSettings", - message_filter: "EdifactMessageFilter", - processing_settings: "EdifactProcessingSettings", - schema_references: List["EdifactSchemaReference"], - envelope_overrides: Optional[List["EdifactEnvelopeOverride"]] = None, - message_filter_list: Optional[List["EdifactMessageIdentifier"]] = None, - validation_overrides: Optional[List["EdifactValidationOverride"]] = None, - edifact_delimiter_overrides: Optional[List["EdifactDelimiterOverride"]] = None, + validation_settings: "_models.EdifactValidationSettings", + framing_settings: "_models.EdifactFramingSettings", + envelope_settings: "_models.EdifactEnvelopeSettings", + acknowledgement_settings: "_models.EdifactAcknowledgementSettings", + message_filter: "_models.EdifactMessageFilter", + processing_settings: "_models.EdifactProcessingSettings", + schema_references: List["_models.EdifactSchemaReference"], + envelope_overrides: Optional[List["_models.EdifactEnvelopeOverride"]] = None, + message_filter_list: Optional[List["_models.EdifactMessageIdentifier"]] = None, + validation_overrides: Optional[List["_models.EdifactValidationOverride"]] = None, + edifact_delimiter_overrides: Optional[List["_models.EdifactDelimiterOverride"]] = None, **kwargs ): """ @@ -3604,8 +3601,8 @@ class EdifactValidationOverride(msrest.serialization.Model): :ivar allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to allow leading and trailing spaces and zeroes. :vartype allow_leading_and_trailing_spaces_and_zeroes: bool - :ivar trailing_separator_policy: Required. The trailing separator policy. Possible values - include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :ivar trailing_separator_policy: Required. The trailing separator policy. Known values are: + "NotSpecified", "NotAllowed", "Optional", "Mandatory". :vartype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy :ivar trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to trim leading and trailing spaces and zeroes. @@ -3640,7 +3637,7 @@ def __init__( validate_edi_types: bool, validate_xsd_types: bool, allow_leading_and_trailing_spaces_and_zeroes: bool, - trailing_separator_policy: Union[str, "TrailingSeparatorPolicy"], + trailing_separator_policy: Union[str, "_models.TrailingSeparatorPolicy"], trim_leading_and_trailing_spaces_and_zeroes: bool, **kwargs ): @@ -3658,8 +3655,8 @@ def __init__( :keyword allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to allow leading and trailing spaces and zeroes. :paramtype allow_leading_and_trailing_spaces_and_zeroes: bool - :keyword trailing_separator_policy: Required. The trailing separator policy. Possible values - include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :keyword trailing_separator_policy: Required. The trailing separator policy. Known values are: + "NotSpecified", "NotAllowed", "Optional", "Mandatory". :paramtype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy :keyword trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to trim leading and trailing spaces and zeroes. @@ -3707,8 +3704,8 @@ class EdifactValidationSettings(msrest.serialization.Model): :ivar trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to trim leading and trailing spaces and zeroes. :vartype trim_leading_and_trailing_spaces_and_zeroes: bool - :ivar trailing_separator_policy: Required. The trailing separator policy. Possible values - include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :ivar trailing_separator_policy: Required. The trailing separator policy. Known values are: + "NotSpecified", "NotAllowed", "Optional", "Mandatory". :vartype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ @@ -3750,7 +3747,7 @@ def __init__( validate_xsd_types: bool, allow_leading_and_trailing_spaces_and_zeroes: bool, trim_leading_and_trailing_spaces_and_zeroes: bool, - trailing_separator_policy: Union[str, "TrailingSeparatorPolicy"], + trailing_separator_policy: Union[str, "_models.TrailingSeparatorPolicy"], **kwargs ): """ @@ -3781,8 +3778,8 @@ def __init__( :keyword trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to trim leading and trailing spaces and zeroes. :paramtype trim_leading_and_trailing_spaces_and_zeroes: bool - :keyword trailing_separator_policy: Required. The trailing separator policy. Possible values - include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :keyword trailing_separator_policy: Required. The trailing separator policy. Known values are: + "NotSpecified", "NotAllowed", "Optional", "Mandatory". :paramtype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ super(EdifactValidationSettings, self).__init__(**kwargs) @@ -3844,7 +3841,7 @@ class ErrorResponse(msrest.serialization.Model): def __init__( self, *, - error: Optional["ErrorProperties"] = None, + error: Optional["_models.ErrorProperties"] = None, **kwargs ): """ @@ -3880,8 +3877,8 @@ def __init__( *, text: Optional[str] = None, value: Optional[Any] = None, - subexpressions: Optional[List["Expression"]] = None, - error: Optional["AzureResourceErrorInfo"] = None, + subexpressions: Optional[List["_models.Expression"]] = None, + error: Optional["_models.AzureResourceErrorInfo"] = None, **kwargs ): """ @@ -3929,8 +3926,8 @@ def __init__( *, text: Optional[str] = None, value: Optional[Any] = None, - subexpressions: Optional[List["Expression"]] = None, - error: Optional["AzureResourceErrorInfo"] = None, + subexpressions: Optional[List["_models.Expression"]] = None, + error: Optional["_models.AzureResourceErrorInfo"] = None, path: Optional[str] = None, **kwargs ): @@ -3964,7 +3961,7 @@ class ExpressionTraces(msrest.serialization.Model): def __init__( self, *, - inputs: Optional[List["ExpressionRoot"]] = None, + inputs: Optional[List["_models.ExpressionRoot"]] = None, **kwargs ): """ @@ -3980,7 +3977,7 @@ class ExtendedErrorInfo(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar code: Required. The error code. Possible values include: "NotSpecified", + :ivar code: Required. The error code. Known values are: "NotSpecified", "IntegrationServiceEnvironmentNotFound", "InternalServerError", "InvalidOperationId". :vartype code: str or ~azure.mgmt.logic.models.ErrorResponseCode :ivar message: Required. The error message. @@ -4006,14 +4003,14 @@ class ExtendedErrorInfo(msrest.serialization.Model): def __init__( self, *, - code: Union[str, "ErrorResponseCode"], + code: Union[str, "_models.ErrorResponseCode"], message: str, - details: Optional[List["ExtendedErrorInfo"]] = None, + details: Optional[List["_models.ExtendedErrorInfo"]] = None, inner_error: Optional[Any] = None, **kwargs ): """ - :keyword code: Required. The error code. Possible values include: "NotSpecified", + :keyword code: Required. The error code. Known values are: "NotSpecified", "IntegrationServiceEnvironmentNotFound", "InternalServerError", "InvalidOperationId". :paramtype code: str or ~azure.mgmt.logic.models.ErrorResponseCode :keyword message: Required. The error message. @@ -4053,10 +4050,10 @@ class FlowAccessControlConfiguration(msrest.serialization.Model): def __init__( self, *, - triggers: Optional["FlowAccessControlConfigurationPolicy"] = None, - contents: Optional["FlowAccessControlConfigurationPolicy"] = None, - actions: Optional["FlowAccessControlConfigurationPolicy"] = None, - workflow_management: Optional["FlowAccessControlConfigurationPolicy"] = None, + triggers: Optional["_models.FlowAccessControlConfigurationPolicy"] = None, + contents: Optional["_models.FlowAccessControlConfigurationPolicy"] = None, + actions: Optional["_models.FlowAccessControlConfigurationPolicy"] = None, + workflow_management: Optional["_models.FlowAccessControlConfigurationPolicy"] = None, **kwargs ): """ @@ -4094,8 +4091,8 @@ class FlowAccessControlConfigurationPolicy(msrest.serialization.Model): def __init__( self, *, - allowed_caller_ip_addresses: Optional[List["IpAddressRange"]] = None, - open_authentication_policies: Optional["OpenAuthenticationAccessPolicies"] = None, + allowed_caller_ip_addresses: Optional[List["_models.IpAddressRange"]] = None, + open_authentication_policies: Optional["_models.OpenAuthenticationAccessPolicies"] = None, **kwargs ): """ @@ -4127,8 +4124,8 @@ class FlowEndpoints(msrest.serialization.Model): def __init__( self, *, - outgoing_ip_addresses: Optional[List["IpAddress"]] = None, - access_endpoint_ip_addresses: Optional[List["IpAddress"]] = None, + outgoing_ip_addresses: Optional[List["_models.IpAddress"]] = None, + access_endpoint_ip_addresses: Optional[List["_models.IpAddress"]] = None, **kwargs ): """ @@ -4159,8 +4156,8 @@ class FlowEndpointsConfiguration(msrest.serialization.Model): def __init__( self, *, - workflow: Optional["FlowEndpoints"] = None, - connector: Optional["FlowEndpoints"] = None, + workflow: Optional["_models.FlowEndpoints"] = None, + connector: Optional["_models.FlowEndpoints"] = None, **kwargs ): """ @@ -4204,7 +4201,7 @@ class GetCallbackUrlParameters(msrest.serialization.Model): :ivar not_after: The expiry time. :vartype not_after: ~datetime.datetime - :ivar key_type: The key type. Possible values include: "NotSpecified", "Primary", "Secondary". + :ivar key_type: The key type. Known values are: "NotSpecified", "Primary", "Secondary". :vartype key_type: str or ~azure.mgmt.logic.models.KeyType """ @@ -4217,14 +4214,13 @@ def __init__( self, *, not_after: Optional[datetime.datetime] = None, - key_type: Optional[Union[str, "KeyType"]] = None, + key_type: Optional[Union[str, "_models.KeyType"]] = None, **kwargs ): """ :keyword not_after: The expiry time. :paramtype not_after: ~datetime.datetime - :keyword key_type: The key type. Possible values include: "NotSpecified", "Primary", - "Secondary". + :keyword key_type: The key type. Known values are: "NotSpecified", "Primary", "Secondary". :paramtype key_type: str or ~azure.mgmt.logic.models.KeyType """ super(GetCallbackUrlParameters, self).__init__(**kwargs) @@ -4251,8 +4247,8 @@ class IntegrationAccount(Resource): :vartype sku: ~azure.mgmt.logic.models.IntegrationAccountSku :ivar integration_service_environment: The integration service environment. :vartype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference - :ivar state: The workflow state. Possible values include: "NotSpecified", "Completed", - "Enabled", "Disabled", "Deleted", "Suspended". + :ivar state: The workflow state. Known values are: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState """ @@ -4278,9 +4274,9 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - sku: Optional["IntegrationAccountSku"] = None, - integration_service_environment: Optional["ResourceReference"] = None, - state: Optional[Union[str, "WorkflowState"]] = None, + sku: Optional["_models.IntegrationAccountSku"] = None, + integration_service_environment: Optional["_models.ResourceReference"] = None, + state: Optional[Union[str, "_models.WorkflowState"]] = None, **kwargs ): """ @@ -4292,8 +4288,8 @@ def __init__( :paramtype sku: ~azure.mgmt.logic.models.IntegrationAccountSku :keyword integration_service_environment: The integration service environment. :paramtype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference - :keyword state: The workflow state. Possible values include: "NotSpecified", "Completed", - "Enabled", "Disabled", "Deleted", "Suspended". + :keyword state: The workflow state. Known values are: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState """ super(IntegrationAccount, self).__init__(location=location, tags=tags, **kwargs) @@ -4325,8 +4321,8 @@ class IntegrationAccountAgreement(Resource): :vartype changed_time: ~datetime.datetime :ivar metadata: The metadata. :vartype metadata: any - :ivar agreement_type: Required. The agreement type. Possible values include: "NotSpecified", - "AS2", "X12", "Edifact". + :ivar agreement_type: Required. The agreement type. Known values are: "NotSpecified", "AS2", + "X12", "Edifact". :vartype agreement_type: str or ~azure.mgmt.logic.models.AgreementType :ivar host_partner: Required. The integration account partner that is set as host partner for this agreement. @@ -4376,12 +4372,12 @@ class IntegrationAccountAgreement(Resource): def __init__( self, *, - agreement_type: Union[str, "AgreementType"], + agreement_type: Union[str, "_models.AgreementType"], host_partner: str, guest_partner: str, - host_identity: "BusinessIdentity", - guest_identity: "BusinessIdentity", - content: "AgreementContent", + host_identity: "_models.BusinessIdentity", + guest_identity: "_models.BusinessIdentity", + content: "_models.AgreementContent", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, metadata: Optional[Any] = None, @@ -4394,8 +4390,8 @@ def __init__( :paramtype tags: dict[str, str] :keyword metadata: The metadata. :paramtype metadata: any - :keyword agreement_type: Required. The agreement type. Possible values include: "NotSpecified", - "AS2", "X12", "Edifact". + :keyword agreement_type: Required. The agreement type. Known values are: "NotSpecified", "AS2", + "X12", "Edifact". :paramtype agreement_type: str or ~azure.mgmt.logic.models.AgreementType :keyword host_partner: Required. The integration account partner that is set as host partner for this agreement. @@ -4427,8 +4423,8 @@ class IntegrationAccountAgreementFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar agreement_type: Required. The agreement type of integration account agreement. Possible - values include: "NotSpecified", "AS2", "X12", "Edifact". + :ivar agreement_type: Required. The agreement type of integration account agreement. Known + values are: "NotSpecified", "AS2", "X12", "Edifact". :vartype agreement_type: str or ~azure.mgmt.logic.models.AgreementType """ @@ -4443,12 +4439,12 @@ class IntegrationAccountAgreementFilter(msrest.serialization.Model): def __init__( self, *, - agreement_type: Union[str, "AgreementType"], + agreement_type: Union[str, "_models.AgreementType"], **kwargs ): """ - :keyword agreement_type: Required. The agreement type of integration account agreement. - Possible values include: "NotSpecified", "AS2", "X12", "Edifact". + :keyword agreement_type: Required. The agreement type of integration account agreement. Known + values are: "NotSpecified", "AS2", "X12", "Edifact". :paramtype agreement_type: str or ~azure.mgmt.logic.models.AgreementType """ super(IntegrationAccountAgreementFilter, self).__init__(**kwargs) @@ -4472,7 +4468,7 @@ class IntegrationAccountAgreementListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationAccountAgreement"]] = None, + value: Optional[List["_models.IntegrationAccountAgreement"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4541,7 +4537,7 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, metadata: Optional[Any] = None, - key: Optional["KeyVaultKeyReference"] = None, + key: Optional["_models.KeyVaultKeyReference"] = None, public_certificate: Optional[str] = None, **kwargs ): @@ -4582,7 +4578,7 @@ class IntegrationAccountCertificateListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationAccountCertificate"]] = None, + value: Optional[List["_models.IntegrationAccountCertificate"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4614,7 +4610,7 @@ class IntegrationAccountListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationAccount"]] = None, + value: Optional[List["_models.IntegrationAccount"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4646,8 +4642,8 @@ class IntegrationAccountMap(Resource): :vartype location: str :ivar tags: A set of tags. The resource tags. :vartype tags: dict[str, str] - :ivar map_type: Required. The map type. Possible values include: "NotSpecified", "Xslt", - "Xslt20", "Xslt30", "Liquid". + :ivar map_type: Required. The map type. Known values are: "NotSpecified", "Xslt", "Xslt20", + "Xslt30", "Liquid". :vartype map_type: str or ~azure.mgmt.logic.models.MapType :ivar parameters_schema: The parameters schema of integration account map. :vartype parameters_schema: @@ -4695,10 +4691,10 @@ class IntegrationAccountMap(Resource): def __init__( self, *, - map_type: Union[str, "MapType"], + map_type: Union[str, "_models.MapType"], location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - parameters_schema: Optional["IntegrationAccountMapPropertiesParametersSchema"] = None, + parameters_schema: Optional["_models.IntegrationAccountMapPropertiesParametersSchema"] = None, content: Optional[str] = None, content_type: Optional[str] = None, metadata: Optional[Any] = None, @@ -4709,8 +4705,8 @@ def __init__( :paramtype location: str :keyword tags: A set of tags. The resource tags. :paramtype tags: dict[str, str] - :keyword map_type: Required. The map type. Possible values include: "NotSpecified", "Xslt", - "Xslt20", "Xslt30", "Liquid". + :keyword map_type: Required. The map type. Known values are: "NotSpecified", "Xslt", "Xslt20", + "Xslt30", "Liquid". :paramtype map_type: str or ~azure.mgmt.logic.models.MapType :keyword parameters_schema: The parameters schema of integration account map. :paramtype parameters_schema: @@ -4738,7 +4734,7 @@ class IntegrationAccountMapFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar map_type: Required. The map type of integration account map. Possible values include: + :ivar map_type: Required. The map type of integration account map. Known values are: "NotSpecified", "Xslt", "Xslt20", "Xslt30", "Liquid". :vartype map_type: str or ~azure.mgmt.logic.models.MapType """ @@ -4754,11 +4750,11 @@ class IntegrationAccountMapFilter(msrest.serialization.Model): def __init__( self, *, - map_type: Union[str, "MapType"], + map_type: Union[str, "_models.MapType"], **kwargs ): """ - :keyword map_type: Required. The map type of integration account map. Possible values include: + :keyword map_type: Required. The map type of integration account map. Known values are: "NotSpecified", "Xslt", "Xslt20", "Xslt30", "Liquid". :paramtype map_type: str or ~azure.mgmt.logic.models.MapType """ @@ -4783,7 +4779,7 @@ class IntegrationAccountMapListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationAccountMap"]] = None, + value: Optional[List["_models.IntegrationAccountMap"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4840,7 +4836,7 @@ class IntegrationAccountPartner(Resource): :vartype location: str :ivar tags: A set of tags. The resource tags. :vartype tags: dict[str, str] - :ivar partner_type: Required. The partner type. Possible values include: "NotSpecified", "B2B". + :ivar partner_type: Required. The partner type. Known values are: "NotSpecified", "B2B". :vartype partner_type: str or ~azure.mgmt.logic.models.PartnerType :ivar created_time: The created time. :vartype created_time: ~datetime.datetime @@ -4878,8 +4874,8 @@ class IntegrationAccountPartner(Resource): def __init__( self, *, - partner_type: Union[str, "PartnerType"], - content: "PartnerContent", + partner_type: Union[str, "_models.PartnerType"], + content: "_models.PartnerContent", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, metadata: Optional[Any] = None, @@ -4890,8 +4886,7 @@ def __init__( :paramtype location: str :keyword tags: A set of tags. The resource tags. :paramtype tags: dict[str, str] - :keyword partner_type: Required. The partner type. Possible values include: "NotSpecified", - "B2B". + :keyword partner_type: Required. The partner type. Known values are: "NotSpecified", "B2B". :paramtype partner_type: str or ~azure.mgmt.logic.models.PartnerType :keyword metadata: The metadata. :paramtype metadata: any @@ -4911,8 +4906,8 @@ class IntegrationAccountPartnerFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar partner_type: Required. The partner type of integration account partner. Possible values - include: "NotSpecified", "B2B". + :ivar partner_type: Required. The partner type of integration account partner. Known values + are: "NotSpecified", "B2B". :vartype partner_type: str or ~azure.mgmt.logic.models.PartnerType """ @@ -4927,12 +4922,12 @@ class IntegrationAccountPartnerFilter(msrest.serialization.Model): def __init__( self, *, - partner_type: Union[str, "PartnerType"], + partner_type: Union[str, "_models.PartnerType"], **kwargs ): """ - :keyword partner_type: Required. The partner type of integration account partner. Possible - values include: "NotSpecified", "B2B". + :keyword partner_type: Required. The partner type of integration account partner. Known values + are: "NotSpecified", "B2B". :paramtype partner_type: str or ~azure.mgmt.logic.models.PartnerType """ super(IntegrationAccountPartnerFilter, self).__init__(**kwargs) @@ -4956,7 +4951,7 @@ class IntegrationAccountPartnerListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationAccountPartner"]] = None, + value: Optional[List["_models.IntegrationAccountPartner"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4988,7 +4983,7 @@ class IntegrationAccountSchema(Resource): :vartype location: str :ivar tags: A set of tags. The resource tags. :vartype tags: dict[str, str] - :ivar schema_type: Required. The schema type. Possible values include: "NotSpecified", "Xml". + :ivar schema_type: Required. The schema type. Known values are: "NotSpecified", "Xml". :vartype schema_type: str or ~azure.mgmt.logic.models.SchemaType :ivar target_namespace: The target namespace of the schema. :vartype target_namespace: str @@ -5041,7 +5036,7 @@ class IntegrationAccountSchema(Resource): def __init__( self, *, - schema_type: Union[str, "SchemaType"], + schema_type: Union[str, "_models.SchemaType"], location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, target_namespace: Optional[str] = None, @@ -5057,8 +5052,7 @@ def __init__( :paramtype location: str :keyword tags: A set of tags. The resource tags. :paramtype tags: dict[str, str] - :keyword schema_type: Required. The schema type. Possible values include: "NotSpecified", - "Xml". + :keyword schema_type: Required. The schema type. Known values are: "NotSpecified", "Xml". :paramtype schema_type: str or ~azure.mgmt.logic.models.SchemaType :keyword target_namespace: The target namespace of the schema. :paramtype target_namespace: str @@ -5091,8 +5085,8 @@ class IntegrationAccountSchemaFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar schema_type: Required. The schema type of integration account schema. Possible values - include: "NotSpecified", "Xml". + :ivar schema_type: Required. The schema type of integration account schema. Known values are: + "NotSpecified", "Xml". :vartype schema_type: str or ~azure.mgmt.logic.models.SchemaType """ @@ -5107,12 +5101,12 @@ class IntegrationAccountSchemaFilter(msrest.serialization.Model): def __init__( self, *, - schema_type: Union[str, "SchemaType"], + schema_type: Union[str, "_models.SchemaType"], **kwargs ): """ - :keyword schema_type: Required. The schema type of integration account schema. Possible values - include: "NotSpecified", "Xml". + :keyword schema_type: Required. The schema type of integration account schema. Known values + are: "NotSpecified", "Xml". :paramtype schema_type: str or ~azure.mgmt.logic.models.SchemaType """ super(IntegrationAccountSchemaFilter, self).__init__(**kwargs) @@ -5136,7 +5130,7 @@ class IntegrationAccountSchemaListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationAccountSchema"]] = None, + value: Optional[List["_models.IntegrationAccountSchema"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -5263,7 +5257,7 @@ class IntegrationAccountSessionListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationAccountSession"]] = None, + value: Optional[List["_models.IntegrationAccountSession"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -5283,7 +5277,7 @@ class IntegrationAccountSku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar name: Required. The sku name. Possible values include: "NotSpecified", "Free", "Basic", + :ivar name: Required. The sku name. Known values are: "NotSpecified", "Free", "Basic", "Standard". :vartype name: str or ~azure.mgmt.logic.models.IntegrationAccountSkuName """ @@ -5299,12 +5293,12 @@ class IntegrationAccountSku(msrest.serialization.Model): def __init__( self, *, - name: Union[str, "IntegrationAccountSkuName"], + name: Union[str, "_models.IntegrationAccountSkuName"], **kwargs ): """ - :keyword name: Required. The sku name. Possible values include: "NotSpecified", "Free", - "Basic", "Standard". + :keyword name: Required. The sku name. Known values are: "NotSpecified", "Free", "Basic", + "Standard". :paramtype name: str or ~azure.mgmt.logic.models.IntegrationAccountSkuName """ super(IntegrationAccountSku, self).__init__(**kwargs) @@ -5326,7 +5320,7 @@ class IntegrationServiceEnvironmenEncryptionConfiguration(msrest.serialization.M def __init__( self, *, - encryption_key_reference: Optional["IntegrationServiceEnvironmenEncryptionKeyReference"] = None, + encryption_key_reference: Optional["_models.IntegrationServiceEnvironmenEncryptionKeyReference"] = None, **kwargs ): """ @@ -5358,7 +5352,7 @@ class IntegrationServiceEnvironmenEncryptionKeyReference(msrest.serialization.Mo def __init__( self, *, - key_vault: Optional["ResourceReference"] = None, + key_vault: Optional["_models.ResourceReference"] = None, key_name: Optional[str] = None, key_version: Optional[str] = None, **kwargs @@ -5422,9 +5416,9 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - properties: Optional["IntegrationServiceEnvironmentProperties"] = None, - sku: Optional["IntegrationServiceEnvironmentSku"] = None, - identity: Optional["ManagedServiceIdentity"] = None, + properties: Optional["_models.IntegrationServiceEnvironmentProperties"] = None, + sku: Optional["_models.IntegrationServiceEnvironmentSku"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, **kwargs ): """ @@ -5448,8 +5442,7 @@ def __init__( class IntegrationServiceEnvironmentAccessEndpoint(msrest.serialization.Model): """The integration service environment access endpoint. - :ivar type: The access endpoint type. Possible values include: "NotSpecified", "External", - "Internal". + :ivar type: The access endpoint type. Known values are: "NotSpecified", "External", "Internal". :vartype type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentAccessEndpointType """ @@ -5460,11 +5453,11 @@ class IntegrationServiceEnvironmentAccessEndpoint(msrest.serialization.Model): def __init__( self, *, - type: Optional[Union[str, "IntegrationServiceEnvironmentAccessEndpointType"]] = None, + type: Optional[Union[str, "_models.IntegrationServiceEnvironmentAccessEndpointType"]] = None, **kwargs ): """ - :keyword type: The access endpoint type. Possible values include: "NotSpecified", "External", + :keyword type: The access endpoint type. Known values are: "NotSpecified", "External", "Internal". :paramtype type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentAccessEndpointType @@ -5490,7 +5483,7 @@ class IntegrationServiceEnvironmentListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationServiceEnvironment"]] = None, + value: Optional[List["_models.IntegrationServiceEnvironment"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -5542,13 +5535,13 @@ class IntegrationServiceEnvironmentManagedApi(Resource): :vartype api_definitions: ~azure.mgmt.logic.models.ApiResourceDefinitions :ivar integration_service_environment: The integration service environment reference. :vartype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference - :ivar provisioning_state: The provisioning state. Possible values include: "NotSpecified", - "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", - "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + :ivar provisioning_state: The provisioning state. Known values are: "NotSpecified", "Accepted", + "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", + "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState - :ivar category: The category. Possible values include: "NotSpecified", "Enterprise", - "Standard", "Premium". + :ivar category: The category. Known values are: "NotSpecified", "Enterprise", "Standard", + "Premium". :vartype category: str or ~azure.mgmt.logic.models.ApiTier :ivar deployment_parameters: The integration service environment managed api deployment parameters. @@ -5601,8 +5594,8 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - integration_service_environment: Optional["ResourceReference"] = None, - deployment_parameters: Optional["IntegrationServiceEnvironmentManagedApiDeploymentParameters"] = None, + integration_service_environment: Optional["_models.ResourceReference"] = None, + deployment_parameters: Optional["_models.IntegrationServiceEnvironmentManagedApiDeploymentParameters"] = None, **kwargs ): """ @@ -5649,7 +5642,7 @@ class IntegrationServiceEnvironmentManagedApiDeploymentParameters(msrest.seriali def __init__( self, *, - content_link_definition: Optional["ContentLink"] = None, + content_link_definition: Optional["_models.ContentLink"] = None, **kwargs ): """ @@ -5678,7 +5671,7 @@ class IntegrationServiceEnvironmentManagedApiListResult(msrest.serialization.Mod def __init__( self, *, - value: Optional[List["IntegrationServiceEnvironmentManagedApi"]] = None, + value: Optional[List["_models.IntegrationServiceEnvironmentManagedApi"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -5720,13 +5713,13 @@ class IntegrationServiceEnvironmentManagedApiProperties(ApiResourceProperties): :vartype api_definitions: ~azure.mgmt.logic.models.ApiResourceDefinitions :ivar integration_service_environment: The integration service environment reference. :vartype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference - :ivar provisioning_state: The provisioning state. Possible values include: "NotSpecified", - "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", - "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + :ivar provisioning_state: The provisioning state. Known values are: "NotSpecified", "Accepted", + "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", + "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState - :ivar category: The category. Possible values include: "NotSpecified", "Enterprise", - "Standard", "Premium". + :ivar category: The category. Known values are: "NotSpecified", "Enterprise", "Standard", + "Premium". :vartype category: str or ~azure.mgmt.logic.models.ApiTier :ivar deployment_parameters: The integration service environment managed api deployment parameters. @@ -5769,8 +5762,8 @@ class IntegrationServiceEnvironmentManagedApiProperties(ApiResourceProperties): def __init__( self, *, - integration_service_environment: Optional["ResourceReference"] = None, - deployment_parameters: Optional["IntegrationServiceEnvironmentManagedApiDeploymentParameters"] = None, + integration_service_environment: Optional["_models.ResourceReference"] = None, + deployment_parameters: Optional["_models.IntegrationServiceEnvironmentManagedApiDeploymentParameters"] = None, **kwargs ): """ @@ -5788,7 +5781,7 @@ def __init__( class IntegrationServiceEnvironmentNetworkDependency(msrest.serialization.Model): """The azure async operation resource. - :ivar category: The network dependency category type. Possible values include: "NotSpecified", + :ivar category: The network dependency category type. Known values are: "NotSpecified", "AzureStorage", "AzureManagement", "AzureActiveDirectory", "SSLCertificateVerification", "DiagnosticLogsAndMetrics", "IntegrationServiceEnvironmentConnectors", "RedisCache", "AccessEndpoints", "RecoveryService", "SQL", "RegionalService". @@ -5809,17 +5802,16 @@ class IntegrationServiceEnvironmentNetworkDependency(msrest.serialization.Model) def __init__( self, *, - category: Optional[Union[str, "IntegrationServiceEnvironmentNetworkDependencyCategoryType"]] = None, + category: Optional[Union[str, "_models.IntegrationServiceEnvironmentNetworkDependencyCategoryType"]] = None, display_name: Optional[str] = None, - endpoints: Optional[List["IntegrationServiceEnvironmentNetworkEndpoint"]] = None, + endpoints: Optional[List["_models.IntegrationServiceEnvironmentNetworkEndpoint"]] = None, **kwargs ): """ - :keyword category: The network dependency category type. Possible values include: - "NotSpecified", "AzureStorage", "AzureManagement", "AzureActiveDirectory", - "SSLCertificateVerification", "DiagnosticLogsAndMetrics", - "IntegrationServiceEnvironmentConnectors", "RedisCache", "AccessEndpoints", "RecoveryService", - "SQL", "RegionalService". + :keyword category: The network dependency category type. Known values are: "NotSpecified", + "AzureStorage", "AzureManagement", "AzureActiveDirectory", "SSLCertificateVerification", + "DiagnosticLogsAndMetrics", "IntegrationServiceEnvironmentConnectors", "RedisCache", + "AccessEndpoints", "RecoveryService", "SQL", "RegionalService". :paramtype category: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyCategoryType :keyword display_name: The display name. @@ -5839,8 +5831,8 @@ class IntegrationServiceEnvironmentNetworkDependencyHealth(msrest.serialization. :ivar error: The error if any occurred during the operation. :vartype error: ~azure.mgmt.logic.models.ExtendedErrorInfo - :ivar state: The network dependency health state. Possible values include: "NotSpecified", - "Healthy", "Unhealthy", "Unknown". + :ivar state: The network dependency health state. Known values are: "NotSpecified", "Healthy", + "Unhealthy", "Unknown". :vartype state: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealthState """ @@ -5853,14 +5845,14 @@ class IntegrationServiceEnvironmentNetworkDependencyHealth(msrest.serialization. def __init__( self, *, - error: Optional["ExtendedErrorInfo"] = None, - state: Optional[Union[str, "IntegrationServiceEnvironmentNetworkDependencyHealthState"]] = None, + error: Optional["_models.ExtendedErrorInfo"] = None, + state: Optional[Union[str, "_models.IntegrationServiceEnvironmentNetworkDependencyHealthState"]] = None, **kwargs ): """ :keyword error: The error if any occurred during the operation. :paramtype error: ~azure.mgmt.logic.models.ExtendedErrorInfo - :keyword state: The network dependency health state. Possible values include: "NotSpecified", + :keyword state: The network dependency health state. Known values are: "NotSpecified", "Healthy", "Unhealthy", "Unknown". :paramtype state: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealthState @@ -5873,8 +5865,8 @@ def __init__( class IntegrationServiceEnvironmentNetworkEndpoint(msrest.serialization.Model): """The network endpoint. - :ivar accessibility: The accessibility state. Possible values include: "NotSpecified", - "Unknown", "Available", "NotAvailable". + :ivar accessibility: The accessibility state. Known values are: "NotSpecified", "Unknown", + "Available", "NotAvailable". :vartype accessibility: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState :ivar domain_name: The domain name. @@ -5892,14 +5884,14 @@ class IntegrationServiceEnvironmentNetworkEndpoint(msrest.serialization.Model): def __init__( self, *, - accessibility: Optional[Union[str, "IntegrationServiceEnvironmentNetworkEndPointAccessibilityState"]] = None, + accessibility: Optional[Union[str, "_models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState"]] = None, domain_name: Optional[str] = None, ports: Optional[List[str]] = None, **kwargs ): """ - :keyword accessibility: The accessibility state. Possible values include: "NotSpecified", - "Unknown", "Available", "NotAvailable". + :keyword accessibility: The accessibility state. Known values are: "NotSpecified", "Unknown", + "Available", "NotAvailable". :paramtype accessibility: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState :keyword domain_name: The domain name. @@ -5916,13 +5908,13 @@ def __init__( class IntegrationServiceEnvironmentProperties(msrest.serialization.Model): """The integration service environment properties. - :ivar provisioning_state: The provisioning state. Possible values include: "NotSpecified", - "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", - "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + :ivar provisioning_state: The provisioning state. Known values are: "NotSpecified", "Accepted", + "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", + "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState - :ivar state: The integration service environment state. Possible values include: - "NotSpecified", "Completed", "Enabled", "Disabled", "Deleted", "Suspended". + :ivar state: The integration service environment state. Known values are: "NotSpecified", + "Completed", "Enabled", "Disabled", "Deleted", "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState :ivar integration_service_environment_id: Gets the tracking id. :vartype integration_service_environment_id: str @@ -5947,22 +5939,22 @@ class IntegrationServiceEnvironmentProperties(msrest.serialization.Model): def __init__( self, *, - provisioning_state: Optional[Union[str, "WorkflowProvisioningState"]] = None, - state: Optional[Union[str, "WorkflowState"]] = None, + provisioning_state: Optional[Union[str, "_models.WorkflowProvisioningState"]] = None, + state: Optional[Union[str, "_models.WorkflowState"]] = None, integration_service_environment_id: Optional[str] = None, - endpoints_configuration: Optional["FlowEndpointsConfiguration"] = None, - network_configuration: Optional["NetworkConfiguration"] = None, - encryption_configuration: Optional["IntegrationServiceEnvironmenEncryptionConfiguration"] = None, + endpoints_configuration: Optional["_models.FlowEndpointsConfiguration"] = None, + network_configuration: Optional["_models.NetworkConfiguration"] = None, + encryption_configuration: Optional["_models.IntegrationServiceEnvironmenEncryptionConfiguration"] = None, **kwargs ): """ - :keyword provisioning_state: The provisioning state. Possible values include: "NotSpecified", + :keyword provisioning_state: The provisioning state. Known values are: "NotSpecified", "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". :paramtype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState - :keyword state: The integration service environment state. Possible values include: - "NotSpecified", "Completed", "Enabled", "Disabled", "Deleted", "Suspended". + :keyword state: The integration service environment state. Known values are: "NotSpecified", + "Completed", "Enabled", "Disabled", "Deleted", "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState :keyword integration_service_environment_id: Gets the tracking id. :paramtype integration_service_environment_id: str @@ -5986,7 +5978,7 @@ def __init__( class IntegrationServiceEnvironmentSku(msrest.serialization.Model): """The integration service environment sku. - :ivar name: The sku name. Possible values include: "NotSpecified", "Premium", "Developer". + :ivar name: The sku name. Known values are: "NotSpecified", "Premium", "Developer". :vartype name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName :ivar capacity: The sku capacity. :vartype capacity: int @@ -6000,12 +5992,12 @@ class IntegrationServiceEnvironmentSku(msrest.serialization.Model): def __init__( self, *, - name: Optional[Union[str, "IntegrationServiceEnvironmentSkuName"]] = None, + name: Optional[Union[str, "_models.IntegrationServiceEnvironmentSkuName"]] = None, capacity: Optional[int] = None, **kwargs ): """ - :keyword name: The sku name. Possible values include: "NotSpecified", "Premium", "Developer". + :keyword name: The sku name. Known values are: "NotSpecified", "Premium", "Developer". :paramtype name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName :keyword capacity: The sku capacity. :paramtype capacity: int @@ -6024,7 +6016,7 @@ class IntegrationServiceEnvironmentSkuCapacity(msrest.serialization.Model): :vartype maximum: int :ivar default: The default capacity. :vartype default: int - :ivar scale_type: The sku scale type. Possible values include: "Manual", "Automatic", "None". + :ivar scale_type: The sku scale type. Known values are: "Manual", "Automatic", "None". :vartype scale_type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuScaleType """ @@ -6041,7 +6033,7 @@ def __init__( minimum: Optional[int] = None, maximum: Optional[int] = None, default: Optional[int] = None, - scale_type: Optional[Union[str, "IntegrationServiceEnvironmentSkuScaleType"]] = None, + scale_type: Optional[Union[str, "_models.IntegrationServiceEnvironmentSkuScaleType"]] = None, **kwargs ): """ @@ -6051,8 +6043,7 @@ def __init__( :paramtype maximum: int :keyword default: The default capacity. :paramtype default: int - :keyword scale_type: The sku scale type. Possible values include: "Manual", "Automatic", - "None". + :keyword scale_type: The sku scale type. Known values are: "Manual", "Automatic", "None". :paramtype scale_type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuScaleType """ @@ -6084,8 +6075,8 @@ def __init__( self, *, resource_type: Optional[str] = None, - sku: Optional["IntegrationServiceEnvironmentSkuDefinitionSku"] = None, - capacity: Optional["IntegrationServiceEnvironmentSkuCapacity"] = None, + sku: Optional["_models.IntegrationServiceEnvironmentSkuDefinitionSku"] = None, + capacity: Optional["_models.IntegrationServiceEnvironmentSkuCapacity"] = None, **kwargs ): """ @@ -6105,7 +6096,7 @@ def __init__( class IntegrationServiceEnvironmentSkuDefinitionSku(msrest.serialization.Model): """The sku. - :ivar name: The sku name. Possible values include: "NotSpecified", "Premium", "Developer". + :ivar name: The sku name. Known values are: "NotSpecified", "Premium", "Developer". :vartype name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName :ivar tier: The sku tier. :vartype tier: str @@ -6119,12 +6110,12 @@ class IntegrationServiceEnvironmentSkuDefinitionSku(msrest.serialization.Model): def __init__( self, *, - name: Optional[Union[str, "IntegrationServiceEnvironmentSkuName"]] = None, + name: Optional[Union[str, "_models.IntegrationServiceEnvironmentSkuName"]] = None, tier: Optional[str] = None, **kwargs ): """ - :keyword name: The sku name. Possible values include: "NotSpecified", "Premium", "Developer". + :keyword name: The sku name. Known values are: "NotSpecified", "Premium", "Developer". :paramtype name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName :keyword tier: The sku tier. :paramtype tier: str @@ -6151,7 +6142,7 @@ class IntegrationServiceEnvironmentSkuList(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["IntegrationServiceEnvironmentSkuDefinition"]] = None, + value: Optional[List["_models.IntegrationServiceEnvironmentSkuDefinition"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -6178,7 +6169,7 @@ class IntegrationServiceEnvironmentSubnetNetworkHealth(msrest.serialization.Mode :vartype outbound_network_health: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealth :ivar network_dependency_health_state: Required. The integration service environment network - health state. Possible values include: "NotSpecified", "Unknown", "Available", "NotAvailable". + health state. Known values are: "NotSpecified", "Unknown", "Available", "NotAvailable". :vartype network_dependency_health_state: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState """ @@ -6196,9 +6187,9 @@ class IntegrationServiceEnvironmentSubnetNetworkHealth(msrest.serialization.Mode def __init__( self, *, - network_dependency_health_state: Union[str, "IntegrationServiceEnvironmentNetworkEndPointAccessibilityState"], - outbound_network_dependencies: Optional[List["IntegrationServiceEnvironmentNetworkDependency"]] = None, - outbound_network_health: Optional["IntegrationServiceEnvironmentNetworkDependencyHealth"] = None, + network_dependency_health_state: Union[str, "_models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState"], + outbound_network_dependencies: Optional[List["_models.IntegrationServiceEnvironmentNetworkDependency"]] = None, + outbound_network_health: Optional["_models.IntegrationServiceEnvironmentNetworkDependencyHealth"] = None, **kwargs ): """ @@ -6209,7 +6200,7 @@ def __init__( :paramtype outbound_network_health: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealth :keyword network_dependency_health_state: Required. The integration service environment network - health state. Possible values include: "NotSpecified", "Unknown", "Available", "NotAvailable". + health state. Known values are: "NotSpecified", "Unknown", "Available", "NotAvailable". :paramtype network_dependency_health_state: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState """ @@ -6319,7 +6310,7 @@ def __init__( self, *, kid: Optional[str] = None, - attributes: Optional["KeyVaultKeyAttributes"] = None, + attributes: Optional["_models.KeyVaultKeyAttributes"] = None, **kwargs ): """ @@ -6389,7 +6380,7 @@ class KeyVaultKeyCollection(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["KeyVaultKey"]] = None, + value: Optional[List["_models.KeyVaultKey"]] = None, skip_token: Optional[str] = None, **kwargs ): @@ -6431,7 +6422,7 @@ class KeyVaultKeyReference(msrest.serialization.Model): def __init__( self, *, - key_vault: "KeyVaultKeyReferenceKeyVault", + key_vault: "_models.KeyVaultKeyReferenceKeyVault", key_name: str, key_version: Optional[str] = None, **kwargs @@ -6550,7 +6541,7 @@ class ListKeyVaultKeysDefinition(msrest.serialization.Model): def __init__( self, *, - key_vault: "KeyVaultReference", + key_vault: "_models.KeyVaultReference", skip_token: Optional[str] = None, **kwargs ): @@ -6604,7 +6595,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - properties: Optional["ApiResourceProperties"] = None, + properties: Optional["_models.ApiResourceProperties"] = None, **kwargs ): """ @@ -6636,7 +6627,7 @@ class ManagedApiListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["ManagedApi"]] = None, + value: Optional[List["_models.ManagedApi"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -6660,7 +6651,7 @@ class ManagedServiceIdentity(msrest.serialization.Model): :ivar type: Required. Type of managed service identity. The type 'SystemAssigned' includes an implicitly created identity. The type 'None' will remove any identities from the resource. - Possible values include: "SystemAssigned", "UserAssigned", "None". + Known values are: "SystemAssigned", "UserAssigned", "None". :vartype type: str or ~azure.mgmt.logic.models.ManagedServiceIdentityType :ivar tenant_id: Tenant of managed service identity. :vartype tenant_id: str @@ -6688,14 +6679,14 @@ class ManagedServiceIdentity(msrest.serialization.Model): def __init__( self, *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, **kwargs ): """ :keyword type: Required. Type of managed service identity. The type 'SystemAssigned' includes an implicitly created identity. The type 'None' will remove any identities from the resource. - Possible values include: "SystemAssigned", "UserAssigned", "None". + Known values are: "SystemAssigned", "UserAssigned", "None". :paramtype type: str or ~azure.mgmt.logic.models.ManagedServiceIdentityType :keyword user_assigned_identities: The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: @@ -6730,8 +6721,8 @@ def __init__( self, *, virtual_network_address_space: Optional[str] = None, - access_endpoint: Optional["IntegrationServiceEnvironmentAccessEndpoint"] = None, - subnets: Optional[List["ResourceReference"]] = None, + access_endpoint: Optional["_models.IntegrationServiceEnvironmentAccessEndpoint"] = None, + subnets: Optional[List["_models.ResourceReference"]] = None, **kwargs ): """ @@ -6763,7 +6754,7 @@ class OpenAuthenticationAccessPolicies(msrest.serialization.Model): def __init__( self, *, - policies: Optional[Dict[str, "OpenAuthenticationAccessPolicy"]] = None, + policies: Optional[Dict[str, "_models.OpenAuthenticationAccessPolicy"]] = None, **kwargs ): """ @@ -6777,7 +6768,7 @@ def __init__( class OpenAuthenticationAccessPolicy(msrest.serialization.Model): """Open authentication access policy defined by user. - :ivar type: Type of provider for OAuth. Possible values include: "AAD". + :ivar type: Type of provider for OAuth. Known values are: "AAD". :vartype type: str or ~azure.mgmt.logic.models.OpenAuthenticationProviderType :ivar claims: The access policy claims. :vartype claims: list[~azure.mgmt.logic.models.OpenAuthenticationPolicyClaim] @@ -6791,12 +6782,12 @@ class OpenAuthenticationAccessPolicy(msrest.serialization.Model): def __init__( self, *, - type: Optional[Union[str, "OpenAuthenticationProviderType"]] = None, - claims: Optional[List["OpenAuthenticationPolicyClaim"]] = None, + type: Optional[Union[str, "_models.OpenAuthenticationProviderType"]] = None, + claims: Optional[List["_models.OpenAuthenticationPolicyClaim"]] = None, **kwargs ): """ - :keyword type: Type of provider for OAuth. Possible values include: "AAD". + :keyword type: Type of provider for OAuth. Known values are: "AAD". :paramtype type: str or ~azure.mgmt.logic.models.OpenAuthenticationProviderType :keyword claims: The access policy claims. :paramtype claims: list[~azure.mgmt.logic.models.OpenAuthenticationPolicyClaim] @@ -6863,7 +6854,7 @@ def __init__( *, origin: Optional[str] = None, name: Optional[str] = None, - display: Optional["OperationDisplay"] = None, + display: Optional["_models.OperationDisplay"] = None, properties: Optional[Any] = None, **kwargs ): @@ -6947,7 +6938,7 @@ class OperationListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["Operation"]] = None, + value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -6971,9 +6962,9 @@ class OperationResultProperties(msrest.serialization.Model): :vartype end_time: ~datetime.datetime :ivar correlation: The correlation properties. :vartype correlation: ~azure.mgmt.logic.models.RunActionCorrelation - :ivar status: The status of the workflow scope repetition. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :ivar status: The status of the workflow scope repetition. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: The workflow scope repetition code. :vartype code: str @@ -6995,8 +6986,8 @@ def __init__( *, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, - correlation: Optional["RunActionCorrelation"] = None, - status: Optional[Union[str, "WorkflowStatus"]] = None, + correlation: Optional["_models.RunActionCorrelation"] = None, + status: Optional[Union[str, "_models.WorkflowStatus"]] = None, code: Optional[str] = None, error: Optional[Any] = None, **kwargs @@ -7008,9 +6999,9 @@ def __init__( :paramtype end_time: ~datetime.datetime :keyword correlation: The correlation properties. :paramtype correlation: ~azure.mgmt.logic.models.RunActionCorrelation - :keyword status: The status of the workflow scope repetition. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :keyword status: The status of the workflow scope repetition. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus :keyword code: The workflow scope repetition code. :paramtype code: str @@ -7037,9 +7028,9 @@ class OperationResult(OperationResultProperties): :vartype end_time: ~datetime.datetime :ivar correlation: The correlation properties. :vartype correlation: ~azure.mgmt.logic.models.RunActionCorrelation - :ivar status: The status of the workflow scope repetition. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :ivar status: The status of the workflow scope repetition. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: The workflow scope repetition code. :vartype code: str @@ -7094,11 +7085,11 @@ def __init__( *, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, - correlation: Optional["RunActionCorrelation"] = None, - status: Optional[Union[str, "WorkflowStatus"]] = None, + correlation: Optional["_models.RunActionCorrelation"] = None, + status: Optional[Union[str, "_models.WorkflowStatus"]] = None, code: Optional[str] = None, error: Optional[Any] = None, - retry_history: Optional[List["RetryHistory"]] = None, + retry_history: Optional[List["_models.RetryHistory"]] = None, iteration_count: Optional[int] = None, **kwargs ): @@ -7109,9 +7100,9 @@ def __init__( :paramtype end_time: ~datetime.datetime :keyword correlation: The correlation properties. :paramtype correlation: ~azure.mgmt.logic.models.RunActionCorrelation - :keyword status: The status of the workflow scope repetition. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :keyword status: The status of the workflow scope repetition. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus :keyword code: The workflow scope repetition code. :paramtype code: str @@ -7147,7 +7138,7 @@ class PartnerContent(msrest.serialization.Model): def __init__( self, *, - b2_b: Optional["B2BPartnerContent"] = None, + b2_b: Optional["_models.B2BPartnerContent"] = None, **kwargs ): """ @@ -7186,9 +7177,9 @@ def __init__( *, minutes: Optional[List[int]] = None, hours: Optional[List[int]] = None, - week_days: Optional[List[Union[str, "DaysOfWeek"]]] = None, + week_days: Optional[List[Union[str, "_models.DaysOfWeek"]]] = None, month_days: Optional[List[int]] = None, - monthly_occurrences: Optional[List["RecurrenceScheduleOccurrence"]] = None, + monthly_occurrences: Optional[List["_models.RecurrenceScheduleOccurrence"]] = None, **kwargs ): """ @@ -7214,8 +7205,8 @@ def __init__( class RecurrenceScheduleOccurrence(msrest.serialization.Model): """The recurrence schedule occurrence. - :ivar day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", "Saturday". + :ivar day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday". :vartype day: str or ~azure.mgmt.logic.models.DayOfWeek :ivar occurrence: The occurrence. :vartype occurrence: int @@ -7229,12 +7220,12 @@ class RecurrenceScheduleOccurrence(msrest.serialization.Model): def __init__( self, *, - day: Optional[Union[str, "DayOfWeek"]] = None, + day: Optional[Union[str, "_models.DayOfWeek"]] = None, occurrence: Optional[int] = None, **kwargs ): """ - :keyword day: The day of the week. Possible values include: "Sunday", "Monday", "Tuesday", + :keyword day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday". :paramtype day: str or ~azure.mgmt.logic.models.DayOfWeek :keyword occurrence: The occurrence. @@ -7248,7 +7239,7 @@ def __init__( class RegenerateActionParameter(msrest.serialization.Model): """The access key regenerate action content. - :ivar key_type: The key type. Possible values include: "NotSpecified", "Primary", "Secondary". + :ivar key_type: The key type. Known values are: "NotSpecified", "Primary", "Secondary". :vartype key_type: str or ~azure.mgmt.logic.models.KeyType """ @@ -7259,12 +7250,11 @@ class RegenerateActionParameter(msrest.serialization.Model): def __init__( self, *, - key_type: Optional[Union[str, "KeyType"]] = None, + key_type: Optional[Union[str, "_models.KeyType"]] = None, **kwargs ): """ - :keyword key_type: The key type. Possible values include: "NotSpecified", "Primary", - "Secondary". + :keyword key_type: The key type. Known values are: "NotSpecified", "Primary", "Secondary". :paramtype key_type: str or ~azure.mgmt.logic.models.KeyType """ super(RegenerateActionParameter, self).__init__(**kwargs) @@ -7387,7 +7377,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - properties: Optional["RequestHistoryProperties"] = None, + properties: Optional["_models.RequestHistoryProperties"] = None, **kwargs ): """ @@ -7419,7 +7409,7 @@ class RequestHistoryListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["RequestHistory"]] = None, + value: Optional[List["_models.RequestHistory"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -7459,8 +7449,8 @@ def __init__( *, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, - request: Optional["Request"] = None, - response: Optional["Response"] = None, + request: Optional["_models.Request"] = None, + response: Optional["_models.Response"] = None, **kwargs ): """ @@ -7502,7 +7492,7 @@ def __init__( *, headers: Optional[Any] = None, status_code: Optional[int] = None, - body_link: Optional["ContentLink"] = None, + body_link: Optional["_models.ContentLink"] = None, **kwargs ): """ @@ -7553,7 +7543,7 @@ def __init__( code: Optional[str] = None, client_request_id: Optional[str] = None, service_request_id: Optional[str] = None, - error: Optional["ErrorResponse"] = None, + error: Optional["_models.ErrorResponse"] = None, **kwargs ): """ @@ -7668,7 +7658,7 @@ class SetTriggerStateActionDefinition(msrest.serialization.Model): def __init__( self, *, - source: "WorkflowTriggerReference", + source: "_models.WorkflowTriggerReference", **kwargs ): """ @@ -7684,8 +7674,8 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar name: Required. The name. Possible values include: "NotSpecified", "Free", "Shared", - "Basic", "Standard", "Premium". + :ivar name: Required. The name. Known values are: "NotSpecified", "Free", "Shared", "Basic", + "Standard", "Premium". :vartype name: str or ~azure.mgmt.logic.models.SkuName :ivar plan: The reference to plan. :vartype plan: ~azure.mgmt.logic.models.ResourceReference @@ -7703,13 +7693,13 @@ class Sku(msrest.serialization.Model): def __init__( self, *, - name: Union[str, "SkuName"], - plan: Optional["ResourceReference"] = None, + name: Union[str, "_models.SkuName"], + plan: Optional["_models.ResourceReference"] = None, **kwargs ): """ - :keyword name: Required. The name. Possible values include: "NotSpecified", "Free", "Shared", - "Basic", "Standard", "Premium". + :keyword name: Required. The name. Known values are: "NotSpecified", "Free", "Shared", "Basic", + "Standard", "Premium". :paramtype name: str or ~azure.mgmt.logic.models.SkuName :keyword plan: The reference to plan. :paramtype plan: ~azure.mgmt.logic.models.ResourceReference @@ -7781,7 +7771,7 @@ def __init__( items_path: Optional[str] = None, item_value_path: Optional[str] = None, item_title_path: Optional[str] = None, - parameters: Optional[Dict[str, "SwaggerCustomDynamicProperties"]] = None, + parameters: Optional[Dict[str, "_models.SwaggerCustomDynamicProperties"]] = None, **kwargs ): """ @@ -7831,7 +7821,7 @@ def __init__( *, operation_id: Optional[str] = None, value_path: Optional[str] = None, - parameters: Optional[Dict[str, "SwaggerCustomDynamicProperties"]] = None, + parameters: Optional[Dict[str, "_models.SwaggerCustomDynamicProperties"]] = None, **kwargs ): """ @@ -7907,9 +7897,9 @@ class SwaggerCustomDynamicTree(msrest.serialization.Model): def __init__( self, *, - settings: Optional["SwaggerCustomDynamicTreeSettings"] = None, - open: Optional["SwaggerCustomDynamicTreeCommand"] = None, - browse: Optional["SwaggerCustomDynamicTreeCommand"] = None, + settings: Optional["_models.SwaggerCustomDynamicTreeSettings"] = None, + open: Optional["_models.SwaggerCustomDynamicTreeCommand"] = None, + browse: Optional["_models.SwaggerCustomDynamicTreeCommand"] = None, **kwargs ): """ @@ -7970,7 +7960,7 @@ def __init__( item_full_title_path: Optional[str] = None, item_is_parent: Optional[str] = None, selectable_filter: Optional[str] = None, - parameters: Optional[Dict[str, "SwaggerCustomDynamicTreeParameter"]] = None, + parameters: Optional[Dict[str, "_models.SwaggerCustomDynamicTreeParameter"]] = None, **kwargs ): """ @@ -8131,8 +8121,8 @@ class SwaggerSchema(msrest.serialization.Model): :ivar ref: The reference. :vartype ref: str - :ivar type: The type. Possible values include: "String", "Number", "Integer", "Boolean", - "Array", "File", "Object", "Null". + :ivar type: The type. Known values are: "String", "Number", "Integer", "Boolean", "Array", + "File", "Object", "Null". :vartype type: str or ~azure.mgmt.logic.models.SwaggerSchemaType :ivar title: The title. :vartype title: str @@ -8200,32 +8190,32 @@ def __init__( self, *, ref: Optional[str] = None, - type: Optional[Union[str, "SwaggerSchemaType"]] = None, + type: Optional[Union[str, "_models.SwaggerSchemaType"]] = None, title: Optional[str] = None, - items: Optional["SwaggerSchema"] = None, - properties: Optional[Dict[str, "SwaggerSchema"]] = None, + items: Optional["_models.SwaggerSchema"] = None, + properties: Optional[Dict[str, "_models.SwaggerSchema"]] = None, additional_properties: Optional[Any] = None, required: Optional[List[str]] = None, max_properties: Optional[int] = None, min_properties: Optional[int] = None, - all_of: Optional[List["SwaggerSchema"]] = None, + all_of: Optional[List["_models.SwaggerSchema"]] = None, discriminator: Optional[str] = None, read_only: Optional[bool] = None, - xml: Optional["SwaggerXml"] = None, - external_docs: Optional["SwaggerExternalDocumentation"] = None, + xml: Optional["_models.SwaggerXml"] = None, + external_docs: Optional["_models.SwaggerExternalDocumentation"] = None, example: Optional[Any] = None, notification_url_extension: Optional[bool] = None, - dynamic_schema_old: Optional["SwaggerCustomDynamicSchema"] = None, - dynamic_schema_new: Optional["SwaggerCustomDynamicProperties"] = None, - dynamic_list_new: Optional["SwaggerCustomDynamicList"] = None, - dynamic_tree: Optional["SwaggerCustomDynamicTree"] = None, + dynamic_schema_old: Optional["_models.SwaggerCustomDynamicSchema"] = None, + dynamic_schema_new: Optional["_models.SwaggerCustomDynamicProperties"] = None, + dynamic_list_new: Optional["_models.SwaggerCustomDynamicList"] = None, + dynamic_tree: Optional["_models.SwaggerCustomDynamicTree"] = None, **kwargs ): """ :keyword ref: The reference. :paramtype ref: str - :keyword type: The type. Possible values include: "String", "Number", "Integer", "Boolean", - "Array", "File", "Object", "Null". + :keyword type: The type. Known values are: "String", "Number", "Integer", "Boolean", "Array", + "File", "Object", "Null". :paramtype type: str or ~azure.mgmt.logic.models.SwaggerSchemaType :keyword title: The title. :paramtype title: str @@ -8354,13 +8344,13 @@ class TrackingEvent(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar event_level: Required. The event level. Possible values include: "LogAlways", "Critical", + :ivar event_level: Required. The event level. Known values are: "LogAlways", "Critical", "Error", "Warning", "Informational", "Verbose". :vartype event_level: str or ~azure.mgmt.logic.models.EventLevel :ivar event_time: Required. The event time. :vartype event_time: ~datetime.datetime - :ivar record_type: Required. The record type. Possible values include: "NotSpecified", - "Custom", "AS2Message", "AS2MDN", "X12Interchange", "X12FunctionalGroup", "X12TransactionSet", + :ivar record_type: Required. The record type. Known values are: "NotSpecified", "Custom", + "AS2Message", "AS2MDN", "X12Interchange", "X12FunctionalGroup", "X12TransactionSet", "X12InterchangeAcknowledgment", "X12FunctionalGroupAcknowledgment", "X12TransactionSetAcknowledgment", "EdifactInterchange", "EdifactFunctionalGroup", "EdifactTransactionSet", "EdifactInterchangeAcknowledgment", @@ -8389,21 +8379,21 @@ class TrackingEvent(msrest.serialization.Model): def __init__( self, *, - event_level: Union[str, "EventLevel"], + event_level: Union[str, "_models.EventLevel"], event_time: datetime.datetime, - record_type: Union[str, "TrackingRecordType"], + record_type: Union[str, "_models.TrackingRecordType"], record: Optional[Any] = None, - error: Optional["TrackingEventErrorInfo"] = None, + error: Optional["_models.TrackingEventErrorInfo"] = None, **kwargs ): """ - :keyword event_level: Required. The event level. Possible values include: "LogAlways", - "Critical", "Error", "Warning", "Informational", "Verbose". + :keyword event_level: Required. The event level. Known values are: "LogAlways", "Critical", + "Error", "Warning", "Informational", "Verbose". :paramtype event_level: str or ~azure.mgmt.logic.models.EventLevel :keyword event_time: Required. The event time. :paramtype event_time: ~datetime.datetime - :keyword record_type: Required. The record type. Possible values include: "NotSpecified", - "Custom", "AS2Message", "AS2MDN", "X12Interchange", "X12FunctionalGroup", "X12TransactionSet", + :keyword record_type: Required. The record type. Known values are: "NotSpecified", "Custom", + "AS2Message", "AS2MDN", "X12Interchange", "X12FunctionalGroup", "X12TransactionSet", "X12InterchangeAcknowledgment", "X12FunctionalGroupAcknowledgment", "X12TransactionSetAcknowledgment", "EdifactInterchange", "EdifactFunctionalGroup", "EdifactTransactionSet", "EdifactInterchangeAcknowledgment", @@ -8461,7 +8451,7 @@ class TrackingEventsDefinition(msrest.serialization.Model): :ivar source_type: Required. The source type. :vartype source_type: str - :ivar track_events_options: The track events options. Possible values include: "None", + :ivar track_events_options: The track events options. Known values are: "None", "DisableSourceInfoEnrich". :vartype track_events_options: str or ~azure.mgmt.logic.models.TrackEventsOperationOptions :ivar events: Required. The events. @@ -8483,14 +8473,14 @@ def __init__( self, *, source_type: str, - events: List["TrackingEvent"], - track_events_options: Optional[Union[str, "TrackEventsOperationOptions"]] = None, + events: List["_models.TrackingEvent"], + track_events_options: Optional[Union[str, "_models.TrackEventsOperationOptions"]] = None, **kwargs ): """ :keyword source_type: Required. The source type. :paramtype source_type: str - :keyword track_events_options: The track events options. Possible values include: "None", + :keyword track_events_options: The track events options. Known values are: "None", "DisableSourceInfoEnrich". :paramtype track_events_options: str or ~azure.mgmt.logic.models.TrackEventsOperationOptions :keyword events: Required. The events. @@ -8551,7 +8541,7 @@ class Workflow(Resource): :vartype tags: dict[str, str] :ivar identity: Managed service identity properties. :vartype identity: ~azure.mgmt.logic.models.ManagedServiceIdentity - :ivar provisioning_state: Gets the provisioning state. Possible values include: "NotSpecified", + :ivar provisioning_state: Gets the provisioning state. Known values are: "NotSpecified", "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". @@ -8560,8 +8550,8 @@ class Workflow(Resource): :vartype created_time: ~datetime.datetime :ivar changed_time: Gets the changed time. :vartype changed_time: ~datetime.datetime - :ivar state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", - "Disabled", "Deleted", "Suspended". + :ivar state: The state. Known values are: "NotSpecified", "Completed", "Enabled", "Disabled", + "Deleted", "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState :ivar version: Gets the version. :vartype version: str @@ -8622,14 +8612,14 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - state: Optional[Union[str, "WorkflowState"]] = None, - endpoints_configuration: Optional["FlowEndpointsConfiguration"] = None, - access_control: Optional["FlowAccessControlConfiguration"] = None, - integration_account: Optional["ResourceReference"] = None, - integration_service_environment: Optional["ResourceReference"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + state: Optional[Union[str, "_models.WorkflowState"]] = None, + endpoints_configuration: Optional["_models.FlowEndpointsConfiguration"] = None, + access_control: Optional["_models.FlowAccessControlConfiguration"] = None, + integration_account: Optional["_models.ResourceReference"] = None, + integration_service_environment: Optional["_models.ResourceReference"] = None, definition: Optional[Any] = None, - parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + parameters: Optional[Dict[str, "_models.WorkflowParameter"]] = None, **kwargs ): """ @@ -8639,7 +8629,7 @@ def __init__( :paramtype tags: dict[str, str] :keyword identity: Managed service identity properties. :paramtype identity: ~azure.mgmt.logic.models.ManagedServiceIdentity - :keyword state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", + :keyword state: The state. Known values are: "NotSpecified", "Completed", "Enabled", "Disabled", "Deleted", "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState :keyword endpoints_configuration: The endpoints configuration. @@ -8675,8 +8665,8 @@ def __init__( class WorkflowFilter(msrest.serialization.Model): """The workflow filter. - :ivar state: The state of workflows. Possible values include: "NotSpecified", "Completed", - "Enabled", "Disabled", "Deleted", "Suspended". + :ivar state: The state of workflows. Known values are: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState """ @@ -8687,11 +8677,11 @@ class WorkflowFilter(msrest.serialization.Model): def __init__( self, *, - state: Optional[Union[str, "WorkflowState"]] = None, + state: Optional[Union[str, "_models.WorkflowState"]] = None, **kwargs ): """ - :keyword state: The state of workflows. Possible values include: "NotSpecified", "Completed", + :keyword state: The state of workflows. Known values are: "NotSpecified", "Completed", "Enabled", "Disabled", "Deleted", "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState """ @@ -8716,7 +8706,7 @@ class WorkflowListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["Workflow"]] = None, + value: Optional[List["_models.Workflow"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -8734,7 +8724,7 @@ def __init__( class WorkflowParameter(msrest.serialization.Model): """The workflow parameters. - :ivar type: The type. Possible values include: "NotSpecified", "String", "SecureString", "Int", + :ivar type: The type. Known values are: "NotSpecified", "String", "SecureString", "Int", "Float", "Bool", "Array", "Object", "SecureObject". :vartype type: str or ~azure.mgmt.logic.models.ParameterType :ivar value: The value. @@ -8755,15 +8745,15 @@ class WorkflowParameter(msrest.serialization.Model): def __init__( self, *, - type: Optional[Union[str, "ParameterType"]] = None, + type: Optional[Union[str, "_models.ParameterType"]] = None, value: Optional[Any] = None, metadata: Optional[Any] = None, description: Optional[str] = None, **kwargs ): """ - :keyword type: The type. Possible values include: "NotSpecified", "String", "SecureString", - "Int", "Float", "Bool", "Array", "Object", "SecureObject". + :keyword type: The type. Known values are: "NotSpecified", "String", "SecureString", "Int", + "Float", "Bool", "Array", "Object", "SecureObject". :paramtype type: str or ~azure.mgmt.logic.models.ParameterType :keyword value: The value. :paramtype value: any @@ -8784,7 +8774,7 @@ class WorkflowOutputParameter(WorkflowParameter): Variables are only populated by the server, and will be ignored when sending a request. - :ivar type: The type. Possible values include: "NotSpecified", "String", "SecureString", "Int", + :ivar type: The type. Known values are: "NotSpecified", "String", "SecureString", "Int", "Float", "Bool", "Array", "Object", "SecureObject". :vartype type: str or ~azure.mgmt.logic.models.ParameterType :ivar value: The value. @@ -8812,15 +8802,15 @@ class WorkflowOutputParameter(WorkflowParameter): def __init__( self, *, - type: Optional[Union[str, "ParameterType"]] = None, + type: Optional[Union[str, "_models.ParameterType"]] = None, value: Optional[Any] = None, metadata: Optional[Any] = None, description: Optional[str] = None, **kwargs ): """ - :keyword type: The type. Possible values include: "NotSpecified", "String", "SecureString", - "Int", "Float", "Bool", "Array", "Object", "SecureObject". + :keyword type: The type. Known values are: "NotSpecified", "String", "SecureString", "Int", + "Float", "Bool", "Array", "Object", "SecureObject". :paramtype type: str or ~azure.mgmt.logic.models.ParameterType :keyword value: The value. :paramtype value: any @@ -8887,7 +8877,7 @@ class WorkflowRun(SubResource): :vartype start_time: ~datetime.datetime :ivar end_time: Gets the end time. :vartype end_time: ~datetime.datetime - :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + :ivar status: Gets the status. Known values are: "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus @@ -8947,7 +8937,7 @@ class WorkflowRun(SubResource): def __init__( self, *, - correlation: Optional["Correlation"] = None, + correlation: Optional["_models.Correlation"] = None, **kwargs ): """ @@ -8986,7 +8976,7 @@ class WorkflowRunAction(SubResource): :vartype start_time: ~datetime.datetime :ivar end_time: Gets the end time. :vartype end_time: ~datetime.datetime - :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + :ivar status: Gets the status. Known values are: "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus @@ -9043,8 +9033,8 @@ class WorkflowRunAction(SubResource): def __init__( self, *, - correlation: Optional["RunActionCorrelation"] = None, - retry_history: Optional[List["RetryHistory"]] = None, + correlation: Optional["_models.RunActionCorrelation"] = None, + retry_history: Optional[List["_models.RetryHistory"]] = None, **kwargs ): """ @@ -9072,9 +9062,9 @@ def __init__( class WorkflowRunActionFilter(msrest.serialization.Model): """The workflow run action filter. - :ivar status: The status of workflow run action. Possible values include: "NotSpecified", - "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", - "Faulted", "TimedOut", "Aborted", "Ignored". + :ivar status: The status of workflow run action. Known values are: "NotSpecified", "Paused", + "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", + "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ @@ -9085,13 +9075,13 @@ class WorkflowRunActionFilter(msrest.serialization.Model): def __init__( self, *, - status: Optional[Union[str, "WorkflowStatus"]] = None, + status: Optional[Union[str, "_models.WorkflowStatus"]] = None, **kwargs ): """ - :keyword status: The status of workflow run action. Possible values include: "NotSpecified", - "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", - "Faulted", "TimedOut", "Aborted", "Ignored". + :keyword status: The status of workflow run action. Known values are: "NotSpecified", "Paused", + "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", + "TimedOut", "Aborted", "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ super(WorkflowRunActionFilter, self).__init__(**kwargs) @@ -9115,7 +9105,7 @@ class WorkflowRunActionListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["WorkflowRunAction"]] = None, + value: Optional[List["_models.WorkflowRunAction"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -9151,9 +9141,9 @@ class WorkflowRunActionRepetitionDefinition(Resource): :vartype end_time: ~datetime.datetime :ivar correlation: The correlation properties. :vartype correlation: ~azure.mgmt.logic.models.RunActionCorrelation - :ivar status: The status of the workflow scope repetition. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :ivar status: The status of the workflow scope repetition. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: The workflow scope repetition code. :vartype code: str @@ -9221,13 +9211,13 @@ def __init__( tags: Optional[Dict[str, str]] = None, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, - correlation: Optional["RunActionCorrelation"] = None, - status: Optional[Union[str, "WorkflowStatus"]] = None, + correlation: Optional["_models.RunActionCorrelation"] = None, + status: Optional[Union[str, "_models.WorkflowStatus"]] = None, code: Optional[str] = None, error: Optional[Any] = None, - retry_history: Optional[List["RetryHistory"]] = None, + retry_history: Optional[List["_models.RetryHistory"]] = None, iteration_count: Optional[int] = None, - repetition_indexes: Optional[List["RepetitionIndex"]] = None, + repetition_indexes: Optional[List["_models.RepetitionIndex"]] = None, **kwargs ): """ @@ -9241,9 +9231,9 @@ def __init__( :paramtype end_time: ~datetime.datetime :keyword correlation: The correlation properties. :paramtype correlation: ~azure.mgmt.logic.models.RunActionCorrelation - :keyword status: The status of the workflow scope repetition. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :keyword status: The status of the workflow scope repetition. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus :keyword code: The workflow scope repetition code. :paramtype code: str @@ -9292,7 +9282,7 @@ def __init__( self, *, next_link: Optional[str] = None, - value: Optional[List["WorkflowRunActionRepetitionDefinition"]] = None, + value: Optional[List["_models.WorkflowRunActionRepetitionDefinition"]] = None, **kwargs ): """ @@ -9317,9 +9307,9 @@ class WorkflowRunActionRepetitionProperties(OperationResult): :vartype end_time: ~datetime.datetime :ivar correlation: The correlation properties. :vartype correlation: ~azure.mgmt.logic.models.RunActionCorrelation - :ivar status: The status of the workflow scope repetition. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :ivar status: The status of the workflow scope repetition. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: The workflow scope repetition code. :vartype code: str @@ -9377,13 +9367,13 @@ def __init__( *, start_time: Optional[datetime.datetime] = None, end_time: Optional[datetime.datetime] = None, - correlation: Optional["RunActionCorrelation"] = None, - status: Optional[Union[str, "WorkflowStatus"]] = None, + correlation: Optional["_models.RunActionCorrelation"] = None, + status: Optional[Union[str, "_models.WorkflowStatus"]] = None, code: Optional[str] = None, error: Optional[Any] = None, - retry_history: Optional[List["RetryHistory"]] = None, + retry_history: Optional[List["_models.RetryHistory"]] = None, iteration_count: Optional[int] = None, - repetition_indexes: Optional[List["RepetitionIndex"]] = None, + repetition_indexes: Optional[List["_models.RepetitionIndex"]] = None, **kwargs ): """ @@ -9393,9 +9383,9 @@ def __init__( :paramtype end_time: ~datetime.datetime :keyword correlation: The correlation properties. :paramtype correlation: ~azure.mgmt.logic.models.RunActionCorrelation - :keyword status: The status of the workflow scope repetition. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :keyword status: The status of the workflow scope repetition. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus :keyword code: The workflow scope repetition code. :paramtype code: str @@ -9415,7 +9405,7 @@ def __init__( class WorkflowRunFilter(msrest.serialization.Model): """The workflow run filter. - :ivar status: The status of workflow run. Possible values include: "NotSpecified", "Paused", + :ivar status: The status of workflow run. Known values are: "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus @@ -9428,11 +9418,11 @@ class WorkflowRunFilter(msrest.serialization.Model): def __init__( self, *, - status: Optional[Union[str, "WorkflowStatus"]] = None, + status: Optional[Union[str, "_models.WorkflowStatus"]] = None, **kwargs ): """ - :keyword status: The status of workflow run. Possible values include: "NotSpecified", "Paused", + :keyword status: The status of workflow run. Known values are: "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus @@ -9458,7 +9448,7 @@ class WorkflowRunListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["WorkflowRun"]] = None, + value: Optional[List["_models.WorkflowRun"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -9500,7 +9490,7 @@ class WorkflowRunTrigger(msrest.serialization.Model): :vartype correlation: ~azure.mgmt.logic.models.Correlation :ivar code: Gets the code. :vartype code: str - :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + :ivar status: Gets the status. Known values are: "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus @@ -9546,7 +9536,7 @@ class WorkflowRunTrigger(msrest.serialization.Model): def __init__( self, *, - correlation: Optional["Correlation"] = None, + correlation: Optional["_models.Correlation"] = None, **kwargs ): """ @@ -9581,7 +9571,7 @@ class WorkflowTrigger(SubResource): :vartype name: str :ivar type: Gets the workflow trigger type. :vartype type: str - :ivar provisioning_state: Gets the provisioning state. Possible values include: "NotSpecified", + :ivar provisioning_state: Gets the provisioning state. Known values are: "NotSpecified", "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed". @@ -9590,10 +9580,10 @@ class WorkflowTrigger(SubResource): :vartype created_time: ~datetime.datetime :ivar changed_time: Gets the changed time. :vartype changed_time: ~datetime.datetime - :ivar state: Gets the state. Possible values include: "NotSpecified", "Completed", "Enabled", + :ivar state: Gets the state. Known values are: "NotSpecified", "Completed", "Enabled", "Disabled", "Deleted", "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState - :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + :ivar status: Gets the status. Known values are: "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus @@ -9697,7 +9687,7 @@ def __init__( self, *, relative_path_parameters: Optional[List[str]] = None, - queries: Optional["WorkflowTriggerListCallbackUrlQueries"] = None, + queries: Optional["_models.WorkflowTriggerListCallbackUrlQueries"] = None, **kwargs ): """ @@ -9719,8 +9709,8 @@ def __init__( class WorkflowTriggerFilter(msrest.serialization.Model): """The workflow trigger filter. - :ivar state: The state of workflow trigger. Possible values include: "NotSpecified", - "Completed", "Enabled", "Disabled", "Deleted", "Suspended". + :ivar state: The state of workflow trigger. Known values are: "NotSpecified", "Completed", + "Enabled", "Disabled", "Deleted", "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState """ @@ -9731,12 +9721,12 @@ class WorkflowTriggerFilter(msrest.serialization.Model): def __init__( self, *, - state: Optional[Union[str, "WorkflowState"]] = None, + state: Optional[Union[str, "_models.WorkflowState"]] = None, **kwargs ): """ - :keyword state: The state of workflow trigger. Possible values include: "NotSpecified", - "Completed", "Enabled", "Disabled", "Deleted", "Suspended". + :keyword state: The state of workflow trigger. Known values are: "NotSpecified", "Completed", + "Enabled", "Disabled", "Deleted", "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState """ super(WorkflowTriggerFilter, self).__init__(**kwargs) @@ -9760,7 +9750,7 @@ class WorkflowTriggerHistory(SubResource): :vartype end_time: ~datetime.datetime :ivar scheduled_time: The scheduled time. :vartype scheduled_time: ~datetime.datetime - :ivar status: Gets the status. Possible values include: "NotSpecified", "Paused", "Running", + :ivar status: Gets the status. Known values are: "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus @@ -9820,7 +9810,7 @@ class WorkflowTriggerHistory(SubResource): def __init__( self, *, - correlation: Optional["Correlation"] = None, + correlation: Optional["_models.Correlation"] = None, **kwargs ): """ @@ -9847,7 +9837,7 @@ def __init__( class WorkflowTriggerHistoryFilter(msrest.serialization.Model): """The workflow trigger history filter. - :ivar status: The status of workflow trigger history. Possible values include: "NotSpecified", + :ivar status: The status of workflow trigger history. Known values are: "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus @@ -9860,13 +9850,13 @@ class WorkflowTriggerHistoryFilter(msrest.serialization.Model): def __init__( self, *, - status: Optional[Union[str, "WorkflowStatus"]] = None, + status: Optional[Union[str, "_models.WorkflowStatus"]] = None, **kwargs ): """ - :keyword status: The status of workflow trigger history. Possible values include: - "NotSpecified", "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", - "Cancelled", "Failed", "Faulted", "TimedOut", "Aborted", "Ignored". + :keyword status: The status of workflow trigger history. Known values are: "NotSpecified", + "Paused", "Running", "Waiting", "Succeeded", "Skipped", "Suspended", "Cancelled", "Failed", + "Faulted", "TimedOut", "Aborted", "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ super(WorkflowTriggerHistoryFilter, self).__init__(**kwargs) @@ -9890,7 +9880,7 @@ class WorkflowTriggerHistoryListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["WorkflowTriggerHistory"]] = None, + value: Optional[List["_models.WorkflowTriggerHistory"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -9975,7 +9965,7 @@ class WorkflowTriggerListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["WorkflowTrigger"]] = None, + value: Optional[List["_models.WorkflowTrigger"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -9993,8 +9983,8 @@ def __init__( class WorkflowTriggerRecurrence(msrest.serialization.Model): """The workflow trigger recurrence. - :ivar frequency: The frequency. Possible values include: "NotSpecified", "Second", "Minute", - "Hour", "Day", "Week", "Month", "Year". + :ivar frequency: The frequency. Known values are: "NotSpecified", "Second", "Minute", "Hour", + "Day", "Week", "Month", "Year". :vartype frequency: str or ~azure.mgmt.logic.models.RecurrenceFrequency :ivar interval: The interval. :vartype interval: int @@ -10020,16 +10010,16 @@ class WorkflowTriggerRecurrence(msrest.serialization.Model): def __init__( self, *, - frequency: Optional[Union[str, "RecurrenceFrequency"]] = None, + frequency: Optional[Union[str, "_models.RecurrenceFrequency"]] = None, interval: Optional[int] = None, start_time: Optional[str] = None, end_time: Optional[str] = None, time_zone: Optional[str] = None, - schedule: Optional["RecurrenceSchedule"] = None, + schedule: Optional["_models.RecurrenceSchedule"] = None, **kwargs ): """ - :keyword frequency: The frequency. Possible values include: "NotSpecified", "Second", "Minute", + :keyword frequency: The frequency. Known values are: "NotSpecified", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year". :paramtype frequency: str or ~azure.mgmt.logic.models.RecurrenceFrequency :keyword interval: The interval. @@ -10118,17 +10108,17 @@ class WorkflowVersion(Resource): :vartype location: str :ivar tags: A set of tags. The resource tags. :vartype tags: dict[str, str] - :ivar provisioning_state: The provisioning state. Possible values include: "NotSpecified", - "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", - "Failed", "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", + :ivar provisioning_state: The provisioning state. Known values are: "NotSpecified", "Accepted", + "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", + "Succeeded", "Moving", "Updating", "Registering", "Registered", "Unregistering", "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState :ivar created_time: Gets the created time. :vartype created_time: ~datetime.datetime :ivar changed_time: Gets the changed time. :vartype changed_time: ~datetime.datetime - :ivar state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", - "Disabled", "Deleted", "Suspended". + :ivar state: The state. Known values are: "NotSpecified", "Completed", "Enabled", "Disabled", + "Deleted", "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState :ivar version: Gets the version. :vartype version: str @@ -10185,12 +10175,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - state: Optional[Union[str, "WorkflowState"]] = None, - endpoints_configuration: Optional["FlowEndpointsConfiguration"] = None, - access_control: Optional["FlowAccessControlConfiguration"] = None, - integration_account: Optional["ResourceReference"] = None, + state: Optional[Union[str, "_models.WorkflowState"]] = None, + endpoints_configuration: Optional["_models.FlowEndpointsConfiguration"] = None, + access_control: Optional["_models.FlowAccessControlConfiguration"] = None, + integration_account: Optional["_models.ResourceReference"] = None, definition: Optional[Any] = None, - parameters: Optional[Dict[str, "WorkflowParameter"]] = None, + parameters: Optional[Dict[str, "_models.WorkflowParameter"]] = None, **kwargs ): """ @@ -10198,7 +10188,7 @@ def __init__( :paramtype location: str :keyword tags: A set of tags. The resource tags. :paramtype tags: dict[str, str] - :keyword state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", + :keyword state: The state. Known values are: "NotSpecified", "Completed", "Enabled", "Disabled", "Deleted", "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState :keyword endpoints_configuration: The endpoints configuration. @@ -10244,7 +10234,7 @@ class WorkflowVersionListResult(msrest.serialization.Model): def __init__( self, *, - value: Optional[List["WorkflowVersion"]] = None, + value: Optional[List["_models.WorkflowVersion"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -10476,8 +10466,8 @@ class X12AgreementContent(msrest.serialization.Model): def __init__( self, *, - receive_agreement: "X12OneWayAgreement", - send_agreement: "X12OneWayAgreement", + receive_agreement: "_models.X12OneWayAgreement", + send_agreement: "_models.X12OneWayAgreement", **kwargs ): """ @@ -10506,8 +10496,8 @@ class X12DelimiterOverrides(msrest.serialization.Model): :vartype component_separator: int :ivar segment_terminator: Required. The segment terminator. :vartype segment_terminator: int - :ivar segment_terminator_suffix: Required. The segment terminator suffix. Possible values - include: "NotSpecified", "None", "CR", "LF", "CRLF". + :ivar segment_terminator_suffix: Required. The segment terminator suffix. Known values are: + "NotSpecified", "None", "CR", "LF", "CRLF". :vartype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix :ivar replace_character: Required. The replacement character. :vartype replace_character: int @@ -10546,7 +10536,7 @@ def __init__( data_element_separator: int, component_separator: int, segment_terminator: int, - segment_terminator_suffix: Union[str, "SegmentTerminatorSuffix"], + segment_terminator_suffix: Union[str, "_models.SegmentTerminatorSuffix"], replace_character: int, replace_separators_in_payload: bool, protocol_version: Optional[str] = None, @@ -10565,8 +10555,8 @@ def __init__( :paramtype component_separator: int :keyword segment_terminator: Required. The segment terminator. :paramtype segment_terminator: int - :keyword segment_terminator_suffix: Required. The segment terminator suffix. Possible values - include: "NotSpecified", "None", "CR", "LF", "CRLF". + :keyword segment_terminator_suffix: Required. The segment terminator suffix. Known values are: + "NotSpecified", "None", "CR", "LF", "CRLF". :paramtype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix :keyword replace_character: Required. The replacement character. :paramtype replace_character: int @@ -10612,10 +10602,10 @@ class X12EnvelopeOverride(msrest.serialization.Model): :vartype receiver_application_id: str :ivar functional_identifier_code: The functional identifier code. :vartype functional_identifier_code: str - :ivar date_format: Required. The date format. Possible values include: "NotSpecified", - "CCYYMMDD", "YYMMDD". + :ivar date_format: Required. The date format. Known values are: "NotSpecified", "CCYYMMDD", + "YYMMDD". :vartype date_format: str or ~azure.mgmt.logic.models.X12DateFormat - :ivar time_format: Required. The time format. Possible values include: "NotSpecified", "HHMM", + :ivar time_format: Required. The time format. Known values are: "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", "HHMMSSd". :vartype time_format: str or ~azure.mgmt.logic.models.X12TimeFormat """ @@ -10655,8 +10645,8 @@ def __init__( header_version: str, sender_application_id: str, receiver_application_id: str, - date_format: Union[str, "X12DateFormat"], - time_format: Union[str, "X12TimeFormat"], + date_format: Union[str, "_models.X12DateFormat"], + time_format: Union[str, "_models.X12TimeFormat"], functional_identifier_code: Optional[str] = None, **kwargs ): @@ -10680,11 +10670,11 @@ def __init__( :paramtype receiver_application_id: str :keyword functional_identifier_code: The functional identifier code. :paramtype functional_identifier_code: str - :keyword date_format: Required. The date format. Possible values include: "NotSpecified", - "CCYYMMDD", "YYMMDD". + :keyword date_format: Required. The date format. Known values are: "NotSpecified", "CCYYMMDD", + "YYMMDD". :paramtype date_format: str or ~azure.mgmt.logic.models.X12DateFormat - :keyword time_format: Required. The time format. Possible values include: "NotSpecified", - "HHMM", "HHMMSS", "HHMMSSdd", "HHMMSSd". + :keyword time_format: Required. The time format. Known values are: "NotSpecified", "HHMM", + "HHMMSS", "HHMMSSdd", "HHMMSSd". :paramtype time_format: str or ~azure.mgmt.logic.models.X12TimeFormat """ super(X12EnvelopeOverride, self).__init__(**kwargs) @@ -10757,14 +10747,14 @@ class X12EnvelopeSettings(msrest.serialization.Model): :ivar overwrite_existing_transaction_set_control_number: Required. The value indicating whether to overwrite existing transaction set control number. :vartype overwrite_existing_transaction_set_control_number: bool - :ivar group_header_date_format: Required. The group header date format. Possible values - include: "NotSpecified", "CCYYMMDD", "YYMMDD". + :ivar group_header_date_format: Required. The group header date format. Known values are: + "NotSpecified", "CCYYMMDD", "YYMMDD". :vartype group_header_date_format: str or ~azure.mgmt.logic.models.X12DateFormat - :ivar group_header_time_format: Required. The group header time format. Possible values - include: "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", "HHMMSSd". + :ivar group_header_time_format: Required. The group header time format. Known values are: + "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", "HHMMSSd". :vartype group_header_time_format: str or ~azure.mgmt.logic.models.X12TimeFormat - :ivar usage_indicator: Required. The usage indicator. Possible values include: "NotSpecified", - "Test", "Information", "Production". + :ivar usage_indicator: Required. The usage indicator. Known values are: "NotSpecified", "Test", + "Information", "Production". :vartype usage_indicator: str or ~azure.mgmt.logic.models.UsageIndicator """ @@ -10840,9 +10830,9 @@ def __init__( transaction_set_control_number_upper_bound: int, rollover_transaction_set_control_number: bool, overwrite_existing_transaction_set_control_number: bool, - group_header_date_format: Union[str, "X12DateFormat"], - group_header_time_format: Union[str, "X12TimeFormat"], - usage_indicator: Union[str, "UsageIndicator"], + group_header_date_format: Union[str, "_models.X12DateFormat"], + group_header_time_format: Union[str, "_models.X12TimeFormat"], + usage_indicator: Union[str, "_models.UsageIndicator"], functional_group_id: Optional[str] = None, transaction_set_control_number_prefix: Optional[str] = None, transaction_set_control_number_suffix: Optional[str] = None, @@ -10901,14 +10891,14 @@ def __init__( :keyword overwrite_existing_transaction_set_control_number: Required. The value indicating whether to overwrite existing transaction set control number. :paramtype overwrite_existing_transaction_set_control_number: bool - :keyword group_header_date_format: Required. The group header date format. Possible values - include: "NotSpecified", "CCYYMMDD", "YYMMDD". + :keyword group_header_date_format: Required. The group header date format. Known values are: + "NotSpecified", "CCYYMMDD", "YYMMDD". :paramtype group_header_date_format: str or ~azure.mgmt.logic.models.X12DateFormat - :keyword group_header_time_format: Required. The group header time format. Possible values - include: "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", "HHMMSSd". + :keyword group_header_time_format: Required. The group header time format. Known values are: + "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", "HHMMSSd". :paramtype group_header_time_format: str or ~azure.mgmt.logic.models.X12TimeFormat - :keyword usage_indicator: Required. The usage indicator. Possible values include: - "NotSpecified", "Test", "Information", "Production". + :keyword usage_indicator: Required. The usage indicator. Known values are: "NotSpecified", + "Test", "Information", "Production". :paramtype usage_indicator: str or ~azure.mgmt.logic.models.UsageIndicator """ super(X12EnvelopeSettings, self).__init__(**kwargs) @@ -10954,11 +10944,11 @@ class X12FramingSettings(msrest.serialization.Model): :vartype replace_character: int :ivar segment_terminator: Required. The segment terminator. :vartype segment_terminator: int - :ivar character_set: Required. The X12 character set. Possible values include: "NotSpecified", + :ivar character_set: Required. The X12 character set. Known values are: "NotSpecified", "Basic", "Extended", "UTF8". :vartype character_set: str or ~azure.mgmt.logic.models.X12CharacterSet - :ivar segment_terminator_suffix: Required. The segment terminator suffix. Possible values - include: "NotSpecified", "None", "CR", "LF", "CRLF". + :ivar segment_terminator_suffix: Required. The segment terminator suffix. Known values are: + "NotSpecified", "None", "CR", "LF", "CRLF". :vartype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix """ @@ -10990,8 +10980,8 @@ def __init__( replace_separators_in_payload: bool, replace_character: int, segment_terminator: int, - character_set: Union[str, "X12CharacterSet"], - segment_terminator_suffix: Union[str, "SegmentTerminatorSuffix"], + character_set: Union[str, "_models.X12CharacterSet"], + segment_terminator_suffix: Union[str, "_models.SegmentTerminatorSuffix"], **kwargs ): """ @@ -11006,11 +10996,11 @@ def __init__( :paramtype replace_character: int :keyword segment_terminator: Required. The segment terminator. :paramtype segment_terminator: int - :keyword character_set: Required. The X12 character set. Possible values include: - "NotSpecified", "Basic", "Extended", "UTF8". + :keyword character_set: Required. The X12 character set. Known values are: "NotSpecified", + "Basic", "Extended", "UTF8". :paramtype character_set: str or ~azure.mgmt.logic.models.X12CharacterSet - :keyword segment_terminator_suffix: Required. The segment terminator suffix. Possible values - include: "NotSpecified", "None", "CR", "LF", "CRLF". + :keyword segment_terminator_suffix: Required. The segment terminator suffix. Known values are: + "NotSpecified", "None", "CR", "LF", "CRLF". :paramtype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix """ super(X12FramingSettings, self).__init__(**kwargs) @@ -11028,8 +11018,8 @@ class X12MessageFilter(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :ivar message_filter_type: Required. The message filter type. Possible values include: - "NotSpecified", "Include", "Exclude". + :ivar message_filter_type: Required. The message filter type. Known values are: "NotSpecified", + "Include", "Exclude". :vartype message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType """ @@ -11044,11 +11034,11 @@ class X12MessageFilter(msrest.serialization.Model): def __init__( self, *, - message_filter_type: Union[str, "MessageFilterType"], + message_filter_type: Union[str, "_models.MessageFilterType"], **kwargs ): """ - :keyword message_filter_type: Required. The message filter type. Possible values include: + :keyword message_filter_type: Required. The message filter type. Known values are: "NotSpecified", "Include", "Exclude". :paramtype message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType """ @@ -11115,9 +11105,9 @@ class X12OneWayAgreement(msrest.serialization.Model): def __init__( self, *, - sender_business_identity: "BusinessIdentity", - receiver_business_identity: "BusinessIdentity", - protocol_settings: "X12ProtocolSettings", + sender_business_identity: "_models.BusinessIdentity", + receiver_business_identity: "_models.BusinessIdentity", + protocol_settings: "_models.X12ProtocolSettings", **kwargs ): """ @@ -11274,18 +11264,18 @@ class X12ProtocolSettings(msrest.serialization.Model): def __init__( self, *, - validation_settings: "X12ValidationSettings", - framing_settings: "X12FramingSettings", - envelope_settings: "X12EnvelopeSettings", - acknowledgement_settings: "X12AcknowledgementSettings", - message_filter: "X12MessageFilter", - security_settings: "X12SecuritySettings", - processing_settings: "X12ProcessingSettings", - schema_references: List["X12SchemaReference"], - envelope_overrides: Optional[List["X12EnvelopeOverride"]] = None, - validation_overrides: Optional[List["X12ValidationOverride"]] = None, - message_filter_list: Optional[List["X12MessageIdentifier"]] = None, - x12_delimiter_overrides: Optional[List["X12DelimiterOverrides"]] = None, + validation_settings: "_models.X12ValidationSettings", + framing_settings: "_models.X12FramingSettings", + envelope_settings: "_models.X12EnvelopeSettings", + acknowledgement_settings: "_models.X12AcknowledgementSettings", + message_filter: "_models.X12MessageFilter", + security_settings: "_models.X12SecuritySettings", + processing_settings: "_models.X12ProcessingSettings", + schema_references: List["_models.X12SchemaReference"], + envelope_overrides: Optional[List["_models.X12EnvelopeOverride"]] = None, + validation_overrides: Optional[List["_models.X12ValidationOverride"]] = None, + message_filter_list: Optional[List["_models.X12MessageIdentifier"]] = None, + x12_delimiter_overrides: Optional[List["_models.X12DelimiterOverrides"]] = None, **kwargs ): """ @@ -11455,8 +11445,8 @@ class X12ValidationOverride(msrest.serialization.Model): :ivar trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to trim leading and trailing spaces and zeroes. :vartype trim_leading_and_trailing_spaces_and_zeroes: bool - :ivar trailing_separator_policy: Required. The trailing separator policy. Possible values - include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :ivar trailing_separator_policy: Required. The trailing separator policy. Known values are: + "NotSpecified", "NotAllowed", "Optional", "Mandatory". :vartype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ @@ -11489,7 +11479,7 @@ def __init__( allow_leading_and_trailing_spaces_and_zeroes: bool, validate_character_set: bool, trim_leading_and_trailing_spaces_and_zeroes: bool, - trailing_separator_policy: Union[str, "TrailingSeparatorPolicy"], + trailing_separator_policy: Union[str, "_models.TrailingSeparatorPolicy"], **kwargs ): """ @@ -11509,8 +11499,8 @@ def __init__( :keyword trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to trim leading and trailing spaces and zeroes. :paramtype trim_leading_and_trailing_spaces_and_zeroes: bool - :keyword trailing_separator_policy: Required. The trailing separator policy. Possible values - include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :keyword trailing_separator_policy: Required. The trailing separator policy. Known values are: + "NotSpecified", "NotAllowed", "Optional", "Mandatory". :paramtype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ super(X12ValidationOverride, self).__init__(**kwargs) @@ -11555,8 +11545,8 @@ class X12ValidationSettings(msrest.serialization.Model): :ivar trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to trim leading and trailing spaces and zeroes. :vartype trim_leading_and_trailing_spaces_and_zeroes: bool - :ivar trailing_separator_policy: Required. The trailing separator policy. Possible values - include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :ivar trailing_separator_policy: Required. The trailing separator policy. Known values are: + "NotSpecified", "NotAllowed", "Optional", "Mandatory". :vartype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ @@ -11598,7 +11588,7 @@ def __init__( validate_xsd_types: bool, allow_leading_and_trailing_spaces_and_zeroes: bool, trim_leading_and_trailing_spaces_and_zeroes: bool, - trailing_separator_policy: Union[str, "TrailingSeparatorPolicy"], + trailing_separator_policy: Union[str, "_models.TrailingSeparatorPolicy"], **kwargs ): """ @@ -11629,8 +11619,8 @@ def __init__( :keyword trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to trim leading and trailing spaces and zeroes. :paramtype trim_leading_and_trailing_spaces_and_zeroes: bool - :keyword trailing_separator_policy: Required. The trailing separator policy. Possible values - include: "NotSpecified", "NotAllowed", "Optional", "Mandatory". + :keyword trailing_separator_policy: Required. The trailing separator policy. Known values are: + "NotSpecified", "NotAllowed", "Optional", "Mandatory". :paramtype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ super(X12ValidationSettings, self).__init__(**kwargs) diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_patch.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_patch.py new file mode 100644 index 000000000000..0ad201a8c586 --- /dev/null +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_patch.py @@ -0,0 +1,19 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/__init__.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/__init__.py index 5c557560db0a..d3898f2257d7 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/__init__.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/__init__.py @@ -34,6 +34,9 @@ from ._integration_service_environment_managed_api_operations_operations import IntegrationServiceEnvironmentManagedApiOperationsOperations from ._operations import Operations +from ._patch import __all__ as _patch_all +from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk __all__ = [ 'WorkflowsOperations', 'WorkflowVersionsOperations', @@ -63,3 +66,5 @@ 'IntegrationServiceEnvironmentManagedApiOperationsOperations', 'Operations', ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() \ No newline at end of file diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_agreements_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_agreements_operations.py index f372c09328f5..29f7f9410bc0 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_agreements_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_agreements_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -36,9 +36,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements") # pylint: disable=line-too-long path_format_arguments = { @@ -50,22 +53,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -77,9 +78,12 @@ def build_get_request( agreement_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,18 +96,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -114,14 +116,17 @@ def build_create_or_update_request( integration_account_name: str, agreement_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationAccountAgreement] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}") # pylint: disable=line-too-long path_format_arguments = { @@ -134,20 +139,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -161,9 +164,12 @@ def build_delete_request( agreement_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}") # pylint: disable=line-too-long path_format_arguments = { @@ -176,18 +182,16 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -198,14 +202,17 @@ def build_list_content_callback_url_request( integration_account_name: str, agreement_name: str, *, - json: JSONType = None, + json: Optional[_models.GetCallbackUrlParameters] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}/listContentCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -218,46 +225,42 @@ def build_list_content_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs ) -class IntegrationAccountAgreementsOperations(object): - """IntegrationAccountAgreementsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountAgreementsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_account_agreements` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -267,7 +270,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountAgreementListResult"]: + ) -> Iterable[_models.IntegrationAccountAgreementListResult]: """Gets a list of integration account agreements. :param resource_group_name: The resource group name. @@ -286,13 +289,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountAgreementListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountAgreementListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreementListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -304,9 +310,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -318,9 +326,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -361,7 +371,7 @@ def get( integration_account_name: str, agreement_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountAgreement": + ) -> _models.IntegrationAccountAgreement: """Gets an integration account agreement. :param resource_group_name: The resource group name. @@ -375,13 +385,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreement"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountAgreement] request = build_get_request( @@ -391,11 +404,13 @@ def get( agreement_name=agreement_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -423,9 +438,9 @@ def create_or_update( resource_group_name: str, integration_account_name: str, agreement_name: str, - agreement: "_models.IntegrationAccountAgreement", + agreement: _models.IntegrationAccountAgreement, **kwargs: Any - ) -> "_models.IntegrationAccountAgreement": + ) -> _models.IntegrationAccountAgreement: """Creates or updates an integration account agreement. :param resource_group_name: The resource group name. @@ -441,14 +456,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreement"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountAgreement] _json = self._serialize.body(agreement, 'IntegrationAccountAgreement') @@ -461,11 +479,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -512,13 +532,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -528,11 +551,13 @@ def delete( # pylint: disable=inconsistent-return-statements agreement_name=agreement_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -556,9 +581,9 @@ def list_content_callback_url( resource_group_name: str, integration_account_name: str, agreement_name: str, - list_content_callback_url: "_models.GetCallbackUrlParameters", + list_content_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. :param resource_group_name: The resource group name. @@ -574,14 +599,17 @@ def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') @@ -594,11 +622,13 @@ def list_content_callback_url( content_type=content_type, json=_json, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_assemblies_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_assemblies_operations.py index dbd34a4f7f8a..1314a4b2a6a6 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_assemblies_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_assemblies_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -33,9 +33,12 @@ def build_list_request( integration_account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies") # pylint: disable=line-too-long path_format_arguments = { @@ -47,18 +50,16 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -70,9 +71,12 @@ def build_get_request( assembly_artifact_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}") # pylint: disable=line-too-long path_format_arguments = { @@ -85,18 +89,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -107,14 +109,17 @@ def build_create_or_update_request( integration_account_name: str, assembly_artifact_name: str, *, - json: JSONType = None, + json: Optional[_models.AssemblyDefinition] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}") # pylint: disable=line-too-long path_format_arguments = { @@ -127,20 +132,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -154,9 +157,12 @@ def build_delete_request( assembly_artifact_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}") # pylint: disable=line-too-long path_format_arguments = { @@ -169,18 +175,16 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -192,9 +196,12 @@ def build_list_content_callback_url_request( assembly_artifact_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -207,42 +214,38 @@ def build_list_content_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationAccountAssembliesOperations(object): - """IntegrationAccountAssembliesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountAssembliesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_account_assemblies` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -250,7 +253,7 @@ def list( resource_group_name: str, integration_account_name: str, **kwargs: Any - ) -> Iterable["_models.AssemblyCollection"]: + ) -> Iterable[_models.AssemblyCollection]: """List the assemblies for an integration account. :param resource_group_name: The resource group name. @@ -262,13 +265,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.AssemblyCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.AssemblyCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -278,9 +284,11 @@ def prepare_request(next_link=None): integration_account_name=integration_account_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -290,9 +298,11 @@ def prepare_request(next_link=None): integration_account_name=integration_account_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -333,7 +343,7 @@ def get( integration_account_name: str, assembly_artifact_name: str, **kwargs: Any - ) -> "_models.AssemblyDefinition": + ) -> _models.AssemblyDefinition: """Get an assembly for an integration account. :param resource_group_name: The resource group name. @@ -347,13 +357,16 @@ def get( :rtype: ~azure.mgmt.logic.models.AssemblyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.AssemblyDefinition] request = build_get_request( @@ -363,11 +376,13 @@ def get( assembly_artifact_name=assembly_artifact_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -395,9 +410,9 @@ def create_or_update( resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, - assembly_artifact: "_models.AssemblyDefinition", + assembly_artifact: _models.AssemblyDefinition, **kwargs: Any - ) -> "_models.AssemblyDefinition": + ) -> _models.AssemblyDefinition: """Create or update an assembly for an integration account. :param resource_group_name: The resource group name. @@ -413,14 +428,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.AssemblyDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.AssemblyDefinition] _json = self._serialize.body(assembly_artifact, 'AssemblyDefinition') @@ -433,11 +451,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -484,13 +504,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -500,11 +523,13 @@ def delete( # pylint: disable=inconsistent-return-statements assembly_artifact_name=assembly_artifact_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -529,7 +554,7 @@ def list_content_callback_url( integration_account_name: str, assembly_artifact_name: str, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url for an integration account assembly. :param resource_group_name: The resource group name. @@ -543,13 +568,16 @@ def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] request = build_list_content_callback_url_request( @@ -559,11 +587,13 @@ def list_content_callback_url( assembly_artifact_name=assembly_artifact_name, api_version=api_version, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_batch_configurations_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_batch_configurations_operations.py index 4e1e4c5c0ec3..ca8b49d94183 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_batch_configurations_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_batch_configurations_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -33,9 +33,12 @@ def build_list_request( integration_account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations") # pylint: disable=line-too-long path_format_arguments = { @@ -47,18 +50,16 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -70,9 +71,12 @@ def build_get_request( batch_configuration_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}") # pylint: disable=line-too-long path_format_arguments = { @@ -85,18 +89,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -107,14 +109,17 @@ def build_create_or_update_request( integration_account_name: str, batch_configuration_name: str, *, - json: JSONType = None, + json: Optional[_models.BatchConfiguration] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}") # pylint: disable=line-too-long path_format_arguments = { @@ -127,20 +132,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -154,9 +157,12 @@ def build_delete_request( batch_configuration_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}") # pylint: disable=line-too-long path_format_arguments = { @@ -169,42 +175,38 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationAccountBatchConfigurationsOperations(object): - """IntegrationAccountBatchConfigurationsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountBatchConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_account_batch_configurations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -212,7 +214,7 @@ def list( resource_group_name: str, integration_account_name: str, **kwargs: Any - ) -> Iterable["_models.BatchConfigurationCollection"]: + ) -> Iterable[_models.BatchConfigurationCollection]: """List the batch configurations for an integration account. :param resource_group_name: The resource group name. @@ -225,13 +227,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.BatchConfigurationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.BatchConfigurationCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfigurationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -241,9 +246,11 @@ def prepare_request(next_link=None): integration_account_name=integration_account_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -253,9 +260,11 @@ def prepare_request(next_link=None): integration_account_name=integration_account_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -296,7 +305,7 @@ def get( integration_account_name: str, batch_configuration_name: str, **kwargs: Any - ) -> "_models.BatchConfiguration": + ) -> _models.BatchConfiguration: """Get a batch configuration for an integration account. :param resource_group_name: The resource group name. @@ -310,13 +319,16 @@ def get( :rtype: ~azure.mgmt.logic.models.BatchConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.BatchConfiguration] request = build_get_request( @@ -326,11 +338,13 @@ def get( batch_configuration_name=batch_configuration_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -358,9 +372,9 @@ def create_or_update( resource_group_name: str, integration_account_name: str, batch_configuration_name: str, - batch_configuration: "_models.BatchConfiguration", + batch_configuration: _models.BatchConfiguration, **kwargs: Any - ) -> "_models.BatchConfiguration": + ) -> _models.BatchConfiguration: """Create or update a batch configuration for an integration account. :param resource_group_name: The resource group name. @@ -376,14 +390,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.BatchConfiguration :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfiguration"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.BatchConfiguration] _json = self._serialize.body(batch_configuration, 'BatchConfiguration') @@ -396,11 +413,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -447,13 +466,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -463,11 +485,13 @@ def delete( # pylint: disable=inconsistent-return-statements batch_configuration_name=batch_configuration_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_certificates_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_certificates_operations.py index f7c31d7ddc91..0c0d2f7132d6 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_certificates_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_certificates_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -35,9 +35,12 @@ def build_list_request( top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates") # pylint: disable=line-too-long path_format_arguments = { @@ -49,20 +52,18 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -74,9 +75,12 @@ def build_get_request( certificate_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}") # pylint: disable=line-too-long path_format_arguments = { @@ -89,18 +93,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -111,14 +113,17 @@ def build_create_or_update_request( integration_account_name: str, certificate_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationAccountCertificate] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}") # pylint: disable=line-too-long path_format_arguments = { @@ -131,20 +136,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -158,9 +161,12 @@ def build_delete_request( certificate_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}") # pylint: disable=line-too-long path_format_arguments = { @@ -173,42 +179,38 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationAccountCertificatesOperations(object): - """IntegrationAccountCertificatesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_account_certificates` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -217,7 +219,7 @@ def list( integration_account_name: str, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountCertificateListResult"]: + ) -> Iterable[_models.IntegrationAccountCertificateListResult]: """Gets a list of integration account certificates. :param resource_group_name: The resource group name. @@ -233,13 +235,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountCertificateListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountCertificateListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificateListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -250,9 +255,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -263,9 +270,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -306,7 +315,7 @@ def get( integration_account_name: str, certificate_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountCertificate": + ) -> _models.IntegrationAccountCertificate: """Gets an integration account certificate. :param resource_group_name: The resource group name. @@ -320,13 +329,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificate"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountCertificate] request = build_get_request( @@ -336,11 +348,13 @@ def get( certificate_name=certificate_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -368,9 +382,9 @@ def create_or_update( resource_group_name: str, integration_account_name: str, certificate_name: str, - certificate: "_models.IntegrationAccountCertificate", + certificate: _models.IntegrationAccountCertificate, **kwargs: Any - ) -> "_models.IntegrationAccountCertificate": + ) -> _models.IntegrationAccountCertificate: """Creates or updates an integration account certificate. :param resource_group_name: The resource group name. @@ -386,14 +400,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificate"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountCertificate] _json = self._serialize.body(certificate, 'IntegrationAccountCertificate') @@ -406,11 +423,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -457,13 +476,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -473,11 +495,13 @@ def delete( # pylint: disable=inconsistent-return-statements certificate_name=certificate_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_maps_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_maps_operations.py index a3a26e51174e..6042bcd2e444 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_maps_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_maps_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -36,9 +36,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps") # pylint: disable=line-too-long path_format_arguments = { @@ -50,22 +53,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -77,9 +78,12 @@ def build_get_request( map_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,18 +96,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -114,14 +116,17 @@ def build_create_or_update_request( integration_account_name: str, map_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationAccountMap] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}") # pylint: disable=line-too-long path_format_arguments = { @@ -134,20 +139,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -161,9 +164,12 @@ def build_delete_request( map_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}") # pylint: disable=line-too-long path_format_arguments = { @@ -176,18 +182,16 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -198,14 +202,17 @@ def build_list_content_callback_url_request( integration_account_name: str, map_name: str, *, - json: JSONType = None, + json: Optional[_models.GetCallbackUrlParameters] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}/listContentCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -218,46 +225,42 @@ def build_list_content_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs ) -class IntegrationAccountMapsOperations(object): - """IntegrationAccountMapsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountMapsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_account_maps` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -267,7 +270,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountMapListResult"]: + ) -> Iterable[_models.IntegrationAccountMapListResult]: """Gets a list of integration account maps. :param resource_group_name: The resource group name. @@ -285,13 +288,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountMapListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountMapListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMapListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -303,9 +309,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -317,9 +325,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -360,7 +370,7 @@ def get( integration_account_name: str, map_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountMap": + ) -> _models.IntegrationAccountMap: """Gets an integration account map. :param resource_group_name: The resource group name. @@ -374,13 +384,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountMap] request = build_get_request( @@ -390,11 +403,13 @@ def get( map_name=map_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -422,9 +437,9 @@ def create_or_update( resource_group_name: str, integration_account_name: str, map_name: str, - map: "_models.IntegrationAccountMap", + map: _models.IntegrationAccountMap, **kwargs: Any - ) -> "_models.IntegrationAccountMap": + ) -> _models.IntegrationAccountMap: """Creates or updates an integration account map. If the map is larger than 4 MB, you need to store the map in an Azure blob and use the blob's Shared Access Signature (SAS) URL as the 'contentLink' property value. @@ -442,14 +457,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMap"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountMap] _json = self._serialize.body(map, 'IntegrationAccountMap') @@ -462,11 +480,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -513,13 +533,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -529,11 +552,13 @@ def delete( # pylint: disable=inconsistent-return-statements map_name=map_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -557,9 +582,9 @@ def list_content_callback_url( resource_group_name: str, integration_account_name: str, map_name: str, - list_content_callback_url: "_models.GetCallbackUrlParameters", + list_content_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. :param resource_group_name: The resource group name. @@ -575,14 +600,17 @@ def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') @@ -595,11 +623,13 @@ def list_content_callback_url( content_type=content_type, json=_json, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_partners_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_partners_operations.py index e8eacf367621..92c5f3199b47 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_partners_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_partners_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -36,9 +36,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners") # pylint: disable=line-too-long path_format_arguments = { @@ -50,22 +53,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -77,9 +78,12 @@ def build_get_request( partner_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,18 +96,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -114,14 +116,17 @@ def build_create_or_update_request( integration_account_name: str, partner_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationAccountPartner] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}") # pylint: disable=line-too-long path_format_arguments = { @@ -134,20 +139,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -161,9 +164,12 @@ def build_delete_request( partner_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}") # pylint: disable=line-too-long path_format_arguments = { @@ -176,18 +182,16 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -198,14 +202,17 @@ def build_list_content_callback_url_request( integration_account_name: str, partner_name: str, *, - json: JSONType = None, + json: Optional[_models.GetCallbackUrlParameters] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}/listContentCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -218,46 +225,42 @@ def build_list_content_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs ) -class IntegrationAccountPartnersOperations(object): - """IntegrationAccountPartnersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountPartnersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_account_partners` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -267,7 +270,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountPartnerListResult"]: + ) -> Iterable[_models.IntegrationAccountPartnerListResult]: """Gets a list of integration account partners. :param resource_group_name: The resource group name. @@ -286,13 +289,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountPartnerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountPartnerListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartnerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -304,9 +310,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -318,9 +326,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -361,7 +371,7 @@ def get( integration_account_name: str, partner_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountPartner": + ) -> _models.IntegrationAccountPartner: """Gets an integration account partner. :param resource_group_name: The resource group name. @@ -375,13 +385,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartner"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountPartner] request = build_get_request( @@ -391,11 +404,13 @@ def get( partner_name=partner_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -423,9 +438,9 @@ def create_or_update( resource_group_name: str, integration_account_name: str, partner_name: str, - partner: "_models.IntegrationAccountPartner", + partner: _models.IntegrationAccountPartner, **kwargs: Any - ) -> "_models.IntegrationAccountPartner": + ) -> _models.IntegrationAccountPartner: """Creates or updates an integration account partner. :param resource_group_name: The resource group name. @@ -441,14 +456,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartner"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountPartner] _json = self._serialize.body(partner, 'IntegrationAccountPartner') @@ -461,11 +479,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -512,13 +532,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -528,11 +551,13 @@ def delete( # pylint: disable=inconsistent-return-statements partner_name=partner_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -556,9 +581,9 @@ def list_content_callback_url( resource_group_name: str, integration_account_name: str, partner_name: str, - list_content_callback_url: "_models.GetCallbackUrlParameters", + list_content_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. :param resource_group_name: The resource group name. @@ -574,14 +599,17 @@ def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') @@ -594,11 +622,13 @@ def list_content_callback_url( content_type=content_type, json=_json, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_schemas_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_schemas_operations.py index 44ba9f683eeb..a3fd8c42709a 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_schemas_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_schemas_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -36,9 +36,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas") # pylint: disable=line-too-long path_format_arguments = { @@ -50,22 +53,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -77,9 +78,12 @@ def build_get_request( schema_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,18 +96,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -114,14 +116,17 @@ def build_create_or_update_request( integration_account_name: str, schema_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationAccountSchema] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}") # pylint: disable=line-too-long path_format_arguments = { @@ -134,20 +139,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -161,9 +164,12 @@ def build_delete_request( schema_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}") # pylint: disable=line-too-long path_format_arguments = { @@ -176,18 +182,16 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -198,14 +202,17 @@ def build_list_content_callback_url_request( integration_account_name: str, schema_name: str, *, - json: JSONType = None, + json: Optional[_models.GetCallbackUrlParameters] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}/listContentCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -218,46 +225,42 @@ def build_list_content_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs ) -class IntegrationAccountSchemasOperations(object): - """IntegrationAccountSchemasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountSchemasOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_account_schemas` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -267,7 +270,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountSchemaListResult"]: + ) -> Iterable[_models.IntegrationAccountSchemaListResult]: """Gets a list of integration account schemas. :param resource_group_name: The resource group name. @@ -286,13 +289,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountSchemaListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSchemaListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchemaListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -304,9 +310,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -318,9 +326,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -361,7 +371,7 @@ def get( integration_account_name: str, schema_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountSchema": + ) -> _models.IntegrationAccountSchema: """Gets an integration account schema. :param resource_group_name: The resource group name. @@ -375,13 +385,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchema"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSchema] request = build_get_request( @@ -391,11 +404,13 @@ def get( schema_name=schema_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -423,9 +438,9 @@ def create_or_update( resource_group_name: str, integration_account_name: str, schema_name: str, - schema: "_models.IntegrationAccountSchema", + schema: _models.IntegrationAccountSchema, **kwargs: Any - ) -> "_models.IntegrationAccountSchema": + ) -> _models.IntegrationAccountSchema: """Creates or updates an integration account schema. :param resource_group_name: The resource group name. @@ -441,14 +456,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchema"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSchema] _json = self._serialize.body(schema, 'IntegrationAccountSchema') @@ -461,11 +479,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -512,13 +532,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -528,11 +551,13 @@ def delete( # pylint: disable=inconsistent-return-statements schema_name=schema_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -556,9 +581,9 @@ def list_content_callback_url( resource_group_name: str, integration_account_name: str, schema_name: str, - list_content_callback_url: "_models.GetCallbackUrlParameters", + list_content_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. :param resource_group_name: The resource group name. @@ -574,14 +599,17 @@ def list_content_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') @@ -594,11 +622,13 @@ def list_content_callback_url( content_type=content_type, json=_json, template_url=self.list_content_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_sessions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_sessions_operations.py index f2c15ac68cad..040e0a4cb223 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_sessions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_account_sessions_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -36,9 +36,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions") # pylint: disable=line-too-long path_format_arguments = { @@ -50,22 +53,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -77,9 +78,12 @@ def build_get_request( session_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,18 +96,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -114,14 +116,17 @@ def build_create_or_update_request( integration_account_name: str, session_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationAccountSession] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}") # pylint: disable=line-too-long path_format_arguments = { @@ -134,20 +139,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -161,9 +164,12 @@ def build_delete_request( session_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}") # pylint: disable=line-too-long path_format_arguments = { @@ -176,42 +182,38 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationAccountSessionsOperations(object): - """IntegrationAccountSessionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountSessionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_account_sessions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -221,7 +223,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountSessionListResult"]: + ) -> Iterable[_models.IntegrationAccountSessionListResult]: """Gets a list of integration account sessions. :param resource_group_name: The resource group name. @@ -240,13 +242,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountSessionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSessionListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSessionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -258,9 +263,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -272,9 +279,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -315,7 +324,7 @@ def get( integration_account_name: str, session_name: str, **kwargs: Any - ) -> "_models.IntegrationAccountSession": + ) -> _models.IntegrationAccountSession: """Gets an integration account session. :param resource_group_name: The resource group name. @@ -329,13 +338,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSession"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSession] request = build_get_request( @@ -345,11 +357,13 @@ def get( session_name=session_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -377,9 +391,9 @@ def create_or_update( resource_group_name: str, integration_account_name: str, session_name: str, - session: "_models.IntegrationAccountSession", + session: _models.IntegrationAccountSession, **kwargs: Any - ) -> "_models.IntegrationAccountSession": + ) -> _models.IntegrationAccountSession: """Creates or updates an integration account session. :param resource_group_name: The resource group name. @@ -395,14 +409,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSession"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountSession] _json = self._serialize.body(session, 'IntegrationAccountSession') @@ -415,11 +432,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -466,13 +485,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -482,11 +504,13 @@ def delete( # pylint: disable=inconsistent-return-statements session_name=session_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_accounts_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_accounts_operations.py index d416bc47bfe6..8aed2702577f 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_accounts_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_accounts_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -33,9 +33,12 @@ def build_list_by_subscription_request( top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts") path_format_arguments = { @@ -45,20 +48,18 @@ def build_list_by_subscription_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -70,9 +71,12 @@ def build_list_by_resource_group_request( top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts") # pylint: disable=line-too-long path_format_arguments = { @@ -83,20 +87,18 @@ def build_list_by_resource_group_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -107,9 +109,12 @@ def build_get_request( integration_account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}") # pylint: disable=line-too-long path_format_arguments = { @@ -121,18 +126,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -142,14 +145,17 @@ def build_create_or_update_request( resource_group_name: str, integration_account_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationAccount] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}") # pylint: disable=line-too-long path_format_arguments = { @@ -161,20 +167,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -186,14 +190,17 @@ def build_update_request( resource_group_name: str, integration_account_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationAccount] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}") # pylint: disable=line-too-long path_format_arguments = { @@ -205,20 +212,18 @@ def build_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -231,9 +236,12 @@ def build_delete_request( integration_account_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}") # pylint: disable=line-too-long path_format_arguments = { @@ -245,18 +253,16 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -266,14 +272,17 @@ def build_list_callback_url_request( resource_group_name: str, integration_account_name: str, *, - json: JSONType = None, + json: Optional[_models.GetCallbackUrlParameters] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -285,20 +294,18 @@ def build_list_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -310,14 +317,17 @@ def build_list_key_vault_keys_request( resource_group_name: str, integration_account_name: str, *, - json: JSONType = None, + json: Optional[_models.ListKeyVaultKeysDefinition] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys") # pylint: disable=line-too-long path_format_arguments = { @@ -329,20 +339,18 @@ def build_list_key_vault_keys_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -354,14 +362,17 @@ def build_log_tracking_events_request( resource_group_name: str, integration_account_name: str, *, - json: JSONType = None, + json: Optional[_models.TrackingEventsDefinition] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents") # pylint: disable=line-too-long path_format_arguments = { @@ -373,20 +384,18 @@ def build_log_tracking_events_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -398,14 +407,17 @@ def build_regenerate_access_key_request( resource_group_name: str, integration_account_name: str, *, - json: JSONType = None, + json: Optional[_models.RegenerateActionParameter] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey") # pylint: disable=line-too-long path_format_arguments = { @@ -417,53 +429,49 @@ def build_regenerate_access_key_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs ) -class IntegrationAccountsOperations(object): - """IntegrationAccountsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationAccountsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_accounts` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list_by_subscription( self, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountListResult"]: + ) -> Iterable[_models.IntegrationAccountListResult]: """Gets a list of integration accounts by subscription. :param top: The number of items to be included in the result. Default value is None. @@ -474,13 +482,16 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -489,9 +500,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list_by_subscription.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -500,9 +513,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -542,7 +557,7 @@ def list_by_resource_group( resource_group_name: str, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountListResult"]: + ) -> Iterable[_models.IntegrationAccountListResult]: """Gets a list of integration accounts by resource group. :param resource_group_name: The resource group name. @@ -555,13 +570,16 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccountListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -571,9 +589,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list_by_resource_group.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -583,9 +603,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -625,7 +647,7 @@ def get( resource_group_name: str, integration_account_name: str, **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Gets an integration account. :param resource_group_name: The resource group name. @@ -637,13 +659,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccount] request = build_get_request( @@ -652,11 +677,13 @@ def get( integration_account_name=integration_account_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -683,9 +710,9 @@ def create_or_update( self, resource_group_name: str, integration_account_name: str, - integration_account: "_models.IntegrationAccount", + integration_account: _models.IntegrationAccount, **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Creates or updates an integration account. :param resource_group_name: The resource group name. @@ -699,14 +726,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.IntegrationAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccount] _json = self._serialize.body(integration_account, 'IntegrationAccount') @@ -718,11 +748,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -753,9 +785,9 @@ def update( self, resource_group_name: str, integration_account_name: str, - integration_account: "_models.IntegrationAccount", + integration_account: _models.IntegrationAccount, **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Updates an integration account. :param resource_group_name: The resource group name. @@ -769,14 +801,17 @@ def update( :rtype: ~azure.mgmt.logic.models.IntegrationAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccount] _json = self._serialize.body(integration_account, 'IntegrationAccount') @@ -788,11 +823,13 @@ def update( content_type=content_type, json=_json, template_url=self.update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -832,13 +869,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -847,11 +887,13 @@ def delete( # pylint: disable=inconsistent-return-statements integration_account_name=integration_account_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -874,9 +916,9 @@ def list_callback_url( self, resource_group_name: str, integration_account_name: str, - parameters: "_models.GetCallbackUrlParameters", + parameters: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.CallbackUrl": + ) -> _models.CallbackUrl: """Gets the integration account callback URL. :param resource_group_name: The resource group name. @@ -890,14 +932,17 @@ def list_callback_url( :rtype: ~azure.mgmt.logic.models.CallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.CallbackUrl] _json = self._serialize.body(parameters, 'GetCallbackUrlParameters') @@ -909,11 +954,13 @@ def list_callback_url( content_type=content_type, json=_json, template_url=self.list_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -940,9 +987,9 @@ def list_key_vault_keys( self, resource_group_name: str, integration_account_name: str, - list_key_vault_keys: "_models.ListKeyVaultKeysDefinition", + list_key_vault_keys: _models.ListKeyVaultKeysDefinition, **kwargs: Any - ) -> Iterable["_models.KeyVaultKeyCollection"]: + ) -> Iterable[_models.KeyVaultKeyCollection]: """Gets the integration account's Key Vault keys. :param resource_group_name: The resource group name. @@ -957,14 +1004,17 @@ def list_key_vault_keys( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.KeyVaultKeyCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.KeyVaultKeyCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.KeyVaultKeyCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: _json = self._serialize.body(list_key_vault_keys, 'ListKeyVaultKeysDefinition') @@ -977,9 +1027,11 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, template_url=self.list_key_vault_keys.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: _json = self._serialize.body(list_key_vault_keys, 'ListKeyVaultKeysDefinition') @@ -992,9 +1044,11 @@ def prepare_request(next_link=None): content_type=content_type, json=_json, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -1033,7 +1087,7 @@ def log_tracking_events( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, integration_account_name: str, - log_tracking_events: "_models.TrackingEventsDefinition", + log_tracking_events: _models.TrackingEventsDefinition, **kwargs: Any ) -> None: """Logs the integration account's tracking events. @@ -1049,14 +1103,17 @@ def log_tracking_events( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(log_tracking_events, 'TrackingEventsDefinition') @@ -1068,11 +1125,13 @@ def log_tracking_events( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, template_url=self.log_tracking_events.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1095,9 +1154,9 @@ def regenerate_access_key( self, resource_group_name: str, integration_account_name: str, - regenerate_access_key: "_models.RegenerateActionParameter", + regenerate_access_key: _models.RegenerateActionParameter, **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Regenerates the integration account access key. :param resource_group_name: The resource group name. @@ -1111,14 +1170,17 @@ def regenerate_access_key( :rtype: ~azure.mgmt.logic.models.IntegrationAccount :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationAccount] _json = self._serialize.body(regenerate_access_key, 'RegenerateActionParameter') @@ -1130,11 +1192,13 @@ def regenerate_access_key( content_type=content_type, json=_json, template_url=self.regenerate_access_key.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_managed_api_operations_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_managed_api_operations_operations.py index 84c1a24d6c36..7a110a8b2bff 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_managed_api_operations_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_managed_api_operations_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -33,9 +34,12 @@ def build_list_request( api_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations") # pylint: disable=line-too-long path_format_arguments = { @@ -48,42 +52,38 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationServiceEnvironmentManagedApiOperationsOperations(object): - """IntegrationServiceEnvironmentManagedApiOperationsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationServiceEnvironmentManagedApiOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_service_environment_managed_api_operations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -92,7 +92,7 @@ def list( integration_service_environment_name: str, api_name: str, **kwargs: Any - ) -> Iterable["_models.ApiOperationListResult"]: + ) -> Iterable[_models.ApiOperationListResult]: """Gets the managed Api operations. :param resource_group: The resource group. @@ -107,13 +107,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ApiOperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.ApiOperationListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiOperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -124,9 +127,11 @@ def prepare_request(next_link=None): api_name=api_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -137,9 +142,11 @@ def prepare_request(next_link=None): api_name=api_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_managed_apis_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_managed_apis_operations.py index 606b55a1957d..c7f99bd259a2 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_managed_apis_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_managed_apis_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from msrest import Serializer @@ -17,13 +17,13 @@ from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -35,9 +35,12 @@ def build_list_request( integration_service_environment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis") # pylint: disable=line-too-long path_format_arguments = { @@ -49,18 +52,16 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -72,9 +73,12 @@ def build_get_request( api_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}") # pylint: disable=line-too-long path_format_arguments = { @@ -87,18 +91,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -109,14 +111,17 @@ def build_put_request_initial( integration_service_environment_name: str, api_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationServiceEnvironmentManagedApi] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}") # pylint: disable=line-too-long path_format_arguments = { @@ -129,20 +134,18 @@ def build_put_request_initial( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -156,9 +159,12 @@ def build_delete_request_initial( api_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}") # pylint: disable=line-too-long path_format_arguments = { @@ -171,42 +177,38 @@ def build_delete_request_initial( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationServiceEnvironmentManagedApisOperations(object): - """IntegrationServiceEnvironmentManagedApisOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationServiceEnvironmentManagedApisOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_service_environment_managed_apis` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -214,7 +216,7 @@ def list( resource_group: str, integration_service_environment_name: str, **kwargs: Any - ) -> Iterable["_models.IntegrationServiceEnvironmentManagedApiListResult"]: + ) -> Iterable[_models.IntegrationServiceEnvironmentManagedApiListResult]: """Gets the integration service environment managed Apis. :param resource_group: The resource group. @@ -228,13 +230,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApiListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApiListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApiListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -244,9 +249,11 @@ def prepare_request(next_link=None): integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -256,9 +263,11 @@ def prepare_request(next_link=None): integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -299,7 +308,7 @@ def get( integration_service_environment_name: str, api_name: str, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironmentManagedApi": + ) -> _models.IntegrationServiceEnvironmentManagedApi: """Gets the integration service environment managed Api. :param resource_group: The resource group name. @@ -313,13 +322,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] request = build_get_request( @@ -329,11 +341,13 @@ def get( api_name=api_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -360,17 +374,20 @@ def _put_initial( resource_group: str, integration_service_environment_name: str, api_name: str, - integration_service_environment_managed_api: "_models.IntegrationServiceEnvironmentManagedApi", + integration_service_environment_managed_api: _models.IntegrationServiceEnvironmentManagedApi, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironmentManagedApi": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] + ) -> _models.IntegrationServiceEnvironmentManagedApi: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] _json = self._serialize.body(integration_service_environment_managed_api, 'IntegrationServiceEnvironmentManagedApi') @@ -383,11 +400,13 @@ def _put_initial( content_type=content_type, json=_json, template_url=self._put_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -418,9 +437,9 @@ def begin_put( resource_group: str, integration_service_environment_name: str, api_name: str, - integration_service_environment_managed_api: "_models.IntegrationServiceEnvironmentManagedApi", + integration_service_environment_managed_api: _models.IntegrationServiceEnvironmentManagedApi, **kwargs: Any - ) -> LROPoller["_models.IntegrationServiceEnvironmentManagedApi"]: + ) -> LROPoller[_models.IntegrationServiceEnvironmentManagedApi]: """Puts the integration service environment managed Api. :param resource_group: The resource group name. @@ -447,17 +466,20 @@ def begin_put( ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = self._put_initial( + raw_result = self._put_initial( # type: ignore resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, @@ -465,20 +487,27 @@ def begin_put( api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() + if polling is True: + polling_method = cast(PollingMethod, ARMPolling( + lro_delay, + + + **kwargs + )) # type: PollingMethod + elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( @@ -498,13 +527,16 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request_initial( @@ -514,11 +546,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_name=api_name, api_version=api_version, template_url=self._delete_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -563,21 +597,26 @@ def begin_delete( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str 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 ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._delete_initial( # type: ignore resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, api_version=api_version, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) @@ -587,8 +626,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() + if polling is True: + polling_method = cast(PollingMethod, ARMPolling( + lro_delay, + + + **kwargs + )) # type: PollingMethod + elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_network_health_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_network_health_operations.py index f29dca2895bb..91a6b6b73940 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_network_health_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_network_health_operations.py @@ -15,6 +15,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -31,9 +32,12 @@ def build_get_request( integration_service_environment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network") # pylint: disable=line-too-long path_format_arguments = { @@ -45,42 +49,38 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationServiceEnvironmentNetworkHealthOperations(object): - """IntegrationServiceEnvironmentNetworkHealthOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationServiceEnvironmentNetworkHealthOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_service_environment_network_health` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def get( @@ -88,7 +88,7 @@ def get( resource_group: str, integration_service_environment_name: str, **kwargs: Any - ) -> Dict[str, "_models.IntegrationServiceEnvironmentSubnetNetworkHealth"]: + ) -> Dict[str, _models.IntegrationServiceEnvironmentSubnetNetworkHealth]: """Gets the integration service environment network health. :param resource_group: The resource group. @@ -101,13 +101,16 @@ def get( :rtype: dict[str, ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSubnetNetworkHealth] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.IntegrationServiceEnvironmentSubnetNetworkHealth"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, _models.IntegrationServiceEnvironmentSubnetNetworkHealth]] request = build_get_request( @@ -116,11 +119,13 @@ def get( integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_skus_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_skus_operations.py index 1e4f51eb4546..95d8124cd2a2 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_skus_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environment_skus_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -32,9 +33,12 @@ def build_list_request( integration_service_environment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus") # pylint: disable=line-too-long path_format_arguments = { @@ -46,42 +50,38 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationServiceEnvironmentSkusOperations(object): - """IntegrationServiceEnvironmentSkusOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationServiceEnvironmentSkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_service_environment_skus` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -89,7 +89,7 @@ def list( resource_group: str, integration_service_environment_name: str, **kwargs: Any - ) -> Iterable["_models.IntegrationServiceEnvironmentSkuList"]: + ) -> Iterable[_models.IntegrationServiceEnvironmentSkuList]: """Gets a list of integration service environment Skus. :param resource_group: The resource group. @@ -103,13 +103,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuList] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentSkuList] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentSkuList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -119,9 +122,11 @@ def prepare_request(next_link=None): integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -131,9 +136,11 @@ def prepare_request(next_link=None): integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environments_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environments_operations.py index ba39412535c8..448bcb89c920 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environments_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_integration_service_environments_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from msrest import Serializer @@ -17,13 +17,13 @@ from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -35,9 +35,12 @@ def build_list_by_subscription_request( top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments") # pylint: disable=line-too-long path_format_arguments = { @@ -47,20 +50,18 @@ def build_list_by_subscription_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -72,9 +73,12 @@ def build_list_by_resource_group_request( top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments") # pylint: disable=line-too-long path_format_arguments = { @@ -85,20 +89,18 @@ def build_list_by_resource_group_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -109,9 +111,12 @@ def build_get_request( integration_service_environment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}") # pylint: disable=line-too-long path_format_arguments = { @@ -123,18 +128,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -144,14 +147,17 @@ def build_create_or_update_request_initial( resource_group: str, integration_service_environment_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationServiceEnvironment] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}") # pylint: disable=line-too-long path_format_arguments = { @@ -163,20 +169,18 @@ def build_create_or_update_request_initial( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -188,14 +192,17 @@ def build_update_request_initial( resource_group: str, integration_service_environment_name: str, *, - json: JSONType = None, + json: Optional[_models.IntegrationServiceEnvironment] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}") # pylint: disable=line-too-long path_format_arguments = { @@ -207,20 +214,18 @@ def build_update_request_initial( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -233,9 +238,12 @@ def build_delete_request( integration_service_environment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}") # pylint: disable=line-too-long path_format_arguments = { @@ -247,18 +255,16 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -269,9 +275,12 @@ def build_restart_request( integration_service_environment_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart") # pylint: disable=line-too-long path_format_arguments = { @@ -283,49 +292,45 @@ def build_restart_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class IntegrationServiceEnvironmentsOperations(object): - """IntegrationServiceEnvironmentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class IntegrationServiceEnvironmentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`integration_service_environments` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list_by_subscription( self, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationServiceEnvironmentListResult"]: + ) -> Iterable[_models.IntegrationServiceEnvironmentListResult]: """Gets a list of integration service environments by subscription. :param top: The number of items to be included in the result. Default value is None. @@ -337,13 +342,16 @@ def list_by_subscription( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -352,9 +360,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list_by_subscription.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -363,9 +373,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -405,7 +417,7 @@ def list_by_resource_group( resource_group: str, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationServiceEnvironmentListResult"]: + ) -> Iterable[_models.IntegrationServiceEnvironmentListResult]: """Gets a list of integration service environments by resource group. :param resource_group: The resource group. @@ -419,13 +431,16 @@ def list_by_resource_group( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironmentListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -435,9 +450,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list_by_resource_group.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -447,9 +464,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -489,7 +508,7 @@ def get( resource_group: str, integration_service_environment_name: str, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": + ) -> _models.IntegrationServiceEnvironment: """Gets an integration service environment. :param resource_group: The resource group. @@ -501,13 +520,16 @@ def get( :rtype: ~azure.mgmt.logic.models.IntegrationServiceEnvironment :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] request = build_get_request( @@ -516,11 +538,13 @@ def get( integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -546,17 +570,20 @@ def _create_or_update_initial( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: _models.IntegrationServiceEnvironment, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] + ) -> _models.IntegrationServiceEnvironment: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] _json = self._serialize.body(integration_service_environment, 'IntegrationServiceEnvironment') @@ -568,11 +595,13 @@ def _create_or_update_initial( content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -602,9 +631,9 @@ def begin_create_or_update( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: _models.IntegrationServiceEnvironment, **kwargs: Any - ) -> LROPoller["_models.IntegrationServiceEnvironment"]: + ) -> LROPoller[_models.IntegrationServiceEnvironment]: """Creates or updates an integration service environment. :param resource_group: The resource group. @@ -626,37 +655,47 @@ def begin_create_or_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._create_or_update_initial( # type: ignore resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, integration_service_environment=integration_service_environment, api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() + if polling is True: + polling_method = cast(PollingMethod, ARMPolling( + lro_delay, + + + **kwargs + )) # type: PollingMethod + elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( @@ -673,17 +712,20 @@ def _update_initial( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: _models.IntegrationServiceEnvironment, **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] + ) -> _models.IntegrationServiceEnvironment: error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] _json = self._serialize.body(integration_service_environment, 'IntegrationServiceEnvironment') @@ -695,11 +737,13 @@ def _update_initial( content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -725,9 +769,9 @@ def begin_update( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: _models.IntegrationServiceEnvironment, **kwargs: Any - ) -> LROPoller["_models.IntegrationServiceEnvironment"]: + ) -> LROPoller[_models.IntegrationServiceEnvironment]: """Updates an integration service environment. :param resource_group: The resource group. @@ -749,37 +793,47 @@ def begin_update( :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.IntegrationServiceEnvironment] polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = self._update_initial( + raw_result = self._update_initial( # type: ignore resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, integration_service_environment=integration_service_environment, api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() + if polling is True: + polling_method = cast(PollingMethod, ARMPolling( + lro_delay, + + + **kwargs + )) # type: PollingMethod + elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( @@ -810,13 +864,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -825,11 +882,13 @@ def delete( # pylint: disable=inconsistent-return-statements integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -865,13 +924,16 @@ def restart( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_restart_request( @@ -880,11 +942,13 @@ def restart( # pylint: disable=inconsistent-return-statements integration_service_environment_name=integration_service_environment_name, api_version=api_version, template_url=self.restart.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_operations.py index 910e567678ed..f6c1648fa104 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -29,55 +30,54 @@ def build_list_request( **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/providers/Microsoft.Logic/operations") # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`operations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( self, **kwargs: Any - ) -> Iterable["_models.OperationListResult"]: + ) -> Iterable[_models.OperationListResult]: """Lists all of the available Logic REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response @@ -85,31 +85,38 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: request = build_list_request( api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: request = build_list_request( api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_patch.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_patch.py new file mode 100644 index 000000000000..0ad201a8c586 --- /dev/null +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_patch.py @@ -0,0 +1,19 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_repetitions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_repetitions_operations.py index 9d6c7a9938aa..7d319eeba5d8 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_repetitions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_repetitions_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -34,9 +35,12 @@ def build_list_request( action_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions") # pylint: disable=line-too-long path_format_arguments = { @@ -50,18 +54,16 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -75,9 +77,12 @@ def build_get_request( repetition_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,18 +97,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -117,9 +120,12 @@ def build_list_expression_traces_request( repetition_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces") # pylint: disable=line-too-long path_format_arguments = { @@ -134,42 +140,38 @@ def build_list_expression_traces_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowRunActionRepetitionsOperations(object): - """WorkflowRunActionRepetitionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowRunActionRepetitionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_run_action_repetitions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -179,7 +181,7 @@ def list( run_name: str, action_name: str, **kwargs: Any - ) -> Iterable["_models.WorkflowRunActionRepetitionDefinitionCollection"]: + ) -> Iterable[_models.WorkflowRunActionRepetitionDefinitionCollection]: """Get all of a workflow run action repetitions. :param resource_group_name: The resource group name. @@ -197,13 +199,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinitionCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -215,9 +220,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -229,9 +236,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -274,7 +283,7 @@ def get( action_name: str, repetition_name: str, **kwargs: Any - ) -> "_models.WorkflowRunActionRepetitionDefinition": + ) -> _models.WorkflowRunActionRepetitionDefinition: """Get a workflow run action repetition. :param resource_group_name: The resource group name. @@ -292,13 +301,16 @@ def get( :rtype: ~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinition] request = build_get_request( @@ -310,11 +322,13 @@ def get( repetition_name=repetition_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -345,7 +359,7 @@ def list_expression_traces( action_name: str, repetition_name: str, **kwargs: Any - ) -> Iterable["_models.ExpressionTraces"]: + ) -> Iterable[_models.ExpressionTraces]: """Lists a workflow run expression trace. :param resource_group_name: The resource group name. @@ -363,13 +377,16 @@ def list_expression_traces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ExpressionTraces] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.ExpressionTraces] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressionTraces"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -382,9 +399,11 @@ def prepare_request(next_link=None): repetition_name=repetition_name, api_version=api_version, template_url=self.list_expression_traces.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -397,9 +416,11 @@ def prepare_request(next_link=None): repetition_name=repetition_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_repetitions_request_histories_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_repetitions_request_histories_operations.py index 58e08e200e2f..9ecb0806a7db 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_repetitions_request_histories_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_repetitions_request_histories_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -35,9 +36,12 @@ def build_list_request( repetition_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories") # pylint: disable=line-too-long path_format_arguments = { @@ -52,18 +56,16 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -78,9 +80,12 @@ def build_get_request( request_history_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}") # pylint: disable=line-too-long path_format_arguments = { @@ -96,42 +101,38 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowRunActionRepetitionsRequestHistoriesOperations(object): - """WorkflowRunActionRepetitionsRequestHistoriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowRunActionRepetitionsRequestHistoriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_run_action_repetitions_request_histories` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -142,7 +143,7 @@ def list( action_name: str, repetition_name: str, **kwargs: Any - ) -> Iterable["_models.RequestHistoryListResult"]: + ) -> Iterable[_models.RequestHistoryListResult]: """List a workflow run repetition request history. :param resource_group_name: The resource group name. @@ -161,13 +162,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.RequestHistoryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.RequestHistoryListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistoryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -180,9 +184,11 @@ def prepare_request(next_link=None): repetition_name=repetition_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -195,9 +201,11 @@ def prepare_request(next_link=None): repetition_name=repetition_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -241,7 +249,7 @@ def get( repetition_name: str, request_history_name: str, **kwargs: Any - ) -> "_models.RequestHistory": + ) -> _models.RequestHistory: """Gets a workflow run repetition request history. :param resource_group_name: The resource group name. @@ -261,13 +269,16 @@ def get( :rtype: ~azure.mgmt.logic.models.RequestHistory :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.RequestHistory] request = build_get_request( @@ -280,11 +291,13 @@ def get( request_history_name=request_history_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_request_histories_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_request_histories_operations.py index 908eb9943dff..2f00a24e44d4 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_request_histories_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_request_histories_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -34,9 +35,12 @@ def build_list_request( action_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories") # pylint: disable=line-too-long path_format_arguments = { @@ -50,18 +54,16 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -75,9 +77,12 @@ def build_get_request( request_history_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,42 +97,38 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowRunActionRequestHistoriesOperations(object): - """WorkflowRunActionRequestHistoriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowRunActionRequestHistoriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_run_action_request_histories` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -137,7 +138,7 @@ def list( run_name: str, action_name: str, **kwargs: Any - ) -> Iterable["_models.RequestHistoryListResult"]: + ) -> Iterable[_models.RequestHistoryListResult]: """List a workflow run request history. :param resource_group_name: The resource group name. @@ -154,13 +155,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.RequestHistoryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.RequestHistoryListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistoryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -172,9 +176,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -186,9 +192,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -231,7 +239,7 @@ def get( action_name: str, request_history_name: str, **kwargs: Any - ) -> "_models.RequestHistory": + ) -> _models.RequestHistory: """Gets a workflow run request history. :param resource_group_name: The resource group name. @@ -249,13 +257,16 @@ def get( :rtype: ~azure.mgmt.logic.models.RequestHistory :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.RequestHistory] request = build_get_request( @@ -267,11 +278,13 @@ def get( request_history_name=request_history_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_scope_repetitions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_scope_repetitions_operations.py index af2a611309b2..6e166760c7a2 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_scope_repetitions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_action_scope_repetitions_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -34,9 +35,12 @@ def build_list_request( action_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions") # pylint: disable=line-too-long path_format_arguments = { @@ -50,18 +54,16 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -75,9 +77,12 @@ def build_get_request( repetition_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions/{repetitionName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,42 +97,38 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowRunActionScopeRepetitionsOperations(object): - """WorkflowRunActionScopeRepetitionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowRunActionScopeRepetitionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_run_action_scope_repetitions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -137,7 +138,7 @@ def list( run_name: str, action_name: str, **kwargs: Any - ) -> Iterable["_models.WorkflowRunActionRepetitionDefinitionCollection"]: + ) -> Iterable[_models.WorkflowRunActionRepetitionDefinitionCollection]: """List the workflow run action scoped repetitions. :param resource_group_name: The resource group name. @@ -155,13 +156,16 @@ def list( ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinitionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinitionCollection] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinitionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -173,9 +177,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -187,9 +193,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -232,7 +240,7 @@ def get( action_name: str, repetition_name: str, **kwargs: Any - ) -> "_models.WorkflowRunActionRepetitionDefinition": + ) -> _models.WorkflowRunActionRepetitionDefinition: """Get a workflow run action scoped repetition. :param resource_group_name: The resource group name. @@ -250,13 +258,16 @@ def get( :rtype: ~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinition"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinition] request = build_get_request( @@ -268,11 +279,13 @@ def get( repetition_name=repetition_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_actions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_actions_operations.py index 7bc663fef436..7cf3c44c649b 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_actions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_actions_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -36,9 +37,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions") # pylint: disable=line-too-long path_format_arguments = { @@ -51,22 +55,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -79,9 +81,12 @@ def build_get_request( action_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}") # pylint: disable=line-too-long path_format_arguments = { @@ -95,18 +100,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -119,9 +122,12 @@ def build_list_expression_traces_request( action_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/listExpressionTraces") # pylint: disable=line-too-long path_format_arguments = { @@ -135,42 +141,38 @@ def build_list_expression_traces_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowRunActionsOperations(object): - """WorkflowRunActionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowRunActionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_run_actions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -181,7 +183,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowRunActionListResult"]: + ) -> Iterable[_models.WorkflowRunActionListResult]: """Gets a list of workflow run actions. :param resource_group_name: The resource group name. @@ -201,13 +203,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunActionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunActionListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -220,9 +225,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -235,9 +242,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -279,7 +288,7 @@ def get( run_name: str, action_name: str, **kwargs: Any - ) -> "_models.WorkflowRunAction": + ) -> _models.WorkflowRunAction: """Gets a workflow run action. :param resource_group_name: The resource group name. @@ -295,13 +304,16 @@ def get( :rtype: ~azure.mgmt.logic.models.WorkflowRunAction :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunAction"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunAction] request = build_get_request( @@ -312,11 +324,13 @@ def get( action_name=action_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -346,7 +360,7 @@ def list_expression_traces( run_name: str, action_name: str, **kwargs: Any - ) -> Iterable["_models.ExpressionTraces"]: + ) -> Iterable[_models.ExpressionTraces]: """Lists a workflow run expression trace. :param resource_group_name: The resource group name. @@ -362,13 +376,16 @@ def list_expression_traces( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ExpressionTraces] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.ExpressionTraces] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ExpressionTraces"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -380,9 +397,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=self.list_expression_traces.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -394,9 +413,11 @@ def prepare_request(next_link=None): action_name=action_name, api_version=api_version, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_operations_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_operations_operations.py index 188c400fa26e..43d658f6a1b5 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_operations_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_run_operations_operations.py @@ -15,6 +15,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -33,9 +34,12 @@ def build_get_request( operation_id: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/operations/{operationId}") # pylint: disable=line-too-long path_format_arguments = { @@ -49,42 +53,38 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowRunOperationsOperations(object): - """WorkflowRunOperationsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowRunOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_run_operations` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def get( @@ -94,7 +94,7 @@ def get( run_name: str, operation_id: str, **kwargs: Any - ) -> "_models.WorkflowRun": + ) -> _models.WorkflowRun: """Gets an operation for a run. :param resource_group_name: The resource group name. @@ -110,13 +110,16 @@ def get( :rtype: ~azure.mgmt.logic.models.WorkflowRun :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRun"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRun] request = build_get_request( @@ -127,11 +130,13 @@ def get( operation_id=operation_id, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_runs_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_runs_operations.py index 912ab0782a57..3f9019def784 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_runs_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_runs_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -35,9 +36,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs") # pylint: disable=line-too-long path_format_arguments = { @@ -49,22 +53,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -76,9 +78,12 @@ def build_get_request( run_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}") # pylint: disable=line-too-long path_format_arguments = { @@ -91,18 +96,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -114,9 +117,12 @@ def build_cancel_request( run_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel") # pylint: disable=line-too-long path_format_arguments = { @@ -129,42 +135,38 @@ def build_cancel_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowRunsOperations(object): - """WorkflowRunsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowRunsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_runs` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -174,7 +176,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowRunListResult"]: + ) -> Iterable[_models.WorkflowRunListResult]: """Gets a list of workflow runs. :param resource_group_name: The resource group name. @@ -192,13 +194,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRunListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -210,9 +215,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -224,9 +231,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -267,7 +276,7 @@ def get( workflow_name: str, run_name: str, **kwargs: Any - ) -> "_models.WorkflowRun": + ) -> _models.WorkflowRun: """Gets a workflow run. :param resource_group_name: The resource group name. @@ -281,13 +290,16 @@ def get( :rtype: ~azure.mgmt.logic.models.WorkflowRun :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRun"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowRun] request = build_get_request( @@ -297,11 +309,13 @@ def get( run_name=run_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -344,13 +358,16 @@ def cancel( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_cancel_request( @@ -360,11 +377,13 @@ def cancel( # pylint: disable=inconsistent-return-statements run_name=run_name, api_version=api_version, template_url=self.cancel.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_trigger_histories_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_trigger_histories_operations.py index 273c5b799460..29dc52b20528 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_trigger_histories_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_trigger_histories_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -36,9 +37,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories") # pylint: disable=line-too-long path_format_arguments = { @@ -51,22 +55,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -79,9 +81,12 @@ def build_get_request( history_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}") # pylint: disable=line-too-long path_format_arguments = { @@ -95,18 +100,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -119,9 +122,12 @@ def build_resubmit_request( history_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit") # pylint: disable=line-too-long path_format_arguments = { @@ -135,42 +141,38 @@ def build_resubmit_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowTriggerHistoriesOperations(object): - """WorkflowTriggerHistoriesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowTriggerHistoriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_trigger_histories` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -181,7 +183,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowTriggerHistoryListResult"]: + ) -> Iterable[_models.WorkflowTriggerHistoryListResult]: """Gets a list of workflow trigger histories. :param resource_group_name: The resource group name. @@ -201,13 +203,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowTriggerHistoryListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerHistoryListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerHistoryListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -220,9 +225,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -235,9 +242,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -279,7 +288,7 @@ def get( trigger_name: str, history_name: str, **kwargs: Any - ) -> "_models.WorkflowTriggerHistory": + ) -> _models.WorkflowTriggerHistory: """Gets a workflow trigger history. :param resource_group_name: The resource group name. @@ -296,13 +305,16 @@ def get( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerHistory :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerHistory"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerHistory] request = build_get_request( @@ -313,11 +325,13 @@ def get( history_name=history_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -364,13 +378,16 @@ def resubmit( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_resubmit_request( @@ -381,11 +398,13 @@ def resubmit( # pylint: disable=inconsistent-return-statements history_name=history_name, api_version=api_version, template_url=self.resubmit.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_triggers_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_triggers_operations.py index e8390689bcbf..9812e9d172ba 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_triggers_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_triggers_operations.py @@ -16,12 +16,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -36,9 +36,12 @@ def build_list_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers") # pylint: disable=line-too-long path_format_arguments = { @@ -50,22 +53,20 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -77,9 +78,12 @@ def build_get_request( trigger_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}") # pylint: disable=line-too-long path_format_arguments = { @@ -92,18 +96,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -115,9 +117,12 @@ def build_reset_request( trigger_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/reset") # pylint: disable=line-too-long path_format_arguments = { @@ -130,18 +135,16 @@ def build_reset_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -153,9 +156,12 @@ def build_run_request( trigger_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run") # pylint: disable=line-too-long path_format_arguments = { @@ -168,18 +174,16 @@ def build_run_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -191,9 +195,12 @@ def build_get_schema_json_request( trigger_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/schemas/json") # pylint: disable=line-too-long path_format_arguments = { @@ -206,18 +213,16 @@ def build_get_schema_json_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -228,14 +233,17 @@ def build_set_state_request( workflow_name: str, trigger_name: str, *, - json: JSONType = None, + json: Optional[_models.SetTriggerStateActionDefinition] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/setState") # pylint: disable=line-too-long path_format_arguments = { @@ -248,20 +256,18 @@ def build_set_state_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -275,9 +281,12 @@ def build_list_callback_url_request( trigger_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -290,42 +299,38 @@ def build_list_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowTriggersOperations(object): - """WorkflowTriggersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowTriggersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_triggers` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -335,7 +340,7 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowTriggerListResult"]: + ) -> Iterable[_models.WorkflowTriggerListResult]: """Gets a list of workflow triggers. :param resource_group_name: The resource group name. @@ -352,13 +357,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowTriggerListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -370,9 +378,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -384,9 +394,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -427,7 +439,7 @@ def get( workflow_name: str, trigger_name: str, **kwargs: Any - ) -> "_models.WorkflowTrigger": + ) -> _models.WorkflowTrigger: """Gets a workflow trigger. :param resource_group_name: The resource group name. @@ -441,13 +453,16 @@ def get( :rtype: ~azure.mgmt.logic.models.WorkflowTrigger :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTrigger"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTrigger] request = build_get_request( @@ -457,11 +472,13 @@ def get( trigger_name=trigger_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -504,13 +521,16 @@ def reset( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_reset_request( @@ -520,11 +540,13 @@ def reset( # pylint: disable=inconsistent-return-statements trigger_name=trigger_name, api_version=api_version, template_url=self.reset.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -563,13 +585,16 @@ def run( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_run_request( @@ -579,11 +604,13 @@ def run( # pylint: disable=inconsistent-return-statements trigger_name=trigger_name, api_version=api_version, template_url=self.run.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -608,7 +635,7 @@ def get_schema_json( workflow_name: str, trigger_name: str, **kwargs: Any - ) -> "_models.JsonSchema": + ) -> _models.JsonSchema: """Get the trigger schema as JSON. :param resource_group_name: The resource group name. @@ -622,13 +649,16 @@ def get_schema_json( :rtype: ~azure.mgmt.logic.models.JsonSchema :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JsonSchema"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.JsonSchema] request = build_get_schema_json_request( @@ -638,11 +668,13 @@ def get_schema_json( trigger_name=trigger_name, api_version=api_version, template_url=self.get_schema_json.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -670,7 +702,7 @@ def set_state( # pylint: disable=inconsistent-return-statements resource_group_name: str, workflow_name: str, trigger_name: str, - set_state: "_models.SetTriggerStateActionDefinition", + set_state: _models.SetTriggerStateActionDefinition, **kwargs: Any ) -> None: """Sets the state of a workflow trigger. @@ -688,14 +720,17 @@ def set_state( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(set_state, 'SetTriggerStateActionDefinition') @@ -708,11 +743,13 @@ def set_state( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, template_url=self.set_state.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -737,7 +774,7 @@ def list_callback_url( workflow_name: str, trigger_name: str, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the callback URL for a workflow trigger. :param resource_group_name: The resource group name. @@ -751,13 +788,16 @@ def list_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] request = build_list_callback_url_request( @@ -767,11 +807,13 @@ def list_callback_url( trigger_name=trigger_name, api_version=api_version, template_url=self.list_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_version_triggers_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_version_triggers_operations.py index 152e2aea24ae..fe31e2f26d8b 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_version_triggers_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_version_triggers_operations.py @@ -15,12 +15,12 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -33,14 +33,17 @@ def build_list_callback_url_request( version_id: str, trigger_name: str, *, - json: JSONType = None, + json: Optional[_models.GetCallbackUrlParameters] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -54,46 +57,42 @@ def build_list_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs ) -class WorkflowVersionTriggersOperations(object): - """WorkflowVersionTriggersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowVersionTriggersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_version_triggers` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list_callback_url( @@ -102,9 +101,9 @@ def list_callback_url( workflow_name: str, version_id: str, trigger_name: str, - parameters: Optional["_models.GetCallbackUrlParameters"] = None, + parameters: Optional[_models.GetCallbackUrlParameters] = None, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the callback url for a trigger of a workflow version. :param resource_group_name: The resource group name. @@ -122,14 +121,17 @@ def list_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] if parameters is not None: _json = self._serialize.body(parameters, 'GetCallbackUrlParameters') @@ -146,11 +148,13 @@ def list_callback_url( content_type=content_type, json=_json, template_url=self.list_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_versions_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_versions_operations.py index 8b0e2802a123..218fb2c1b6bf 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_versions_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflow_versions_operations.py @@ -16,6 +16,7 @@ from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from .. import models as _models @@ -34,9 +35,12 @@ def build_list_request( top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions") # pylint: disable=line-too-long path_format_arguments = { @@ -48,20 +52,18 @@ def build_list_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -73,9 +75,12 @@ def build_get_request( version_id: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}") # pylint: disable=line-too-long path_format_arguments = { @@ -88,42 +93,38 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) -class WorkflowVersionsOperations(object): - """WorkflowVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflow_versions` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list( @@ -132,7 +133,7 @@ def list( workflow_name: str, top: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowVersionListResult"]: + ) -> Iterable[_models.WorkflowVersionListResult]: """Gets a list of workflow versions. :param resource_group_name: The resource group name. @@ -147,13 +148,16 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowVersionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowVersionListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowVersionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -164,9 +168,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=self.list.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -177,9 +183,11 @@ def prepare_request(next_link=None): api_version=api_version, top=top, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -220,7 +228,7 @@ def get( workflow_name: str, version_id: str, **kwargs: Any - ) -> "_models.WorkflowVersion": + ) -> _models.WorkflowVersion: """Gets a workflow version. :param resource_group_name: The resource group name. @@ -234,13 +242,16 @@ def get( :rtype: ~azure.mgmt.logic.models.WorkflowVersion :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowVersion"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowVersion] request = build_get_request( @@ -250,11 +261,13 @@ def get( version_id=version_id, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflows_operations.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflows_operations.py index 8aaa77ccc7cd..f3aeb6e4d42d 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflows_operations.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_workflows_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union, cast from msrest import Serializer @@ -17,13 +17,13 @@ from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._vendor import _convert_request, _format_url_section T = TypeVar('T') -JSONType = Any ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -36,9 +36,12 @@ def build_list_by_subscription_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/workflows") path_format_arguments = { @@ -48,22 +51,20 @@ def build_list_by_subscription_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -76,9 +77,12 @@ def build_list_by_resource_group_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows") # pylint: disable=line-too-long path_format_arguments = { @@ -89,22 +93,20 @@ def build_list_by_resource_group_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if top is not None: - _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int') + _params['$top'] = _SERIALIZER.query("top", top, 'int') if filter is not None: - _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _params['$filter'] = _SERIALIZER.query("filter", filter, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -115,9 +117,12 @@ def build_get_request( workflow_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}") # pylint: disable=line-too-long path_format_arguments = { @@ -129,18 +134,16 @@ def build_get_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -150,14 +153,17 @@ def build_create_or_update_request( resource_group_name: str, workflow_name: str, *, - json: JSONType = None, + json: Optional[_models.Workflow] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}") # pylint: disable=line-too-long path_format_arguments = { @@ -169,20 +175,18 @@ def build_create_or_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -195,9 +199,12 @@ def build_update_request( workflow_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}") # pylint: disable=line-too-long path_format_arguments = { @@ -209,18 +216,16 @@ def build_update_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -231,9 +236,12 @@ def build_delete_request( workflow_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}") # pylint: disable=line-too-long path_format_arguments = { @@ -245,18 +253,16 @@ def build_delete_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -267,9 +273,12 @@ def build_disable_request( workflow_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable") # pylint: disable=line-too-long path_format_arguments = { @@ -281,18 +290,16 @@ def build_disable_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -303,9 +310,12 @@ def build_enable_request( workflow_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable") # pylint: disable=line-too-long path_format_arguments = { @@ -317,18 +327,16 @@ def build_enable_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -338,14 +346,17 @@ def build_generate_upgraded_definition_request( resource_group_name: str, workflow_name: str, *, - json: JSONType = None, + json: Optional[_models.GenerateUpgradedDefinitionParameters] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/generateUpgradedDefinition") # pylint: disable=line-too-long path_format_arguments = { @@ -357,20 +368,18 @@ def build_generate_upgraded_definition_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -382,14 +391,17 @@ def build_list_callback_url_request( resource_group_name: str, workflow_name: str, *, - json: JSONType = None, + json: Optional[_models.GetCallbackUrlParameters] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listCallbackUrl") # pylint: disable=line-too-long path_format_arguments = { @@ -401,20 +413,18 @@ def build_list_callback_url_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -427,9 +437,12 @@ def build_list_swagger_request( workflow_name: str, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _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', "2019-05-01")) # type: str + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listSwagger") # pylint: disable=line-too-long path_format_arguments = { @@ -441,18 +454,16 @@ def build_list_swagger_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, **kwargs ) @@ -462,14 +473,17 @@ def build_move_request_initial( resource_group_name: str, workflow_name: str, *, - json: JSONType = None, + json: Optional[_models.WorkflowReference] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move") # pylint: disable=line-too-long path_format_arguments = { @@ -481,20 +495,18 @@ def build_move_request_initial( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -506,14 +518,17 @@ def build_regenerate_access_key_request( resource_group_name: str, workflow_name: str, *, - json: JSONType = None, + json: Optional[_models.RegenerateActionParameter] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey") # pylint: disable=line-too-long path_format_arguments = { @@ -525,20 +540,18 @@ def build_regenerate_access_key_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -550,14 +563,17 @@ def build_validate_by_resource_group_request( resource_group_name: str, workflow_name: str, *, - json: JSONType = None, + json: Optional[_models.Workflow] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate") # pylint: disable=line-too-long path_format_arguments = { @@ -569,20 +585,18 @@ def build_validate_by_resource_group_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs @@ -595,14 +609,17 @@ def build_validate_by_location_request( location: str, workflow_name: str, *, - json: JSONType = None, + json: Optional[_models.Workflow] = None, content: Any = None, **kwargs: Any ) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] + accept = _headers.pop('Accept', "application/json") - accept = "application/json" # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate") # pylint: disable=line-too-long path_format_arguments = { @@ -615,46 +632,42 @@ def build_validate_by_location_request( _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", url=_url, - params=_query_parameters, - headers=_header_parameters, + params=_params, + headers=_headers, json=json, content=content, **kwargs ) -class WorkflowsOperations(object): - """WorkflowsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class WorkflowsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.logic.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~azure.mgmt.logic.LogicManagementClient`'s + :attr:`workflows` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace def list_by_subscription( @@ -662,7 +675,7 @@ def list_by_subscription( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowListResult"]: + ) -> Iterable[_models.WorkflowListResult]: """Gets a list of workflows by subscription. :param top: The number of items to be included in the result. Default value is None. @@ -675,13 +688,16 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -691,9 +707,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list_by_subscription.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -703,9 +721,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -746,7 +766,7 @@ def list_by_resource_group( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowListResult"]: + ) -> Iterable[_models.WorkflowListResult]: """Gets a list of workflows by resource group. :param resource_group_name: The resource group name. @@ -761,13 +781,16 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowListResult] - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) def prepare_request(next_link=None): if not next_link: @@ -778,9 +801,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=self.list_by_resource_group.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore else: @@ -791,9 +816,11 @@ def prepare_request(next_link=None): top=top, filter=filter, template_url=next_link, + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore request.method = "GET" return request @@ -833,7 +860,7 @@ def get( resource_group_name: str, workflow_name: str, **kwargs: Any - ) -> "_models.Workflow": + ) -> _models.Workflow: """Gets a workflow. :param resource_group_name: The resource group name. @@ -845,13 +872,16 @@ def get( :rtype: ~azure.mgmt.logic.models.Workflow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.Workflow] request = build_get_request( @@ -860,11 +890,13 @@ def get( workflow_name=workflow_name, api_version=api_version, template_url=self.get.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -891,9 +923,9 @@ def create_or_update( self, resource_group_name: str, workflow_name: str, - workflow: "_models.Workflow", + workflow: _models.Workflow, **kwargs: Any - ) -> "_models.Workflow": + ) -> _models.Workflow: """Creates or updates a workflow. :param resource_group_name: The resource group name. @@ -907,14 +939,17 @@ def create_or_update( :rtype: ~azure.mgmt.logic.models.Workflow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.Workflow] _json = self._serialize.body(workflow, 'Workflow') @@ -926,11 +961,13 @@ def create_or_update( content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -962,7 +999,7 @@ def update( resource_group_name: str, workflow_name: str, **kwargs: Any - ) -> "_models.Workflow": + ) -> _models.Workflow: """Updates a workflow. :param resource_group_name: The resource group name. @@ -974,13 +1011,16 @@ def update( :rtype: ~azure.mgmt.logic.models.Workflow :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[_models.Workflow] request = build_update_request( @@ -989,11 +1029,13 @@ def update( workflow_name=workflow_name, api_version=api_version, template_url=self.update.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1033,13 +1075,16 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_delete_request( @@ -1048,11 +1093,13 @@ def delete( # pylint: disable=inconsistent-return-statements workflow_name=workflow_name, api_version=api_version, template_url=self.delete.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1088,13 +1135,16 @@ def disable( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_disable_request( @@ -1103,11 +1153,13 @@ def disable( # pylint: disable=inconsistent-return-statements workflow_name=workflow_name, api_version=api_version, template_url=self.disable.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1143,13 +1195,16 @@ def enable( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[None] request = build_enable_request( @@ -1158,11 +1213,13 @@ def enable( # pylint: disable=inconsistent-return-statements workflow_name=workflow_name, api_version=api_version, template_url=self.enable.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1185,7 +1242,7 @@ def generate_upgraded_definition( self, resource_group_name: str, workflow_name: str, - parameters: "_models.GenerateUpgradedDefinitionParameters", + parameters: _models.GenerateUpgradedDefinitionParameters, **kwargs: Any ) -> Any: """Generates the upgraded definition for a workflow. @@ -1201,14 +1258,17 @@ def generate_upgraded_definition( :rtype: any :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[Any] _json = self._serialize.body(parameters, 'GenerateUpgradedDefinitionParameters') @@ -1220,11 +1280,13 @@ def generate_upgraded_definition( content_type=content_type, json=_json, template_url=self.generate_upgraded_definition.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1251,9 +1313,9 @@ def list_callback_url( self, resource_group_name: str, workflow_name: str, - list_callback_url: "_models.GetCallbackUrlParameters", + list_callback_url: _models.GetCallbackUrlParameters, **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the workflow callback Url. :param resource_group_name: The resource group name. @@ -1267,14 +1329,17 @@ def list_callback_url( :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] _json = self._serialize.body(list_callback_url, 'GetCallbackUrlParameters') @@ -1286,11 +1351,13 @@ def list_callback_url( content_type=content_type, json=_json, template_url=self.list_callback_url.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1330,13 +1397,16 @@ def list_swagger( :rtype: any :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + cls = kwargs.pop('cls', None) # type: ClsType[Any] request = build_list_swagger_request( @@ -1345,11 +1415,13 @@ def list_swagger( workflow_name=workflow_name, api_version=api_version, template_url=self.list_swagger.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1375,17 +1447,20 @@ def _move_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workflow_name: str, - move: "_models.WorkflowReference", + move: _models.WorkflowReference, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(move, 'WorkflowReference') @@ -1397,11 +1472,13 @@ def _move_initial( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, template_url=self._move_initial.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1423,7 +1500,7 @@ def begin_move( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workflow_name: str, - move: "_models.WorkflowReference", + move: _models.WorkflowReference, **kwargs: Any ) -> LROPoller[None]: """Moves an existing workflow. @@ -1446,23 +1523,28 @@ def begin_move( # pylint: disable=inconsistent-return-statements :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] 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 ) cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] if cont_token is None: - raw_result = self._move_initial( + raw_result = self._move_initial( # type: ignore resource_group_name=resource_group_name, workflow_name=workflow_name, move=move, api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, + headers=_headers, + params=_params, **kwargs ) kwargs.pop('error_map', None) @@ -1472,8 +1554,14 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() + if polling is True: + polling_method = cast(PollingMethod, ARMPolling( + lro_delay, + + + **kwargs + )) # type: PollingMethod + elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: return LROPoller.from_continuation_token( @@ -1491,7 +1579,7 @@ def regenerate_access_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workflow_name: str, - key_type: "_models.RegenerateActionParameter", + key_type: _models.RegenerateActionParameter, **kwargs: Any ) -> None: """Regenerates the callback URL access key for request triggers. @@ -1507,14 +1595,17 @@ def regenerate_access_key( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(key_type, 'RegenerateActionParameter') @@ -1526,11 +1617,13 @@ def regenerate_access_key( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, template_url=self.regenerate_access_key.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1553,7 +1646,7 @@ def validate_by_resource_group( # pylint: disable=inconsistent-return-statement self, resource_group_name: str, workflow_name: str, - validate: "_models.Workflow", + validate: _models.Workflow, **kwargs: Any ) -> None: """Validates the workflow. @@ -1569,14 +1662,17 @@ def validate_by_resource_group( # pylint: disable=inconsistent-return-statement :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + _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', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(validate, 'Workflow') @@ -1588,11 +1684,13 @@ def validate_by_resource_group( # pylint: disable=inconsistent-return-statement content_type=content_type, json=_json, template_url=self.validate_by_resource_group.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs @@ -1616,7 +1714,7 @@ def validate_by_location( # pylint: disable=inconsistent-return-statements resource_group_name: str, location: str, workflow_name: str, - validate: "_models.Workflow", + validate: _models.Workflow, **kwargs: Any ) -> None: """Validates the workflow definition. @@ -1634,14 +1732,17 @@ def validate_by_location( # pylint: disable=inconsistent-return-statements :rtype: None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop('error_map', {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + api_version = kwargs.pop('api_version', _params.pop('api-version', "2019-05-01")) # type: str + content_type = kwargs.pop('content_type', _headers.pop('Content-Type', "application/json")) # type: Optional[str] + cls = kwargs.pop('cls', None) # type: ClsType[None] _json = self._serialize.body(validate, 'Workflow') @@ -1654,11 +1755,13 @@ def validate_by_location( # pylint: disable=inconsistent-return-statements content_type=content_type, json=_json, template_url=self.validate_by_location.metadata['url'], + headers=_headers, + params=_params, ) request = _convert_request(request) - request.url = self._client.format_url(request.url) + request.url = self._client.format_url(request.url) # type: ignore - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access request, stream=False, **kwargs