diff --git a/sdk/logic/azure-mgmt-logic/_meta.json b/sdk/logic/azure-mgmt-logic/_meta.json index dced201649e5..ffcbad1d09b6 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", + "autorest": "3.8.4", "use": [ - "@autorest/python@5.13.0", - "@autorest/modelerfour@4.19.3" + "@autorest/python@6.1.6", + "@autorest/modelerfour@4.23.5" ], - "commit": "2d6cb29af754f48a08f94cb6113bb1f01a4e0eb9", + "commit": "e51e32301b4a358c91bab7e831690121999531ea", "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 --use=@autorest/python@6.1.6 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False", "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..c28525a4d254 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,15 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['LogicManagementClient'] -# `._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() +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_sdk() diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_configuration.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_configuration.py index dd393060c67a..e2e1cd2af7b1 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_configuration.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_configuration.py @@ -25,23 +25,18 @@ class LogicManagementClientConfiguration(Configuration): # pylint: disable=too- Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription id. + :param subscription_id: The subscription id. Required. :type subscription_id: str :keyword api_version: Api Version. Default value is "2019-05-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(LogicManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop("api_version", "2019-05-01") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,23 +46,24 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-logic/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-logic/{}".format(VERSION)) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) 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..61d8e9a62d5b 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 @@ -9,20 +9,48 @@ from copy import deepcopy from typing import Any, TYPE_CHECKING -from msrest import Deserializer, Serializer - from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient from . import models from ._configuration import LogicManagementClientConfiguration -from .operations import IntegrationAccountAgreementsOperations, IntegrationAccountAssembliesOperations, IntegrationAccountBatchConfigurationsOperations, IntegrationAccountCertificatesOperations, IntegrationAccountMapsOperations, IntegrationAccountPartnersOperations, IntegrationAccountSchemasOperations, IntegrationAccountSessionsOperations, IntegrationAccountsOperations, IntegrationServiceEnvironmentManagedApiOperationsOperations, IntegrationServiceEnvironmentManagedApisOperations, IntegrationServiceEnvironmentNetworkHealthOperations, IntegrationServiceEnvironmentSkusOperations, IntegrationServiceEnvironmentsOperations, Operations, WorkflowRunActionRepetitionsOperations, WorkflowRunActionRepetitionsRequestHistoriesOperations, WorkflowRunActionRequestHistoriesOperations, WorkflowRunActionScopeRepetitionsOperations, WorkflowRunActionsOperations, WorkflowRunOperationsOperations, WorkflowRunsOperations, WorkflowTriggerHistoriesOperations, WorkflowTriggersOperations, WorkflowVersionTriggersOperations, WorkflowVersionsOperations, WorkflowsOperations +from ._serialization import Deserializer, Serializer +from .operations import ( + IntegrationAccountAgreementsOperations, + IntegrationAccountAssembliesOperations, + IntegrationAccountBatchConfigurationsOperations, + IntegrationAccountCertificatesOperations, + IntegrationAccountMapsOperations, + IntegrationAccountPartnersOperations, + IntegrationAccountSchemasOperations, + IntegrationAccountSessionsOperations, + IntegrationAccountsOperations, + IntegrationServiceEnvironmentManagedApiOperationsOperations, + IntegrationServiceEnvironmentManagedApisOperations, + IntegrationServiceEnvironmentNetworkHealthOperations, + IntegrationServiceEnvironmentSkusOperations, + IntegrationServiceEnvironmentsOperations, + Operations, + WorkflowRunActionRepetitionsOperations, + WorkflowRunActionRepetitionsRequestHistoriesOperations, + WorkflowRunActionRequestHistoriesOperations, + WorkflowRunActionScopeRepetitionsOperations, + WorkflowRunActionsOperations, + WorkflowRunOperationsOperations, + WorkflowRunsOperations, + WorkflowTriggerHistoriesOperations, + WorkflowTriggersOperations, + WorkflowVersionTriggersOperations, + WorkflowVersionsOperations, + WorkflowsOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class LogicManagementClient: # pylint: disable=too-many-instance-attributes + +class LogicManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """REST API for Azure Logic Apps. :ivar workflows: WorkflowsOperations operations @@ -105,9 +133,9 @@ class LogicManagementClient: # pylint: disable=too-many-instance-attributes azure.mgmt.logic.operations.IntegrationServiceEnvironmentManagedApiOperationsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.logic.operations.Operations - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription id. + :param subscription_id: The subscription id. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str @@ -125,7 +153,9 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = LogicManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._config = LogicManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -133,39 +163,84 @@ def __init__( 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_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.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( - self, - request: HttpRequest, - **kwargs: Any - ) -> HttpResponse: + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -174,7 +249,7 @@ def _send_request( >>> response = client._send_request(request) - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_patch.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_patch.py index 74e48ecd07cf..f99e77fef986 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_patch.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_patch.py @@ -28,4 +28,4 @@ # This file 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 def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_serialization.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_serialization.py new file mode 100644 index 000000000000..7c1dedb5133d --- /dev/null +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_serialization.py @@ -0,0 +1,1970 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote # type: ignore +import xml.etree.ElementTree as ET + +import isodate + +from typing import Dict, Any, cast, TYPE_CHECKING + +from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +if TYPE_CHECKING: + from typing import Optional, Union, AnyStr, IO, Mapping + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data, content_type=None): + # type: (Optional[Union[AnyStr, IO]], Optional[str]) -> Any + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes, headers): + # type: (Optional[Union[AnyStr, IO]], Mapping) -> Any + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +try: + basestring # type: ignore + unicode_str = unicode # type: ignore +except NameError: + basestring = str # type: ignore + unicode_str = str # type: ignore + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc # type: ignore +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes=None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) + continue + if xml_desc.get("text", False): + serialized.text = new_attr + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = unicode_str(new_attr) + serialized.append(local_node) + else: # JSON + for k in reversed(keys): + unflattened = {k: new_attr} + new_attr = unflattened + + _new_attr = new_attr + _serialized = serialized + for k in keys: + if k not in _serialized: + _serialized.update(_new_attr) + _new_attr = _new_attr[k] + _serialized = _serialized[k] + except ValueError: + continue + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise_with_traceback(SerializationError, msg, err) + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data] + if not kwargs.get("skip_quote", False): + data = [quote(str(d), safe="") for d in data] + return str(self.serialize_iter(data, internal_data_type, **kwargs)) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise_with_traceback(SerializationError, msg.format(data, data_type), err) + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError: + serialized.append(None) + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is unicode_str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) + return result + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise_with_traceback(SerializationError, msg, err) + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise_with_traceback(TypeError, msg, err) + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes=None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, basestring): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name + raise_with_traceback(DeserializationError, msg, err) + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deseralize. + """ + if target is None: + return None, None + + if isinstance(target, basestring): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deseralize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise_with_traceback(DeserializationError, msg, err) + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, basestring): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, basestring): + if attr.lower() in ["true", "1"]: + return True + elif attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + # https://github.com/Azure/azure-rest-api-specs/issues/141 + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) + attr = attr + padding + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(attr) + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise_with_traceback(DeserializationError, msg, err) + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise_with_traceback(DeserializationError, msg, err) + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) + try: + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_vendor.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_vendor.py index 138f663c53a4..9aad73fc743e 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_vendor.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/_vendor.py @@ -7,6 +7,7 @@ from azure.core.pipeline.transport import HttpRequest + def _convert_request(request, files=None): data = request.content if not files else None request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) @@ -14,6 +15,7 @@ def _convert_request(request, files=None): request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -21,7 +23,5 @@ def _format_url_section(template, **kwargs): return template.format(**kwargs) except KeyError as key: formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) 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..a75c7bb4bd72 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,15 @@ # -------------------------------------------------------------------------- from ._logic_management_client import LogicManagementClient -__all__ = ['LogicManagementClient'] -# `._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() +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_sdk() diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_configuration.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_configuration.py index 1b842703551d..4b26b6f87566 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_configuration.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_configuration.py @@ -25,23 +25,18 @@ class LogicManagementClientConfiguration(Configuration): # pylint: disable=too- Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription id. + :param subscription_id: The subscription id. Required. :type subscription_id: str :keyword api_version: Api Version. Default value is "2019-05-01". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(LogicManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2019-05-01") # type: str + api_version = kwargs.pop("api_version", "2019-05-01") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,22 +46,21 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'mgmt-logic/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-logic/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) 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..8302f343835c 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 @@ -9,20 +9,48 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING -from msrest import Deserializer, Serializer - from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from .. import models +from .._serialization import Deserializer, Serializer from ._configuration import LogicManagementClientConfiguration -from .operations import IntegrationAccountAgreementsOperations, IntegrationAccountAssembliesOperations, IntegrationAccountBatchConfigurationsOperations, IntegrationAccountCertificatesOperations, IntegrationAccountMapsOperations, IntegrationAccountPartnersOperations, IntegrationAccountSchemasOperations, IntegrationAccountSessionsOperations, IntegrationAccountsOperations, IntegrationServiceEnvironmentManagedApiOperationsOperations, IntegrationServiceEnvironmentManagedApisOperations, IntegrationServiceEnvironmentNetworkHealthOperations, IntegrationServiceEnvironmentSkusOperations, IntegrationServiceEnvironmentsOperations, Operations, WorkflowRunActionRepetitionsOperations, WorkflowRunActionRepetitionsRequestHistoriesOperations, WorkflowRunActionRequestHistoriesOperations, WorkflowRunActionScopeRepetitionsOperations, WorkflowRunActionsOperations, WorkflowRunOperationsOperations, WorkflowRunsOperations, WorkflowTriggerHistoriesOperations, WorkflowTriggersOperations, WorkflowVersionTriggersOperations, WorkflowVersionsOperations, WorkflowsOperations +from .operations import ( + IntegrationAccountAgreementsOperations, + IntegrationAccountAssembliesOperations, + IntegrationAccountBatchConfigurationsOperations, + IntegrationAccountCertificatesOperations, + IntegrationAccountMapsOperations, + IntegrationAccountPartnersOperations, + IntegrationAccountSchemasOperations, + IntegrationAccountSessionsOperations, + IntegrationAccountsOperations, + IntegrationServiceEnvironmentManagedApiOperationsOperations, + IntegrationServiceEnvironmentManagedApisOperations, + IntegrationServiceEnvironmentNetworkHealthOperations, + IntegrationServiceEnvironmentSkusOperations, + IntegrationServiceEnvironmentsOperations, + Operations, + WorkflowRunActionRepetitionsOperations, + WorkflowRunActionRepetitionsRequestHistoriesOperations, + WorkflowRunActionRequestHistoriesOperations, + WorkflowRunActionScopeRepetitionsOperations, + WorkflowRunActionsOperations, + WorkflowRunOperationsOperations, + WorkflowRunsOperations, + WorkflowTriggerHistoriesOperations, + WorkflowTriggersOperations, + WorkflowVersionTriggersOperations, + WorkflowVersionsOperations, + WorkflowsOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class LogicManagementClient: # pylint: disable=too-many-instance-attributes + +class LogicManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """REST API for Azure Logic Apps. :ivar workflows: WorkflowsOperations operations @@ -107,9 +135,9 @@ class LogicManagementClient: # pylint: disable=too-many-instance-attributes azure.mgmt.logic.aio.operations.IntegrationServiceEnvironmentManagedApiOperationsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.logic.aio.operations.Operations - :param credential: Credential needed for the client to connect to Azure. + :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription id. + :param subscription_id: The subscription id. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str @@ -127,7 +155,9 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = LogicManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._config = LogicManagementClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -135,39 +165,84 @@ def __init__( 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_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.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( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: + def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest @@ -176,7 +251,7 @@ def _send_request( >>> response = await client._send_request(request) - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest diff --git a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_patch.py b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_patch.py index 74e48ecd07cf..f99e77fef986 100644 --- a/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_patch.py +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/_patch.py @@ -28,4 +28,4 @@ # This file 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 def patch_sdk(): - pass \ No newline at end of file + pass 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..91e2700d1e6e 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 @@ -14,7 +14,9 @@ from ._workflow_runs_operations import WorkflowRunsOperations from ._workflow_run_actions_operations import WorkflowRunActionsOperations from ._workflow_run_action_repetitions_operations import WorkflowRunActionRepetitionsOperations -from ._workflow_run_action_repetitions_request_histories_operations import WorkflowRunActionRepetitionsRequestHistoriesOperations +from ._workflow_run_action_repetitions_request_histories_operations import ( + WorkflowRunActionRepetitionsRequestHistoriesOperations, +) from ._workflow_run_action_request_histories_operations import WorkflowRunActionRequestHistoriesOperations from ._workflow_run_action_scope_repetitions_operations import WorkflowRunActionScopeRepetitionsOperations from ._workflow_run_operations_operations import WorkflowRunOperationsOperations @@ -29,37 +31,47 @@ from ._integration_account_sessions_operations import IntegrationAccountSessionsOperations from ._integration_service_environments_operations import IntegrationServiceEnvironmentsOperations from ._integration_service_environment_skus_operations import IntegrationServiceEnvironmentSkusOperations -from ._integration_service_environment_network_health_operations import IntegrationServiceEnvironmentNetworkHealthOperations +from ._integration_service_environment_network_health_operations import ( + IntegrationServiceEnvironmentNetworkHealthOperations, +) from ._integration_service_environment_managed_apis_operations import IntegrationServiceEnvironmentManagedApisOperations -from ._integration_service_environment_managed_api_operations_operations import IntegrationServiceEnvironmentManagedApiOperationsOperations +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', - 'WorkflowTriggersOperations', - 'WorkflowVersionTriggersOperations', - 'WorkflowTriggerHistoriesOperations', - 'WorkflowRunsOperations', - 'WorkflowRunActionsOperations', - 'WorkflowRunActionRepetitionsOperations', - 'WorkflowRunActionRepetitionsRequestHistoriesOperations', - 'WorkflowRunActionRequestHistoriesOperations', - 'WorkflowRunActionScopeRepetitionsOperations', - 'WorkflowRunOperationsOperations', - 'IntegrationAccountsOperations', - 'IntegrationAccountAssembliesOperations', - 'IntegrationAccountBatchConfigurationsOperations', - 'IntegrationAccountSchemasOperations', - 'IntegrationAccountMapsOperations', - 'IntegrationAccountPartnersOperations', - 'IntegrationAccountAgreementsOperations', - 'IntegrationAccountCertificatesOperations', - 'IntegrationAccountSessionsOperations', - 'IntegrationServiceEnvironmentsOperations', - 'IntegrationServiceEnvironmentSkusOperations', - 'IntegrationServiceEnvironmentNetworkHealthOperations', - 'IntegrationServiceEnvironmentManagedApisOperations', - 'IntegrationServiceEnvironmentManagedApiOperationsOperations', - 'Operations', + "WorkflowsOperations", + "WorkflowVersionsOperations", + "WorkflowTriggersOperations", + "WorkflowVersionTriggersOperations", + "WorkflowTriggerHistoriesOperations", + "WorkflowRunsOperations", + "WorkflowRunActionsOperations", + "WorkflowRunActionRepetitionsOperations", + "WorkflowRunActionRepetitionsRequestHistoriesOperations", + "WorkflowRunActionRequestHistoriesOperations", + "WorkflowRunActionScopeRepetitionsOperations", + "WorkflowRunOperationsOperations", + "IntegrationAccountsOperations", + "IntegrationAccountAssembliesOperations", + "IntegrationAccountBatchConfigurationsOperations", + "IntegrationAccountSchemasOperations", + "IntegrationAccountMapsOperations", + "IntegrationAccountPartnersOperations", + "IntegrationAccountAgreementsOperations", + "IntegrationAccountCertificatesOperations", + "IntegrationAccountSessionsOperations", + "IntegrationServiceEnvironmentsOperations", + "IntegrationServiceEnvironmentSkusOperations", + "IntegrationServiceEnvironmentNetworkHealthOperations", + "IntegrationServiceEnvironmentManagedApisOperations", + "IntegrationServiceEnvironmentManagedApiOperationsOperations", + "Operations", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() 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..ecead8eb3acd 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 @@ -6,44 +6,58 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_account_agreements_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_content_callback_url_request, build_list_request -T = TypeVar('T') +from ...operations._integration_account_agreements_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_content_callback_url_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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,12 +67,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountAgreementListResult"]: + ) -> AsyncIterable["_models.IntegrationAccountAgreement"]: """Gets a list of integration account agreements. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -66,47 +80,51 @@ def list( AgreementType. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountAgreementListResult or the - result of cls(response) + :return: An iterator like instance of either IntegrationAccountAgreement or the result of + cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountAgreementListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountAgreement] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -120,10 +138,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -134,58 +150,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - agreement_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountAgreement": + self, resource_group_name: str, integration_account_name: str, agreement_name: str, **kwargs: Any + ) -> _models.IntegrationAccountAgreement: """Gets an integration account agreement. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param agreement_name: The integration account agreement name. + :param agreement_name: The integration account agreement name. Required. :type agreement_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountAgreement, or the result of cls(response) + :return: IntegrationAccountAgreement or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreement"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountAgreement] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, agreement_name=agreement_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -193,15 +209,74 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + deserialized = self._deserialize("IntegrationAccountAgreement", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + agreement: _models.IntegrationAccountAgreement, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountAgreement: + """Creates or updates an integration account agreement. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. Required. + :type agreement_name: str + :param agreement: The integration account agreement. Required. + :type agreement: ~azure.mgmt.logic.models.IntegrationAccountAgreement + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreement or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + agreement: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountAgreement: + """Creates or updates an integration account agreement. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. Required. + :type agreement_name: str + :param agreement: The integration account agreement. Required. + :type agreement: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreement or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( @@ -209,53 +284,71 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, agreement_name: str, - agreement: "_models.IntegrationAccountAgreement", + agreement: Union[_models.IntegrationAccountAgreement, IO], **kwargs: Any - ) -> "_models.IntegrationAccountAgreement": + ) -> _models.IntegrationAccountAgreement: """Creates or updates an integration account agreement. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param agreement_name: The integration account agreement name. + :param agreement_name: The integration account agreement name. Required. :type agreement_name: str - :param agreement: The integration account agreement. - :type agreement: ~azure.mgmt.logic.models.IntegrationAccountAgreement + :param agreement: The integration account agreement. Is either a model type or a IO type. + Required. + :type agreement: ~azure.mgmt.logic.models.IntegrationAccountAgreement or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountAgreement, or the result of cls(response) + :return: IntegrationAccountAgreement or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreement"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(agreement, 'IntegrationAccountAgreement') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountAgreement] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(agreement, (IO, bytes)): + _content = agreement + else: + _json = self._serialize.body(agreement, "IntegrationAccountAgreement") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, agreement_name=agreement_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -264,65 +357,66 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + deserialized = self._deserialize("IntegrationAccountAgreement", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + deserialized = self._deserialize("IntegrationAccountAgreement", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - agreement_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, agreement_name: str, **kwargs: Any ) -> None: """Deletes an integration account agreement. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param agreement_name: The integration account agreement name. + :param agreement_name: The integration account agreement name. Required. :type agreement_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, agreement_name=agreement_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -333,8 +427,67 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore + + @overload + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + list_content_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. Required. + :type agreement_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + list_content_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. Required. + :type agreement_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def list_content_callback_url( @@ -342,53 +495,70 @@ 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: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param agreement_name: The integration account agreement name. + :param agreement_name: The integration account agreement name. Required. :type agreement_name: str - :param list_content_callback_url: - :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_content_callback_url: Is either a model type or a IO type. Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_content_callback_url, (IO, bytes)): + _content = list_content_callback_url + else: + _json = self._serialize.body(list_content_callback_url, "GetCallbackUrlParameters") request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, agreement_name=agreement_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_content_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -396,12 +566,11 @@ async def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}/listContentCallbackUrl"} # type: ignore 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..20c11ea6a563 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 @@ -6,94 +6,111 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_account_assemblies_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_content_callback_url_request, build_list_request -T = TypeVar('T') +from ...operations._integration_account_assemblies_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_content_callback_url_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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( - self, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AssemblyCollection"]: + self, resource_group_name: str, integration_account_name: str, **kwargs: Any + ) -> AsyncIterable["_models.AssemblyDefinition"]: """List the assemblies for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AssemblyCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.AssemblyCollection] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AssemblyDefinition or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.AssemblyDefinition] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -107,10 +124,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -121,58 +136,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - assembly_artifact_name: str, - **kwargs: Any - ) -> "_models.AssemblyDefinition": + self, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, **kwargs: Any + ) -> _models.AssemblyDefinition: """Get an assembly for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param assembly_artifact_name: The assembly artifact name. + :param assembly_artifact_name: The assembly artifact name. Required. :type assembly_artifact_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AssemblyDefinition, or the result of cls(response) + :return: AssemblyDefinition or the result of cls(response) :rtype: ~azure.mgmt.logic.models.AssemblyDefinition - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AssemblyDefinition] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, assembly_artifact_name=assembly_artifact_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -180,15 +195,74 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + deserialized = self._deserialize("AssemblyDefinition", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + assembly_artifact_name: str, + assembly_artifact: _models.AssemblyDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AssemblyDefinition: + """Create or update an assembly for an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. Required. + :type assembly_artifact_name: str + :param assembly_artifact: The assembly artifact. Required. + :type assembly_artifact: ~azure.mgmt.logic.models.AssemblyDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyDefinition or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.AssemblyDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + assembly_artifact_name: str, + assembly_artifact: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AssemblyDefinition: + """Create or update an assembly for an integration account. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. Required. + :type assembly_artifact_name: str + :param assembly_artifact: The assembly artifact. Required. + :type assembly_artifact: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyDefinition or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.AssemblyDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( @@ -196,53 +270,70 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, - assembly_artifact: "_models.AssemblyDefinition", + assembly_artifact: Union[_models.AssemblyDefinition, IO], **kwargs: Any - ) -> "_models.AssemblyDefinition": + ) -> _models.AssemblyDefinition: """Create or update an assembly for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param assembly_artifact_name: The assembly artifact name. + :param assembly_artifact_name: The assembly artifact name. Required. :type assembly_artifact_name: str - :param assembly_artifact: The assembly artifact. - :type assembly_artifact: ~azure.mgmt.logic.models.AssemblyDefinition + :param assembly_artifact: The assembly artifact. Is either a model type or a IO type. Required. + :type assembly_artifact: ~azure.mgmt.logic.models.AssemblyDefinition or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AssemblyDefinition, or the result of cls(response) + :return: AssemblyDefinition or the result of cls(response) :rtype: ~azure.mgmt.logic.models.AssemblyDefinition - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AssemblyDefinition] - _json = self._serialize.body(assembly_artifact, 'AssemblyDefinition') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(assembly_artifact, (IO, bytes)): + _content = assembly_artifact + else: + _json = self._serialize.body(assembly_artifact, "AssemblyDefinition") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, assembly_artifact_name=assembly_artifact_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -251,65 +342,66 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + deserialized = self._deserialize("AssemblyDefinition", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + deserialized = self._deserialize("AssemblyDefinition", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - assembly_artifact_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, **kwargs: Any ) -> None: """Delete an assembly for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param assembly_artifact_name: The assembly artifact name. + :param assembly_artifact_name: The assembly artifact name. Required. :type assembly_artifact_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, assembly_artifact_name=assembly_artifact_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -320,55 +412,56 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore @distributed_trace_async async def list_content_callback_url( - self, - resource_group_name: str, - integration_account_name: str, - assembly_artifact_name: str, - **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + self, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url for an integration account assembly. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param assembly_artifact_name: The assembly artifact name. + :param assembly_artifact_name: The assembly artifact name. Required. :type assembly_artifact_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, assembly_artifact_name=assembly_artifact_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_content_callback_url.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -376,12 +469,11 @@ async def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl"} # type: ignore 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..b28dd2cf2f45 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 @@ -6,96 +6,110 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_account_batch_configurations_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') +from ...operations._integration_account_batch_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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( - self, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.BatchConfigurationCollection"]: + self, resource_group_name: str, integration_account_name: str, **kwargs: Any + ) -> AsyncIterable["_models.BatchConfiguration"]: """List the batch configurations for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchConfigurationCollection or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.BatchConfigurationCollection] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either BatchConfiguration or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.BatchConfiguration] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -109,10 +123,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -123,58 +135,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - batch_configuration_name: str, - **kwargs: Any - ) -> "_models.BatchConfiguration": + self, resource_group_name: str, integration_account_name: str, batch_configuration_name: str, **kwargs: Any + ) -> _models.BatchConfiguration: """Get a batch configuration for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param batch_configuration_name: The batch configuration name. + :param batch_configuration_name: The batch configuration name. Required. :type batch_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchConfiguration, or the result of cls(response) + :return: BatchConfiguration or the result of cls(response) :rtype: ~azure.mgmt.logic.models.BatchConfiguration - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfiguration"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.BatchConfiguration] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, batch_configuration_name=batch_configuration_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -182,15 +194,74 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('BatchConfiguration', pipeline_response) + deserialized = self._deserialize("BatchConfiguration", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + batch_configuration_name: str, + batch_configuration: _models.BatchConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.BatchConfiguration: + """Create or update a batch configuration for an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. Required. + :type batch_configuration_name: str + :param batch_configuration: The batch configuration. Required. + :type batch_configuration: ~azure.mgmt.logic.models.BatchConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.BatchConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + batch_configuration_name: str, + batch_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.BatchConfiguration: + """Create or update a batch configuration for an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. Required. + :type batch_configuration_name: str + :param batch_configuration: The batch configuration. Required. + :type batch_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.BatchConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( @@ -198,53 +269,71 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, batch_configuration_name: str, - batch_configuration: "_models.BatchConfiguration", + batch_configuration: Union[_models.BatchConfiguration, IO], **kwargs: Any - ) -> "_models.BatchConfiguration": + ) -> _models.BatchConfiguration: """Create or update a batch configuration for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param batch_configuration_name: The batch configuration name. + :param batch_configuration_name: The batch configuration name. Required. :type batch_configuration_name: str - :param batch_configuration: The batch configuration. - :type batch_configuration: ~azure.mgmt.logic.models.BatchConfiguration + :param batch_configuration: The batch configuration. Is either a model type or a IO type. + Required. + :type batch_configuration: ~azure.mgmt.logic.models.BatchConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchConfiguration, or the result of cls(response) + :return: BatchConfiguration or the result of cls(response) :rtype: ~azure.mgmt.logic.models.BatchConfiguration - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfiguration"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(batch_configuration, 'BatchConfiguration') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.BatchConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(batch_configuration, (IO, bytes)): + _content = batch_configuration + else: + _json = self._serialize.body(batch_configuration, "BatchConfiguration") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, batch_configuration_name=batch_configuration_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -253,65 +342,66 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('BatchConfiguration', pipeline_response) + deserialized = self._deserialize("BatchConfiguration", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('BatchConfiguration', pipeline_response) + deserialized = self._deserialize("BatchConfiguration", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - batch_configuration_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, batch_configuration_name: str, **kwargs: Any ) -> None: """Delete a batch configuration for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param batch_configuration_name: The batch configuration name. + :param batch_configuration_name: The batch configuration name. Required. :type batch_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, batch_configuration_name=batch_configuration_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -322,5 +412,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore 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..0315fd537a53 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 @@ -6,101 +6,115 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_account_certificates_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') +from ...operations._integration_account_certificates_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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( - self, - resource_group_name: str, - integration_account_name: str, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountCertificateListResult"]: + self, resource_group_name: str, integration_account_name: str, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.IntegrationAccountCertificate"]: """Gets a list of integration account certificates. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountCertificateListResult or the - result of cls(response) + :return: An iterator like instance of either IntegrationAccountCertificate or the result of + cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountCertificateListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountCertificate] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -114,10 +128,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -128,58 +140,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - certificate_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountCertificate": + self, resource_group_name: str, integration_account_name: str, certificate_name: str, **kwargs: Any + ) -> _models.IntegrationAccountCertificate: """Gets an integration account certificate. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param certificate_name: The integration account certificate name. + :param certificate_name: The integration account certificate name. Required. :type certificate_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountCertificate, or the result of cls(response) + :return: IntegrationAccountCertificate or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificate"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountCertificate] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, certificate_name=certificate_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -187,15 +199,74 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + deserialized = self._deserialize("IntegrationAccountCertificate", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + certificate_name: str, + certificate: _models.IntegrationAccountCertificate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountCertificate: + """Creates or updates an integration account certificate. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. Required. + :type certificate_name: str + :param certificate: The integration account certificate. Required. + :type certificate: ~azure.mgmt.logic.models.IntegrationAccountCertificate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificate or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + certificate_name: str, + certificate: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountCertificate: + """Creates or updates an integration account certificate. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. Required. + :type certificate_name: str + :param certificate: The integration account certificate. Required. + :type certificate: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificate or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( @@ -203,53 +274,71 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, certificate_name: str, - certificate: "_models.IntegrationAccountCertificate", + certificate: Union[_models.IntegrationAccountCertificate, IO], **kwargs: Any - ) -> "_models.IntegrationAccountCertificate": + ) -> _models.IntegrationAccountCertificate: """Creates or updates an integration account certificate. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param certificate_name: The integration account certificate name. + :param certificate_name: The integration account certificate name. Required. :type certificate_name: str - :param certificate: The integration account certificate. - :type certificate: ~azure.mgmt.logic.models.IntegrationAccountCertificate + :param certificate: The integration account certificate. Is either a model type or a IO type. + Required. + :type certificate: ~azure.mgmt.logic.models.IntegrationAccountCertificate or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountCertificate, or the result of cls(response) + :return: IntegrationAccountCertificate or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificate"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountCertificate] - _json = self._serialize.body(certificate, 'IntegrationAccountCertificate') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(certificate, (IO, bytes)): + _content = certificate + else: + _json = self._serialize.body(certificate, "IntegrationAccountCertificate") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, certificate_name=certificate_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -258,65 +347,66 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + deserialized = self._deserialize("IntegrationAccountCertificate", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + deserialized = self._deserialize("IntegrationAccountCertificate", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - certificate_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, certificate_name: str, **kwargs: Any ) -> None: """Deletes an integration account certificate. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param certificate_name: The integration account certificate name. + :param certificate_name: The integration account certificate name. Required. :type certificate_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, certificate_name=certificate_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -327,5 +417,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore 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..a11594c029ed 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 @@ -6,44 +6,58 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_account_maps_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_content_callback_url_request, build_list_request -T = TypeVar('T') +from ...operations._integration_account_maps_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_content_callback_url_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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,12 +67,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountMapListResult"]: + ) -> AsyncIterable["_models.IntegrationAccountMap"]: """Gets a list of integration account maps. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -66,47 +80,50 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountMapListResult or the result of + :return: An iterator like instance of either IntegrationAccountMap or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountMapListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountMap] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -120,10 +137,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -134,58 +149,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - map_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountMap": + self, resource_group_name: str, integration_account_name: str, map_name: str, **kwargs: Any + ) -> _models.IntegrationAccountMap: """Gets an integration account map. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param map_name: The integration account map name. + :param map_name: The integration account map name. Required. :type map_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountMap, or the result of cls(response) + :return: IntegrationAccountMap or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMap"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountMap] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, map_name=map_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -193,15 +208,78 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + deserialized = self._deserialize("IntegrationAccountMap", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + map: _models.IntegrationAccountMap, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param map_name: The integration account map name. Required. + :type map_name: str + :param map: The integration account map. Required. + :type map: ~azure.mgmt.logic.models.IntegrationAccountMap + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMap or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + map: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param map_name: The integration account map name. Required. + :type map_name: str + :param map: The integration account map. Required. + :type map: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMap or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( @@ -209,55 +287,72 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, map_name: str, - map: "_models.IntegrationAccountMap", + map: Union[_models.IntegrationAccountMap, IO], **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. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param map_name: The integration account map name. + :param map_name: The integration account map name. Required. :type map_name: str - :param map: The integration account map. - :type map: ~azure.mgmt.logic.models.IntegrationAccountMap + :param map: The integration account map. Is either a model type or a IO type. Required. + :type map: ~azure.mgmt.logic.models.IntegrationAccountMap or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountMap, or the result of cls(response) + :return: IntegrationAccountMap or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMap"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(map, 'IntegrationAccountMap') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountMap] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(map, (IO, bytes)): + _content = map + else: + _json = self._serialize.body(map, "IntegrationAccountMap") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, map_name=map_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -266,65 +361,66 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + deserialized = self._deserialize("IntegrationAccountMap", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + deserialized = self._deserialize("IntegrationAccountMap", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - map_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, map_name: str, **kwargs: Any ) -> None: """Deletes an integration account map. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param map_name: The integration account map name. + :param map_name: The integration account map name. Required. :type map_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, map_name=map_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -335,8 +431,67 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore + @overload + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + list_content_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param map_name: The integration account map name. Required. + :type map_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + list_content_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param map_name: The integration account map name. Required. + :type map_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def list_content_callback_url( @@ -344,53 +499,70 @@ 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: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param map_name: The integration account map name. + :param map_name: The integration account map name. Required. :type map_name: str - :param list_content_callback_url: - :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_content_callback_url: Is either a model type or a IO type. Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_content_callback_url, (IO, bytes)): + _content = list_content_callback_url + else: + _json = self._serialize.body(list_content_callback_url, "GetCallbackUrlParameters") request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, map_name=map_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_content_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -398,12 +570,11 @@ async def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}/listContentCallbackUrl"} # type: ignore 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..78b515499abf 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 @@ -6,44 +6,58 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_account_partners_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_content_callback_url_request, build_list_request -T = TypeVar('T') +from ...operations._integration_account_partners_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_content_callback_url_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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,12 +67,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountPartnerListResult"]: + ) -> AsyncIterable["_models.IntegrationAccountPartner"]: """Gets a list of integration account partners. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -66,47 +80,51 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountPartnerListResult or the result - of cls(response) + :return: An iterator like instance of either IntegrationAccountPartner or the result of + cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountPartnerListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountPartner] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -120,10 +138,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -134,58 +150,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - partner_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountPartner": + self, resource_group_name: str, integration_account_name: str, partner_name: str, **kwargs: Any + ) -> _models.IntegrationAccountPartner: """Gets an integration account partner. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param partner_name: The integration account partner name. + :param partner_name: The integration account partner name. Required. :type partner_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountPartner, or the result of cls(response) + :return: IntegrationAccountPartner or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartner"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountPartner] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, partner_name=partner_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -193,15 +209,74 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + deserialized = self._deserialize("IntegrationAccountPartner", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + partner: _models.IntegrationAccountPartner, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountPartner: + """Creates or updates an integration account partner. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param partner_name: The integration account partner name. Required. + :type partner_name: str + :param partner: The integration account partner. Required. + :type partner: ~azure.mgmt.logic.models.IntegrationAccountPartner + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartner or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + partner: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountPartner: + """Creates or updates an integration account partner. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param partner_name: The integration account partner name. Required. + :type partner_name: str + :param partner: The integration account partner. Required. + :type partner: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartner or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( @@ -209,53 +284,70 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, partner_name: str, - partner: "_models.IntegrationAccountPartner", + partner: Union[_models.IntegrationAccountPartner, IO], **kwargs: Any - ) -> "_models.IntegrationAccountPartner": + ) -> _models.IntegrationAccountPartner: """Creates or updates an integration account partner. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param partner_name: The integration account partner name. + :param partner_name: The integration account partner name. Required. :type partner_name: str - :param partner: The integration account partner. - :type partner: ~azure.mgmt.logic.models.IntegrationAccountPartner + :param partner: The integration account partner. Is either a model type or a IO type. Required. + :type partner: ~azure.mgmt.logic.models.IntegrationAccountPartner or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountPartner, or the result of cls(response) + :return: IntegrationAccountPartner or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartner"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(partner, 'IntegrationAccountPartner') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountPartner] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(partner, (IO, bytes)): + _content = partner + else: + _json = self._serialize.body(partner, "IntegrationAccountPartner") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, partner_name=partner_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -264,65 +356,66 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + deserialized = self._deserialize("IntegrationAccountPartner", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + deserialized = self._deserialize("IntegrationAccountPartner", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - partner_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, partner_name: str, **kwargs: Any ) -> None: """Deletes an integration account partner. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param partner_name: The integration account partner name. + :param partner_name: The integration account partner name. Required. :type partner_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, partner_name=partner_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -333,8 +426,67 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore + @overload + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + list_content_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param partner_name: The integration account partner name. Required. + :type partner_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + list_content_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param partner_name: The integration account partner name. Required. + :type partner_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def list_content_callback_url( @@ -342,53 +494,70 @@ 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: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param partner_name: The integration account partner name. + :param partner_name: The integration account partner name. Required. :type partner_name: str - :param list_content_callback_url: - :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_content_callback_url: Is either a model type or a IO type. Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_content_callback_url, (IO, bytes)): + _content = list_content_callback_url + else: + _json = self._serialize.body(list_content_callback_url, "GetCallbackUrlParameters") request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, partner_name=partner_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_content_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -396,12 +565,11 @@ async def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}/listContentCallbackUrl"} # type: ignore 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..9fa4782d837f 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 @@ -6,44 +6,58 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_account_schemas_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_content_callback_url_request, build_list_request -T = TypeVar('T') +from ...operations._integration_account_schemas_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_content_callback_url_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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,12 +67,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountSchemaListResult"]: + ) -> AsyncIterable["_models.IntegrationAccountSchema"]: """Gets a list of integration account schemas. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -66,47 +80,51 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountSchemaListResult or the result - of cls(response) + :return: An iterator like instance of either IntegrationAccountSchema or the result of + cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountSchemaListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountSchema] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -120,10 +138,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -134,58 +150,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - schema_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountSchema": + self, resource_group_name: str, integration_account_name: str, schema_name: str, **kwargs: Any + ) -> _models.IntegrationAccountSchema: """Gets an integration account schema. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param schema_name: The integration account schema name. + :param schema_name: The integration account schema name. Required. :type schema_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountSchema, or the result of cls(response) + :return: IntegrationAccountSchema or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchema"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountSchema] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, schema_name=schema_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -193,15 +209,74 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSchema", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + schema: _models.IntegrationAccountSchema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountSchema: + """Creates or updates an integration account schema. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param schema_name: The integration account schema name. Required. + :type schema_name: str + :param schema: The integration account schema. Required. + :type schema: ~azure.mgmt.logic.models.IntegrationAccountSchema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchema or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + schema: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountSchema: + """Creates or updates an integration account schema. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param schema_name: The integration account schema name. Required. + :type schema_name: str + :param schema: The integration account schema. Required. + :type schema: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchema or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( @@ -209,53 +284,70 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, schema_name: str, - schema: "_models.IntegrationAccountSchema", + schema: Union[_models.IntegrationAccountSchema, IO], **kwargs: Any - ) -> "_models.IntegrationAccountSchema": + ) -> _models.IntegrationAccountSchema: """Creates or updates an integration account schema. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param schema_name: The integration account schema name. + :param schema_name: The integration account schema name. Required. :type schema_name: str - :param schema: The integration account schema. - :type schema: ~azure.mgmt.logic.models.IntegrationAccountSchema + :param schema: The integration account schema. Is either a model type or a IO type. Required. + :type schema: ~azure.mgmt.logic.models.IntegrationAccountSchema or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountSchema, or the result of cls(response) + :return: IntegrationAccountSchema or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchema"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(schema, 'IntegrationAccountSchema') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountSchema] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(schema, (IO, bytes)): + _content = schema + else: + _json = self._serialize.body(schema, "IntegrationAccountSchema") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, schema_name=schema_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -264,65 +356,66 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSchema", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSchema", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - schema_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, schema_name: str, **kwargs: Any ) -> None: """Deletes an integration account schema. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param schema_name: The integration account schema name. + :param schema_name: The integration account schema name. Required. :type schema_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, schema_name=schema_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -333,8 +426,67 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore + @overload + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + list_content_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param schema_name: The integration account schema name. Required. + :type schema_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + list_content_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param schema_name: The integration account schema name. Required. + :type schema_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def list_content_callback_url( @@ -342,53 +494,70 @@ 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: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param schema_name: The integration account schema name. + :param schema_name: The integration account schema name. Required. :type schema_name: str - :param list_content_callback_url: - :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_content_callback_url: Is either a model type or a IO type. Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_content_callback_url, (IO, bytes)): + _content = list_content_callback_url + else: + _json = self._serialize.body(list_content_callback_url, "GetCallbackUrlParameters") request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, schema_name=schema_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_content_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -396,12 +565,11 @@ async def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}/listContentCallbackUrl"} # type: ignore 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..dbbfb3c465be 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 @@ -6,44 +6,57 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_account_sessions_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request -T = TypeVar('T') +from ...operations._integration_account_sessions_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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,12 +66,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountSessionListResult"]: + ) -> AsyncIterable["_models.IntegrationAccountSession"]: """Gets a list of integration account sessions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -66,47 +79,51 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountSessionListResult or the result - of cls(response) + :return: An iterator like instance of either IntegrationAccountSession or the result of + cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountSessionListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountSession] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -120,10 +137,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -134,58 +149,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - session_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountSession": + self, resource_group_name: str, integration_account_name: str, session_name: str, **kwargs: Any + ) -> _models.IntegrationAccountSession: """Gets an integration account session. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param session_name: The integration account session name. + :param session_name: The integration account session name. Required. :type session_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountSession, or the result of cls(response) + :return: IntegrationAccountSession or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSession"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountSession] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, session_name=session_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -193,15 +208,74 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSession", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + session_name: str, + session: _models.IntegrationAccountSession, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountSession: + """Creates or updates an integration account session. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param session_name: The integration account session name. Required. + :type session_name: str + :param session: The integration account session. Required. + :type session: ~azure.mgmt.logic.models.IntegrationAccountSession + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSession or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + session_name: str, + session: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountSession: + """Creates or updates an integration account session. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param session_name: The integration account session name. Required. + :type session_name: str + :param session: The integration account session. Required. + :type session: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSession or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( @@ -209,53 +283,70 @@ async def create_or_update( resource_group_name: str, integration_account_name: str, session_name: str, - session: "_models.IntegrationAccountSession", + session: Union[_models.IntegrationAccountSession, IO], **kwargs: Any - ) -> "_models.IntegrationAccountSession": + ) -> _models.IntegrationAccountSession: """Creates or updates an integration account session. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param session_name: The integration account session name. + :param session_name: The integration account session name. Required. :type session_name: str - :param session: The integration account session. - :type session: ~azure.mgmt.logic.models.IntegrationAccountSession + :param session: The integration account session. Is either a model type or a IO type. Required. + :type session: ~azure.mgmt.logic.models.IntegrationAccountSession or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountSession, or the result of cls(response) + :return: IntegrationAccountSession or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSession"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(session, 'IntegrationAccountSession') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountSession] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(session, (IO, bytes)): + _content = session + else: + _json = self._serialize.body(session, "IntegrationAccountSession") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, session_name=session_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -264,65 +355,66 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSession", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSession", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - session_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, session_name: str, **kwargs: Any ) -> None: """Deletes an integration account session. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param session_name: The integration account session name. + :param session_name: The integration account session name. Required. :type session_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, session_name=session_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -333,5 +425,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore 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..ac4a5bc52fd7 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 @@ -6,91 +6,113 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._integration_accounts_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_callback_url_request, build_list_key_vault_keys_request, build_log_tracking_events_request, build_regenerate_access_key_request, build_update_request -T = TypeVar('T') +from ...operations._integration_accounts_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_callback_url_request, + build_list_key_vault_keys_request, + build_log_tracking_events_request, + build_regenerate_access_key_request, + build_update_request, +) + +T = TypeVar("T") 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. +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.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"]: + self, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.IntegrationAccount"]: """Gets a list of integration accounts by subscription. :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccount or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccount] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_subscription_request( subscription_id=self._config.subscription_id, - api_version=api_version, top=top, - template_url=self.list_by_subscription.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -104,10 +126,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -118,63 +138,62 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.IntegrationAccountListResult"]: + self, resource_group_name: str, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.IntegrationAccount"]: """Gets a list of integration accounts by resource group. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccountListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccount or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationAccount] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, - template_url=self.list_by_resource_group.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -188,10 +207,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -202,54 +219,55 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccount": + self, resource_group_name: str, integration_account_name: str, **kwargs: Any + ) -> _models.IntegrationAccount: """Gets an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccount, or the result of cls(response) + :return: IntegrationAccount or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccount - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccount] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -257,65 +275,136 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + integration_account: _models.IntegrationAccount, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Creates or updates an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param integration_account: The integration account. Required. + :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + integration_account: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Creates or updates an integration account. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param integration_account: The integration account. Required. + :type integration_account: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def create_or_update( self, resource_group_name: str, integration_account_name: str, - integration_account: "_models.IntegrationAccount", + integration_account: Union[_models.IntegrationAccount, IO], **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Creates or updates an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param integration_account: The integration account. - :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount + :param integration_account: The integration account. Is either a model type or a IO type. + Required. + :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccount, or the result of cls(response) + :return: IntegrationAccount or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccount - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(integration_account, 'IntegrationAccount') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccount] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_account, (IO, bytes)): + _content = integration_account + else: + _json = self._serialize.body(integration_account, "IntegrationAccount") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -324,68 +413,139 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + integration_account_name: str, + integration_account: _models.IntegrationAccount, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Updates an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param integration_account: The integration account. Required. + :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + integration_account_name: str, + integration_account: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Updates an integration account. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param integration_account: The integration account. Required. + :type integration_account: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def update( self, resource_group_name: str, integration_account_name: str, - integration_account: "_models.IntegrationAccount", + integration_account: Union[_models.IntegrationAccount, IO], **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Updates an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param integration_account: The integration account. - :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount + :param integration_account: The integration account. Is either a model type or a IO type. + Required. + :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccount, or the result of cls(response) + :return: IntegrationAccount or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccount - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(integration_account, 'IntegrationAccount') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccount] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_account, (IO, bytes)): + _content = integration_account + else: + _json = self._serialize.body(integration_account, "IntegrationAccount") request = build_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -393,58 +553,60 @@ async def update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, **kwargs: Any ) -> None: """Deletes an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -455,58 +617,128 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + + @overload + async def list_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + parameters: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CallbackUrl: + """Gets the integration account callback URL. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param parameters: The callback URL parameters. Required. + :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.CallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CallbackUrl: + """Gets the integration account callback URL. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param parameters: The callback URL parameters. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.CallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def list_callback_url( self, resource_group_name: str, integration_account_name: str, - parameters: "_models.GetCallbackUrlParameters", + parameters: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.CallbackUrl": + ) -> _models.CallbackUrl: """Gets the integration account callback URL. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param parameters: The callback URL parameters. - :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param parameters: The callback URL parameters. Is either a model type or a IO type. Required. + :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: CallbackUrl, or the result of cls(response) + :return: CallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.CallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.CallbackUrl] - _json = self._serialize.body(parameters, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "GetCallbackUrlParameters") request = build_list_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -514,76 +746,142 @@ async def list_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('CallbackUrl', pipeline_response) + deserialized = self._deserialize("CallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl"} # type: ignore + list_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl"} # type: ignore + + @overload + def list_key_vault_keys( + self, + resource_group_name: str, + integration_account_name: str, + list_key_vault_keys: _models.ListKeyVaultKeysDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.KeyVaultKey"]: + """Gets the integration account's Key Vault keys. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param list_key_vault_keys: The key vault parameters. Required. + :type list_key_vault_keys: ~azure.mgmt.logic.models.ListKeyVaultKeysDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KeyVaultKey or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.KeyVaultKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_key_vault_keys( + self, + resource_group_name: str, + integration_account_name: str, + list_key_vault_keys: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncIterable["_models.KeyVaultKey"]: + """Gets the integration account's Key Vault keys. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param list_key_vault_keys: The key vault parameters. Required. + :type list_key_vault_keys: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KeyVaultKey or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.KeyVaultKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def list_key_vault_keys( self, resource_group_name: str, integration_account_name: str, - list_key_vault_keys: "_models.ListKeyVaultKeysDefinition", + list_key_vault_keys: Union[_models.ListKeyVaultKeysDefinition, IO], **kwargs: Any - ) -> AsyncIterable["_models.KeyVaultKeyCollection"]: + ) -> AsyncIterable["_models.KeyVaultKey"]: """Gets the integration account's Key Vault keys. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param list_key_vault_keys: The key vault parameters. - :type list_key_vault_keys: ~azure.mgmt.logic.models.ListKeyVaultKeysDefinition + :param list_key_vault_keys: The key vault parameters. Is either a model type or a IO type. + Required. + :type list_key_vault_keys: ~azure.mgmt.logic.models.ListKeyVaultKeysDefinition or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either KeyVaultKeyCollection or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.KeyVaultKeyCollection] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either KeyVaultKey or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.KeyVaultKey] + :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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_key_vault_keys, (IO, bytes)): + _content = list_key_vault_keys + else: + _json = self._serialize.body(list_key_vault_keys, "ListKeyVaultKeysDefinition") + def prepare_request(next_link=None): if not next_link: - _json = self._serialize.body(list_key_vault_keys, 'ListKeyVaultKeysDefinition') - + request = build_list_key_vault_keys_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_key_vault_keys.metadata['url'], + content=_content, + 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') - - request = build_list_key_vault_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -597,10 +895,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -611,61 +907,131 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_key_vault_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys"} # type: ignore + list_key_vault_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys"} # type: ignore - @distributed_trace_async + @overload 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, + *, + content_type: str = "application/json", **kwargs: Any ) -> None: """Logs the integration account's tracking events. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param log_tracking_events: The callback URL parameters. + :param log_tracking_events: The callback URL parameters. Required. :type log_tracking_events: ~azure.mgmt.logic.models.TrackingEventsDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def log_tracking_events( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + integration_account_name: str, + log_tracking_events: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Logs the integration account's tracking events. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param log_tracking_events: The callback URL parameters. Required. + :type log_tracking_events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def log_tracking_events( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + integration_account_name: str, + log_tracking_events: Union[_models.TrackingEventsDefinition, IO], + **kwargs: Any + ) -> None: + """Logs the integration account's tracking events. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param log_tracking_events: The callback URL parameters. Is either a model type or a IO type. + Required. + :type log_tracking_events: ~azure.mgmt.logic.models.TrackingEventsDefinition or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(log_tracking_events, 'TrackingEventsDefinition') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(log_tracking_events, (IO, bytes)): + _content = log_tracking_events + else: + _json = self._serialize.body(log_tracking_events, "TrackingEventsDefinition") request = build_log_tracking_events_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.log_tracking_events.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -676,58 +1042,129 @@ async def log_tracking_events( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - log_tracking_events.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents"} # type: ignore + log_tracking_events.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents"} # type: ignore + + @overload + async def regenerate_access_key( + self, + resource_group_name: str, + integration_account_name: str, + regenerate_access_key: _models.RegenerateActionParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Regenerates the integration account access key. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param regenerate_access_key: The access key type. Required. + :type regenerate_access_key: ~azure.mgmt.logic.models.RegenerateActionParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def regenerate_access_key( + self, + resource_group_name: str, + integration_account_name: str, + regenerate_access_key: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Regenerates the integration account access key. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param regenerate_access_key: The access key type. Required. + :type regenerate_access_key: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def regenerate_access_key( self, resource_group_name: str, integration_account_name: str, - regenerate_access_key: "_models.RegenerateActionParameter", + regenerate_access_key: Union[_models.RegenerateActionParameter, IO], **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Regenerates the integration account access key. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param regenerate_access_key: The access key type. - :type regenerate_access_key: ~azure.mgmt.logic.models.RegenerateActionParameter + :param regenerate_access_key: The access key type. Is either a model type or a IO type. + Required. + :type regenerate_access_key: ~azure.mgmt.logic.models.RegenerateActionParameter or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccount, or the result of cls(response) + :return: IntegrationAccount or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccount - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(regenerate_access_key, 'RegenerateActionParameter') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccount] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(regenerate_access_key, (IO, bytes)): + _content = regenerate_access_key + else: + _json = self._serialize.body(regenerate_access_key, "RegenerateActionParameter") request = build_regenerate_access_key_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.regenerate_access_key.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -735,12 +1172,11 @@ async def regenerate_access_key( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - regenerate_access_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey"} # type: ignore - + regenerate_access_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey"} # type: ignore 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..b0678feea28c 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 @@ -7,99 +7,107 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 from ..._vendor import _convert_request from ...operations._integration_service_environment_managed_api_operations_operations import build_list_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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( - self, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ApiOperationListResult"]: + self, resource_group: str, integration_service_environment_name: str, api_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ApiOperation"]: """Gets the managed Api operations. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param api_name: The api name. + :param api_name: The api name. Required. :type api_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApiOperationListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ApiOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ApiOperation or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ApiOperation] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group=resource_group, - integration_service_environment_name=integration_service_environment_name, - api_name=api_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -113,10 +121,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -127,8 +133,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations"} # type: ignore 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..fb4d8f8bdade 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,98 +6,115 @@ # 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, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod 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 from ... import models as _models from ..._vendor import _convert_request -from ...operations._integration_service_environment_managed_apis_operations import build_delete_request_initial, build_get_request, build_list_request, build_put_request_initial -T = TypeVar('T') +from ...operations._integration_service_environment_managed_apis_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_put_request, +) + +T = TypeVar("T") 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. +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.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( - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.IntegrationServiceEnvironmentManagedApiListResult"]: + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any + ) -> AsyncIterable["_models.IntegrationServiceEnvironmentManagedApi"]: """Gets the integration service environment managed Apis. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationServiceEnvironmentManagedApiListResult - or the result of cls(response) + :return: An iterator like instance of either IntegrationServiceEnvironmentManagedApi or the + result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApiListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group=resource_group, - integration_service_environment_name=integration_service_environment_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -111,10 +128,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -125,58 +140,59 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis"} # type: ignore @distributed_trace_async async def get( - self, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any - ) -> "_models.IntegrationServiceEnvironmentManagedApi": + self, resource_group: str, integration_service_environment_name: str, api_name: str, **kwargs: Any + ) -> _models.IntegrationServiceEnvironmentManagedApi: """Gets the integration service environment managed Api. - :param resource_group: The resource group name. + :param resource_group: The resource group name. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param api_name: The api name. + :param api_name: The api name. Required. :type api_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationServiceEnvironmentManagedApi, or the result of cls(response) + :return: IntegrationServiceEnvironmentManagedApi or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -184,72 +200,170 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironmentManagedApi", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore async def _put_initial( self, resource_group: str, integration_service_environment_name: str, api_name: str, - integration_service_environment_managed_api: "_models.IntegrationServiceEnvironmentManagedApi", + integration_service_environment_managed_api: Union[_models.IntegrationServiceEnvironmentManagedApi, IO], **kwargs: Any - ) -> "_models.IntegrationServiceEnvironmentManagedApi": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] + ) -> _models.IntegrationServiceEnvironmentManagedApi: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(integration_service_environment_managed_api, 'IntegrationServiceEnvironmentManagedApi') + 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", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_service_environment_managed_api, (IO, bytes)): + _content = integration_service_environment_managed_api + else: + _json = self._serialize.body( + integration_service_environment_managed_api, "IntegrationServiceEnvironmentManagedApi" + ) - request = build_put_request_initial( - subscription_id=self._config.subscription_id, + request = build_put_request( resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._put_initial.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironmentManagedApi", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironmentManagedApi", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _put_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore + _put_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore + @overload + async def begin_put( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + integration_service_environment_managed_api: _models.IntegrationServiceEnvironmentManagedApi, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironmentManagedApi]: + """Puts the integration service environment managed Api. + + :param resource_group: The resource group name. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param api_name: The api name. Required. + :type api_name: str + :param integration_service_environment_managed_api: The integration service environment managed + api. Required. + :type integration_service_environment_managed_api: + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either + IntegrationServiceEnvironmentManagedApi or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_put( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + integration_service_environment_managed_api: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironmentManagedApi]: + """Puts the integration service environment managed Api. + + :param resource_group: The resource group name. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param api_name: The api name. Required. + :type api_name: str + :param integration_service_environment_managed_api: The integration service environment managed + api. Required. + :type integration_service_environment_managed_api: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either + IntegrationServiceEnvironmentManagedApi or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def begin_put( @@ -257,21 +371,25 @@ 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: Union[_models.IntegrationServiceEnvironmentManagedApi, IO], **kwargs: Any - ) -> AsyncLROPoller["_models.IntegrationServiceEnvironmentManagedApi"]: + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironmentManagedApi]: """Puts the integration service environment managed Api. - :param resource_group: The resource group name. + :param resource_group: The resource group name. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param api_name: The api name. + :param api_name: The api name. Required. :type api_name: str :param integration_service_environment_managed_api: The integration service environment managed - api. + api. Is either a model type or a IO type. Required. :type integration_service_environment_managed_api: - ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -284,111 +402,113 @@ async def begin_put( IntegrationServiceEnvironmentManagedApi or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - 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] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] + 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._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, integration_service_environment_managed_api=integration_service_environment_managed_api, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_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() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_put.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore + begin_put.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any + self, resource_group: str, integration_service_environment_name: str, api_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any + async def begin_delete( + self, resource_group: str, integration_service_environment_name: str, api_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes the integration service environment managed Api. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param api_name: The api name. + :param api_name: The api name. Required. :type api_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -400,42 +520,46 @@ async def begin_delete( # pylint: disable=inconsistent-return-statements Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + 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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore 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..b6fdc0ee8ed5 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 @@ -8,84 +8,97 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 from ..._vendor import _convert_request from ...operations._integration_service_environment_network_health_operations import build_get_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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( - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any - ) -> Dict[str, "_models.IntegrationServiceEnvironmentSubnetNetworkHealth"]: + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any + ) -> Dict[str, _models.IntegrationServiceEnvironmentSubnetNetworkHealth]: """Gets the integration service environment network health. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: dict mapping str to IntegrationServiceEnvironmentSubnetNetworkHealth, or the result of + :return: dict mapping str to IntegrationServiceEnvironmentSubnetNetworkHealth or the result of cls(response) :rtype: dict[str, ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSubnetNetworkHealth] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.IntegrationServiceEnvironmentSubnetNetworkHealth"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Dict[str, _models.IntegrationServiceEnvironmentSubnetNetworkHealth]] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -93,12 +106,11 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('{IntegrationServiceEnvironmentSubnetNetworkHealth}', pipeline_response) + deserialized = self._deserialize("{IntegrationServiceEnvironmentSubnetNetworkHealth}", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network"} # type: ignore 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..7db3be5a44fc 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 @@ -7,94 +7,106 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 from ..._vendor import _convert_request from ...operations._integration_service_environment_skus_operations import build_list_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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( - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.IntegrationServiceEnvironmentSkuList"]: + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any + ) -> AsyncIterable["_models.IntegrationServiceEnvironmentSkuDefinition"]: """Gets a list of integration service environment Skus. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationServiceEnvironmentSkuList or the result - of cls(response) + :return: An iterator like instance of either IntegrationServiceEnvironmentSkuDefinition or the + result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuList] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuDefinition] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group=resource_group, - integration_service_environment_name=integration_service_environment_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -108,10 +120,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -122,8 +132,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus"} # type: ignore 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..1d414ecbb30b 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,93 +6,114 @@ # 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, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod 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 from ... import models as _models from ..._vendor import _convert_request -from ...operations._integration_service_environments_operations import build_create_or_update_request_initial, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_restart_request, build_update_request_initial -T = TypeVar('T') +from ...operations._integration_service_environments_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_restart_request, + build_update_request, +) + +T = TypeVar("T") 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. +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.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"]: + self, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.IntegrationServiceEnvironment"]: """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. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationServiceEnvironmentListResult or the - result of cls(response) + :return: An iterator like instance of either IntegrationServiceEnvironment or the result of + cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_subscription_request( subscription_id=self._config.subscription_id, - api_version=api_version, top=top, - template_url=self.list_by_subscription.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -106,10 +127,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -120,63 +139,64 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group: str, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.IntegrationServiceEnvironmentListResult"]: + self, resource_group: str, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.IntegrationServiceEnvironment"]: """Gets a list of integration service environments by resource group. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationServiceEnvironmentListResult or the - result of cls(response) + :return: An iterator like instance of either IntegrationServiceEnvironment or the result of + cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, - template_url=self.list_by_resource_group.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group=resource_group, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -190,10 +210,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -204,54 +222,56 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments"} # type: ignore @distributed_trace_async async def get( - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any + ) -> _models.IntegrationServiceEnvironment: """Gets an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationServiceEnvironment, or the result of cls(response) + :return: IntegrationServiceEnvironment or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationServiceEnvironment - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -259,87 +279,180 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore async def _create_or_update_initial( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: Union[_models.IntegrationServiceEnvironment, IO], **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] + ) -> _models.IntegrationServiceEnvironment: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(integration_service_environment, 'IntegrationServiceEnvironment') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_service_environment, (IO, bytes)): + _content = integration_service_environment + else: + _json = self._serialize.body(integration_service_environment, "IntegrationServiceEnvironment") + + request = build_create_or_update_request( resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironment", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group: str, + integration_service_environment_name: str, + integration_service_environment: _models.IntegrationServiceEnvironment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironment]: + """Creates or updates an integration service environment. + + :param resource_group: The resource group. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param integration_service_environment: The integration service environment. Required. + :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IntegrationServiceEnvironment or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group: str, + integration_service_environment_name: str, + integration_service_environment: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironment]: + """Creates or updates an integration service environment. + :param resource_group: The resource group. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param integration_service_environment: The integration service environment. Required. + :type integration_service_environment: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IntegrationServiceEnvironment or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def begin_create_or_update( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: Union[_models.IntegrationServiceEnvironment, IO], **kwargs: Any - ) -> AsyncLROPoller["_models.IntegrationServiceEnvironment"]: + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironment]: """Creates or updates an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param integration_service_environment: The integration service environment. + :param integration_service_environment: The integration service environment. Is either a model + type or a IO type. Required. :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -352,118 +465,215 @@ async def begin_create_or_update( result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - 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] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] + 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._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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_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() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore async def _update_initial( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: Union[_models.IntegrationServiceEnvironment, IO], **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] + ) -> _models.IntegrationServiceEnvironment: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(integration_service_environment, 'IntegrationServiceEnvironment') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] - request = build_update_request_initial( - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_service_environment, (IO, bytes)): + _content = integration_service_environment + else: + _json = self._serialize.body(integration_service_environment, "IntegrationServiceEnvironment") + + request = build_update_request( resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + @overload + async def begin_update( + self, + resource_group: str, + integration_service_environment_name: str, + integration_service_environment: _models.IntegrationServiceEnvironment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironment]: + """Updates an integration service environment. + + :param resource_group: The resource group. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param integration_service_environment: The integration service environment. Required. + :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IntegrationServiceEnvironment or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group: str, + integration_service_environment_name: str, + integration_service_environment: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironment]: + """Updates an integration service environment. + + :param resource_group: The resource group. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param integration_service_environment: The integration service environment. Required. + :type integration_service_environment: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either IntegrationServiceEnvironment or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def begin_update( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: Union[_models.IntegrationServiceEnvironment, IO], **kwargs: Any - ) -> AsyncLROPoller["_models.IntegrationServiceEnvironment"]: + ) -> AsyncLROPoller[_models.IntegrationServiceEnvironment]: """Updates an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param integration_service_environment: The integration service environment. + :param integration_service_environment: The integration service environment. Is either a model + type or a IO type. Required. :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -476,93 +686,100 @@ async def begin_update( result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - 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] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] + 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._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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_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() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any ) -> None: """Deletes an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -573,51 +790,54 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore @distributed_trace_async async def restart( # pylint: disable=inconsistent-return-statements - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any ) -> None: """Restarts an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_restart_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.restart.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -628,5 +848,4 @@ async def restart( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart"} # type: ignore - + restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart"} # type: ignore 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..11fbca668660 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 @@ -7,80 +7,94 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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"]: + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: """Lists all of the available Logic REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.Operation] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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'], + 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, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -94,10 +108,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -108,8 +120,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.Logic/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Logic/operations"} # type: ignore 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..f7dd32510333 --- /dev/null +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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..6ce774d2e1c2 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 @@ -7,105 +7,116 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._workflow_run_action_repetitions_operations import build_get_request, build_list_expression_traces_request, build_list_request -T = TypeVar('T') +from ...operations._workflow_run_action_repetitions_operations import ( + build_get_request, + build_list_expression_traces_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.WorkflowRunActionRepetitionDefinitionCollection"]: + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> AsyncIterable["_models.WorkflowRunActionRepetitionDefinition"]: """Get all of a workflow run action repetitions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowRunActionRepetitionDefinitionCollection or - the result of cls(response) + :return: An iterator like instance of either WorkflowRunActionRepetitionDefinition or the + result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinitionCollection] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -119,10 +130,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -133,11 +142,9 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions"} # type: ignore @distributed_trace_async async def get( @@ -148,51 +155,57 @@ 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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRunActionRepetitionDefinition, or the result of cls(response) + :return: WorkflowRunActionRepetitionDefinition or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinition] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -200,15 +213,14 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRunActionRepetitionDefinition', pipeline_response) + deserialized = self._deserialize("WorkflowRunActionRepetitionDefinition", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}"} # type: ignore @distributed_trace def list_expression_traces( @@ -219,61 +231,64 @@ def list_expression_traces( action_name: str, repetition_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ExpressionTraces"]: + ) -> AsyncIterable["_models.ExpressionRoot"]: """Lists a workflow run expression trace. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressionTraces or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ExpressionTraces] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ExpressionRoot or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ExpressionRoot] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_expression_traces_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_expression_traces.metadata['url'], + 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: - - request = build_list_expression_traces_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - repetition_name=repetition_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -287,10 +302,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -301,8 +314,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_expression_traces.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces"} # type: ignore + list_expression_traces.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces"} # type: ignore 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..d2787f2720da 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 @@ -7,43 +7,54 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._workflow_run_action_repetitions_request_histories_operations import build_get_request, build_list_request -T = TypeVar('T') +from ...operations._workflow_run_action_repetitions_request_histories_operations import ( + build_get_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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,63 +65,64 @@ def list( action_name: str, repetition_name: str, **kwargs: Any - ) -> AsyncIterable["_models.RequestHistoryListResult"]: + ) -> AsyncIterable["_models.RequestHistory"]: """List a workflow run repetition request history. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RequestHistoryListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.RequestHistoryListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either RequestHistory or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.RequestHistory] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - repetition_name=repetition_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -124,10 +136,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -138,11 +148,9 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories"} # type: ignore @distributed_trace_async async def get( @@ -154,54 +162,60 @@ 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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str - :param request_history_name: The request history name. + :param request_history_name: The request history name. Required. :type request_history_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RequestHistory, or the result of cls(response) + :return: RequestHistory or the result of cls(response) :rtype: ~azure.mgmt.logic.models.RequestHistory - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistory"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.RequestHistory] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, request_history_name=request_history_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -209,12 +223,11 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('RequestHistory', pipeline_response) + deserialized = self._deserialize("RequestHistory", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}"} # type: ignore 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..e8c25a39f6a1 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 @@ -7,105 +7,110 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request from ...operations._workflow_run_action_request_histories_operations import build_get_request, build_list_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.RequestHistoryListResult"]: + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> AsyncIterable["_models.RequestHistory"]: """List a workflow run request history. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RequestHistoryListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.RequestHistoryListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either RequestHistory or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.RequestHistory] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -119,10 +124,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -133,11 +136,9 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories"} # type: ignore @distributed_trace_async async def get( @@ -148,51 +149,57 @@ 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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param request_history_name: The request history name. + :param request_history_name: The request history name. Required. :type request_history_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RequestHistory, or the result of cls(response) + :return: RequestHistory or the result of cls(response) :rtype: ~azure.mgmt.logic.models.RequestHistory - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistory"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.RequestHistory] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, request_history_name=request_history_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -200,12 +207,11 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('RequestHistory', pipeline_response) + deserialized = self._deserialize("RequestHistory", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}"} # type: ignore 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..f6777fdee2c8 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 @@ -7,105 +7,112 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request from ...operations._workflow_run_action_scope_repetitions_operations import build_get_request, build_list_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.WorkflowRunActionRepetitionDefinitionCollection"]: + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> AsyncIterable["_models.WorkflowRunActionRepetitionDefinition"]: """List the workflow run action scoped repetitions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowRunActionRepetitionDefinitionCollection or - the result of cls(response) + :return: An iterator like instance of either WorkflowRunActionRepetitionDefinition or the + result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinitionCollection] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -119,10 +126,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -133,11 +138,9 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions"} # type: ignore @distributed_trace_async async def get( @@ -148,51 +151,57 @@ 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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRunActionRepetitionDefinition, or the result of cls(response) + :return: WorkflowRunActionRepetitionDefinition or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinition] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -200,12 +209,11 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRunActionRepetitionDefinition', pipeline_response) + deserialized = self._deserialize("WorkflowRunActionRepetitionDefinition", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions/{repetitionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions/{repetitionName}"} # type: ignore 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..fbe1ff633902 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 @@ -7,43 +7,55 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._workflow_run_actions_operations import build_get_request, build_list_expression_traces_request, build_list_request -T = TypeVar('T') +from ...operations._workflow_run_actions_operations import ( + build_get_request, + build_list_expression_traces_request, + build_list_request, +) + +T = TypeVar("T") 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. +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.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,14 +66,14 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowRunActionListResult"]: + ) -> AsyncIterable["_models.WorkflowRunAction"]: """Gets a list of workflow run actions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -69,49 +81,50 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowRunActionListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunActionListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either WorkflowRunAction or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunAction] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -125,10 +138,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -139,62 +150,61 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> "_models.WorkflowRunAction": + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> _models.WorkflowRunAction: """Gets a workflow run action. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRunAction, or the result of cls(response) + :return: WorkflowRunAction or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRunAction - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunAction"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRunAction] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -202,75 +212,73 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRunAction', pipeline_response) + deserialized = self._deserialize("WorkflowRunAction", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}"} # type: ignore @distributed_trace def list_expression_traces( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ExpressionTraces"]: + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ExpressionRoot"]: """Lists a workflow run expression trace. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressionTraces or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ExpressionTraces] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ExpressionRoot or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.ExpressionRoot] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_expression_traces_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_expression_traces.metadata['url'], + 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: - - request = build_list_expression_traces_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -284,10 +292,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -298,8 +304,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_expression_traces.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/listExpressionTraces"} # type: ignore + list_expression_traces.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/listExpressionTraces"} # type: ignore 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..d00847ce99bc 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 @@ -8,91 +8,99 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 from ..._vendor import _convert_request from ...operations._workflow_run_operations_operations import build_get_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - operation_id: str, - **kwargs: Any - ) -> "_models.WorkflowRun": + self, resource_group_name: str, workflow_name: str, run_name: str, operation_id: str, **kwargs: Any + ) -> _models.WorkflowRun: """Gets an operation for a run. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param operation_id: The workflow operation id. + :param operation_id: The workflow operation id. Required. :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRun, or the result of cls(response) + :return: WorkflowRun or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRun - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRun"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRun] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, operation_id=operation_id, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -100,12 +108,11 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRun', pipeline_response) + deserialized = self._deserialize("WorkflowRun", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/operations/{operationId}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/operations/{operationId}"} # type: ignore 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..355a0a2ac46c 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 @@ -7,43 +7,51 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request from ...operations._workflow_runs_operations import build_cancel_request, build_get_request, build_list_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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,12 +61,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowRunListResult"]: + ) -> AsyncIterable["_models.WorkflowRun"]: """Gets a list of workflow runs. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -66,46 +74,49 @@ def list( StartTime, and ClientTrackingId. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowRunListResult or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRunListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either WorkflowRun or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowRun] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -119,10 +130,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -133,58 +142,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - **kwargs: Any - ) -> "_models.WorkflowRun": + self, resource_group_name: str, workflow_name: str, run_name: str, **kwargs: Any + ) -> _models.WorkflowRun: """Gets a workflow run. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRun, or the result of cls(response) + :return: WorkflowRun or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRun - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRun"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRun] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -192,62 +201,63 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRun', pipeline_response) + deserialized = self._deserialize("WorkflowRun", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}"} # type: ignore @distributed_trace_async async def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, run_name: str, **kwargs: Any ) -> None: """Cancels a workflow run. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_cancel_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.cancel.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -258,5 +268,4 @@ async def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel"} # type: ignore - + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel"} # type: ignore 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..96b0e812c615 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 @@ -7,43 +7,55 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._workflow_trigger_histories_operations import build_get_request, build_list_request, build_resubmit_request -T = TypeVar('T') +from ...operations._workflow_trigger_histories_operations import ( + build_get_request, + build_list_request, + build_resubmit_request, +) + +T = TypeVar("T") 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. +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.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,14 +66,14 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowTriggerHistoryListResult"]: + ) -> AsyncIterable["_models.WorkflowTriggerHistory"]: """Gets a list of workflow trigger histories. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -69,49 +81,52 @@ def list( StartTime, and ClientTrackingId. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowTriggerHistoryListResult or the result of + :return: An iterator like instance of either WorkflowTriggerHistory or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowTriggerHistoryListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowTriggerHistory] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - trigger_name=trigger_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -125,10 +140,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -139,63 +152,62 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - history_name: str, - **kwargs: Any - ) -> "_models.WorkflowTriggerHistory": + self, resource_group_name: str, workflow_name: str, trigger_name: str, history_name: str, **kwargs: Any + ) -> _models.WorkflowTriggerHistory: """Gets a workflow trigger history. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :param history_name: The workflow trigger history name. Corresponds to the run name for - triggers that resulted in a run. + triggers that resulted in a run. Required. :type history_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerHistory, or the result of cls(response) + :return: WorkflowTriggerHistory or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerHistory - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerHistory"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerHistory] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, history_name=history_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -203,67 +215,67 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerHistory', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerHistory", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}"} # type: ignore @distributed_trace_async async def resubmit( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - history_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, trigger_name: str, history_name: str, **kwargs: Any ) -> None: """Resubmits a workflow run based on the trigger history. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :param history_name: The workflow trigger history name. Corresponds to the run name for - triggers that resulted in a run. + triggers that resulted in a run. Required. :type history_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_resubmit_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, history_name=history_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.resubmit.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [202]: @@ -274,5 +286,4 @@ async def resubmit( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - resubmit.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit"} # type: ignore - + resubmit.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit"} # type: ignore 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..c9ea702a1d53 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 @@ -6,44 +6,60 @@ # 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 +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request -from ...operations._workflow_triggers_operations import build_get_request, build_get_schema_json_request, build_list_callback_url_request, build_list_request, build_reset_request, build_run_request, build_set_state_request -T = TypeVar('T') +from ...operations._workflow_triggers_operations import ( + build_get_request, + build_get_schema_json_request, + build_list_callback_url_request, + build_list_request, + build_reset_request, + build_run_request, + build_set_state_request, +) + +T = TypeVar("T") 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. +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.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,59 +69,61 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowTriggerListResult"]: + ) -> AsyncIterable["_models.WorkflowTrigger"]: """Gets a list of workflow triggers. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int :param filter: The filter to apply on the operation. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowTriggerListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowTriggerListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either WorkflowTrigger or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowTrigger] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -119,10 +137,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -133,58 +149,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any - ) -> "_models.WorkflowTrigger": + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any + ) -> _models.WorkflowTrigger: """Gets a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTrigger, or the result of cls(response) + :return: WorkflowTrigger or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTrigger - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTrigger"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTrigger] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -192,62 +208,63 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTrigger', pipeline_response) + deserialized = self._deserialize("WorkflowTrigger", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}"} # type: ignore @distributed_trace_async async def reset( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any ) -> None: """Resets a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_reset_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.reset.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -258,55 +275,56 @@ async def reset( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - reset.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/reset"} # type: ignore - + reset.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/reset"} # type: ignore @distributed_trace_async async def run( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any ) -> None: """Runs a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_run_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.run.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -317,55 +335,56 @@ async def run( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - run.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run"} # type: ignore - + run.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run"} # type: ignore @distributed_trace_async async def get_schema_json( - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any - ) -> "_models.JsonSchema": + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any + ) -> _models.JsonSchema: """Get the trigger schema as JSON. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: JsonSchema, or the result of cls(response) + :return: JsonSchema or the result of cls(response) :rtype: ~azure.mgmt.logic.models.JsonSchema - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JsonSchema"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JsonSchema] - request = build_get_schema_json_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_schema_json.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -373,15 +392,74 @@ async def get_schema_json( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('JsonSchema', pipeline_response) + deserialized = self._deserialize("JsonSchema", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_schema_json.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/schemas/json"} # type: ignore + get_schema_json.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/schemas/json"} # type: ignore + @overload + async def set_state( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + set_state: _models.SetTriggerStateActionDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets the state of a workflow trigger. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param trigger_name: The workflow trigger name. Required. + :type trigger_name: str + :param set_state: The workflow trigger state. Required. + :type set_state: ~azure.mgmt.logic.models.SetTriggerStateActionDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def set_state( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + set_state: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets the state of a workflow trigger. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param trigger_name: The workflow trigger name. Required. + :type trigger_name: str + :param set_state: The workflow trigger state. Required. + :type set_state: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def set_state( # pylint: disable=inconsistent-return-statements @@ -389,53 +467,70 @@ 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: Union[_models.SetTriggerStateActionDefinition, IO], **kwargs: Any ) -> None: """Sets the state of a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str - :param set_state: The workflow trigger state. - :type set_state: ~azure.mgmt.logic.models.SetTriggerStateActionDefinition + :param set_state: The workflow trigger state. Is either a model type or a IO type. Required. + :type set_state: ~azure.mgmt.logic.models.SetTriggerStateActionDefinition or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] - _json = self._serialize.body(set_state, 'SetTriggerStateActionDefinition') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(set_state, (IO, bytes)): + _content = set_state + else: + _json = self._serialize.body(set_state, "SetTriggerStateActionDefinition") request = build_set_state_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.set_state.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -446,55 +541,56 @@ async def set_state( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - set_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/setState"} # type: ignore - + set_state.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/setState"} # type: ignore @distributed_trace_async async def list_callback_url( - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: """Get the callback URL for a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - request = build_list_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_callback_url.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -502,12 +598,11 @@ async def list_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl"} # type: ignore - + list_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl"} # type: ignore 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..2b48b192a5df 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 @@ -6,103 +6,194 @@ # 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, Optional, TypeVar - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 from ..._vendor import _convert_request from ...operations._workflow_version_triggers_operations import build_list_callback_url_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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 + @overload async def list_callback_url( self, resource_group_name: str, workflow_name: str, version_id: str, trigger_name: str, - parameters: Optional["_models.GetCallbackUrlParameters"] = None, + parameters: Optional[_models.GetCallbackUrlParameters] = None, + *, + content_type: str = "application/json", **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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param version_id: The workflow versionId. + :param version_id: The workflow versionId. Required. :type version_id: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :param parameters: The callback URL parameters. Default value is None. :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + version_id: str, + trigger_name: str, + parameters: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the callback url for a trigger of a workflow version. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param version_id: The workflow versionId. Required. + :type version_id: str + :param trigger_name: The workflow trigger name. Required. + :type trigger_name: str + :param parameters: The callback URL parameters. Default value is None. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + version_id: str, + trigger_name: str, + parameters: Optional[Union[_models.GetCallbackUrlParameters, IO]] = None, + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the callback url for a trigger of a workflow version. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param version_id: The workflow versionId. Required. + :type version_id: str + :param trigger_name: The workflow trigger name. Required. + :type trigger_name: str + :param parameters: The callback URL parameters. Is either a model type or a IO type. Default + value is None. + :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - if parameters is not None: - _json = self._serialize.body(parameters, 'GetCallbackUrlParameters') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, bytes)): + _content = parameters else: - _json = None + if parameters is not None: + _json = self._serialize.body(parameters, "GetCallbackUrlParameters") + else: + _json = None request = build_list_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, version_id=version_id, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -110,12 +201,11 @@ async def list_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl"} # type: ignore - + list_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl"} # type: ignore 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..f73421b363d4 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 @@ -7,100 +7,107 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse 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 from ..._vendor import _convert_request from ...operations._workflow_versions_operations import build_get_request, build_list_request -T = TypeVar('T') + +T = TypeVar("T") 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. +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.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( - self, - resource_group_name: str, - workflow_name: str, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkflowVersionListResult"]: + self, resource_group_name: str, workflow_name: str, top: Optional[int] = None, **kwargs: Any + ) -> AsyncIterable["_models.WorkflowVersion"]: """Gets a list of workflow versions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowVersionListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowVersionListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either WorkflowVersion or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowVersion] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -114,10 +121,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -128,58 +133,58 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - workflow_name: str, - version_id: str, - **kwargs: Any - ) -> "_models.WorkflowVersion": + self, resource_group_name: str, workflow_name: str, version_id: str, **kwargs: Any + ) -> _models.WorkflowVersion: """Gets a workflow version. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param version_id: The workflow versionId. + :param version_id: The workflow versionId. Required. :type version_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowVersion, or the result of cls(response) + :return: WorkflowVersion or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowVersion - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowVersion] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, version_id=version_id, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -187,12 +192,11 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowVersion', pipeline_response) + deserialized = self._deserialize("WorkflowVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}"} # type: ignore 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..93478740a33a 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,54 +6,81 @@ # 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 +import sys +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod 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 from ... import models as _models from ..._vendor import _convert_request -from ...operations._workflows_operations import build_create_or_update_request, build_delete_request, build_disable_request, build_enable_request, build_generate_upgraded_definition_request, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_list_callback_url_request, build_list_swagger_request, build_move_request_initial, build_regenerate_access_key_request, build_update_request, build_validate_by_location_request, build_validate_by_resource_group_request -T = TypeVar('T') +from ...operations._workflows_operations import ( + build_create_or_update_request, + build_delete_request, + build_disable_request, + build_enable_request, + build_generate_upgraded_definition_request, + build_get_request, + build_list_by_resource_group_request, + build_list_by_subscription_request, + build_list_callback_url_request, + build_list_swagger_request, + build_move_request, + build_regenerate_access_key_request, + build_update_request, + build_validate_by_location_request, + build_validate_by_resource_group_request, +) + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") 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. +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.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( - self, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkflowListResult"]: + self, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.Workflow"]: """Gets a list of workflows by subscription. :param top: The number of items to be included in the result. Default value is None. @@ -62,41 +89,47 @@ def list_by_subscription( Trigger, and ReferencedResourceId. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Workflow or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.Workflow] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_subscription_request( subscription_id=self._config.subscription_id, - api_version=api_version, top=top, filter=filter, - template_url=self.list_by_subscription.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -110,10 +143,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -124,23 +155,17 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/workflows"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/workflows"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterable["_models.WorkflowListResult"]: + self, resource_group_name: str, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncIterable["_models.Workflow"]: """Gets a list of workflows by resource group. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -148,43 +173,48 @@ def list_by_resource_group( Trigger, and ReferencedResourceId. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.WorkflowListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Workflow or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.logic.models.Workflow] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list_by_resource_group.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -198,10 +228,8 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -212,54 +240,53 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows"} # type: ignore @distributed_trace_async - async def get( - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any - ) -> "_models.Workflow": + async def get(self, resource_group_name: str, workflow_name: str, **kwargs: Any) -> _models.Workflow: """Gets a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workflow, or the result of cls(response) + :return: Workflow or the result of cls(response) :rtype: ~azure.mgmt.logic.models.Workflow - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Workflow] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -267,65 +294,131 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('Workflow', pipeline_response) + deserialized = self._deserialize("Workflow", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore - - @distributed_trace_async + @overload async def create_or_update( self, resource_group_name: str, workflow_name: str, - workflow: "_models.Workflow", + workflow: _models.Workflow, + *, + content_type: str = "application/json", **kwargs: Any - ) -> "_models.Workflow": + ) -> _models.Workflow: """Creates or updates a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param workflow: The workflow. + :param workflow: The workflow. Required. :type workflow: ~azure.mgmt.logic.models.Workflow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.Workflow + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + workflow_name: str, + workflow: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Workflow: + """Creates or updates a workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param workflow: The workflow. Required. + :type workflow: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.Workflow + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, resource_group_name: str, workflow_name: str, workflow: Union[_models.Workflow, IO], **kwargs: Any + ) -> _models.Workflow: + """Creates or updates a workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param workflow: The workflow. Is either a model type or a IO type. Required. + :type workflow: ~azure.mgmt.logic.models.Workflow or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workflow, or the result of cls(response) + :return: Workflow or the result of cls(response) :rtype: ~azure.mgmt.logic.models.Workflow - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Workflow] - _json = self._serialize.body(workflow, 'Workflow') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(workflow, (IO, bytes)): + _content = workflow + else: + _json = self._serialize.body(workflow, "Workflow") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -334,61 +427,61 @@ async def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('Workflow', pipeline_response) + deserialized = self._deserialize("Workflow", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Workflow', pipeline_response) + deserialized = self._deserialize("Workflow", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore @distributed_trace_async - async def update( - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any - ) -> "_models.Workflow": + async def update(self, resource_group_name: str, workflow_name: str, **kwargs: Any) -> _models.Workflow: """Updates a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workflow, or the result of cls(response) + :return: Workflow or the result of cls(response) :rtype: ~azure.mgmt.logic.models.Workflow - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Workflow] - request = build_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.update.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -396,58 +489,60 @@ async def update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('Workflow', pipeline_response) + deserialized = self._deserialize("Workflow", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, **kwargs: Any ) -> None: """Deletes a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -458,51 +553,53 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore @distributed_trace_async async def disable( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, **kwargs: Any ) -> None: """Disables a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_disable_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -513,51 +610,53 @@ async def disable( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - disable.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable"} # type: ignore - + disable.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable"} # type: ignore @distributed_trace_async async def enable( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, **kwargs: Any ) -> None: """Enables a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_enable_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -568,58 +667,129 @@ async def enable( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - enable.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable"} # type: ignore + enable.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable"} # type: ignore + + @overload + async def generate_upgraded_definition( + self, + resource_group_name: str, + workflow_name: str, + parameters: _models.GenerateUpgradedDefinitionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + """Generates the upgraded definition for a workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param parameters: Parameters for generating an upgraded definition. Required. + :type parameters: ~azure.mgmt.logic.models.GenerateUpgradedDefinitionParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def generate_upgraded_definition( + self, + resource_group_name: str, + workflow_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + """Generates the upgraded definition for a workflow. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param parameters: Parameters for generating an upgraded definition. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def generate_upgraded_definition( self, resource_group_name: str, workflow_name: str, - parameters: "_models.GenerateUpgradedDefinitionParameters", + parameters: Union[_models.GenerateUpgradedDefinitionParameters, IO], **kwargs: Any - ) -> Any: + ) -> JSON: """Generates the upgraded definition for a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param parameters: Parameters for generating an upgraded definition. - :type parameters: ~azure.mgmt.logic.models.GenerateUpgradedDefinitionParameters + :param parameters: Parameters for generating an upgraded definition. Is either a model type or + a IO type. Required. + :type parameters: ~azure.mgmt.logic.models.GenerateUpgradedDefinitionParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: any, or the result of cls(response) - :rtype: any - :raises: ~azure.core.exceptions.HttpResponseError + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(parameters, 'GenerateUpgradedDefinitionParameters') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "GenerateUpgradedDefinitionParameters") request = build_generate_upgraded_definition_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.generate_upgraded_definition.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -627,65 +797,136 @@ async def generate_upgraded_definition( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - generate_upgraded_definition.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/generateUpgradedDefinition"} # type: ignore + generate_upgraded_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/generateUpgradedDefinition"} # type: ignore + + @overload + async def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + list_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the workflow callback Url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param list_callback_url: Which callback url to list. Required. + :type list_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload + async def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + list_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the workflow callback Url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param list_callback_url: Which callback url to list. Required. + :type list_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def list_callback_url( self, resource_group_name: str, workflow_name: str, - list_callback_url: "_models.GetCallbackUrlParameters", + list_callback_url: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the workflow callback Url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param list_callback_url: Which callback url to list. - :type list_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_callback_url: Which callback url to list. Is either a model type or a IO type. + Required. + :type list_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(list_callback_url, 'GetCallbackUrlParameters') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_callback_url, (IO, bytes)): + _content = list_callback_url + else: + _json = self._serialize.body(list_callback_url, "GetCallbackUrlParameters") request = build_list_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -693,58 +934,58 @@ async def list_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listCallbackUrl"} # type: ignore - + list_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listCallbackUrl"} # type: ignore @distributed_trace_async - async def list_swagger( - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any - ) -> Any: + async def list_swagger(self, resource_group_name: str, workflow_name: str, **kwargs: Any) -> JSON: """Gets an OpenAPI definition for the workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: any, or the result of cls(response) - :rtype: any - :raises: ~azure.core.exceptions.HttpResponseError + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_list_swagger_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_swagger.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -752,79 +993,93 @@ async def list_swagger( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_swagger.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listSwagger"} # type: ignore - + list_swagger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listSwagger"} # type: ignore async def _move_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - move: "_models.WorkflowReference", - **kwargs: Any + self, resource_group_name: str, workflow_name: str, move: Union[_models.WorkflowReference, IO], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(move, 'WorkflowReference') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_move_request_initial( - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(move, (IO, bytes)): + _content = move + else: + _json = self._serialize.body(move, "WorkflowReference") + + request = build_move_request( resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._move_initial.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _move_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move"} # type: ignore - + _move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move"} # type: ignore - @distributed_trace_async - async def begin_move( # pylint: disable=inconsistent-return-statements + @overload + async def begin_move( self, resource_group_name: str, workflow_name: str, - move: "_models.WorkflowReference", + move: _models.WorkflowReference, + *, + content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[None]: """Moves an existing workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param move: The workflow to move. + :param move: The workflow to move. Required. :type move: ~azure.mgmt.logic.models.WorkflowReference + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -835,97 +1090,234 @@ async def begin_move( # pylint: disable=inconsistent-return-statements Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + async def begin_move( + self, + resource_group_name: str, + workflow_name: str, + move: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Moves an existing workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param move: The workflow to move. Required. + :type move: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_move( + self, resource_group_name: str, workflow_name: str, move: Union[_models.WorkflowReference, IO], **kwargs: Any + ) -> AsyncLROPoller[None]: + """Moves an existing workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param move: The workflow to move. Is either a model type or a IO type. Required. + :type move: ~azure.mgmt.logic.models.WorkflowReference or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + 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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_move.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move"} # type: ignore + begin_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move"} # type: ignore - @distributed_trace_async + @overload async 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, + *, + content_type: str = "application/json", **kwargs: Any ) -> None: """Regenerates the callback URL access key for request triggers. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param key_type: The access key type. + :param key_type: The access key type. Required. :type key_type: ~azure.mgmt.logic.models.RegenerateActionParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def regenerate_access_key( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + key_type: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Regenerates the callback URL access key for request triggers. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param key_type: The access key type. Required. + :type key_type: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def regenerate_access_key( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + key_type: Union[_models.RegenerateActionParameter, IO], + **kwargs: Any + ) -> None: + """Regenerates the callback URL access key for request triggers. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param key_type: The access key type. Is either a model type or a IO type. Required. + :type key_type: ~azure.mgmt.logic.models.RegenerateActionParameter or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(key_type, 'RegenerateActionParameter') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(key_type, (IO, bytes)): + _content = key_type + else: + _json = self._serialize.body(key_type, "RegenerateActionParameter") request = build_regenerate_access_key_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.regenerate_access_key.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -936,58 +1328,124 @@ async def regenerate_access_key( # pylint: disable=inconsistent-return-statemen if cls: return cls(pipeline_response, None, {}) - regenerate_access_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey"} # type: ignore - + regenerate_access_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey"} # type: ignore - @distributed_trace_async + @overload async def validate_by_resource_group( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workflow_name: str, - validate: "_models.Workflow", + validate: _models.Workflow, + *, + content_type: str = "application/json", **kwargs: Any ) -> None: """Validates the workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param validate: The workflow. + :param validate: The workflow. Required. :type validate: ~azure.mgmt.logic.models.Workflow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_by_resource_group( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + validate: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Validates the workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param validate: The workflow. Required. + :type validate: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def validate_by_resource_group( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, workflow_name: str, validate: Union[_models.Workflow, IO], **kwargs: Any + ) -> None: + """Validates the workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param validate: The workflow. Is either a model type or a IO type. Required. + :type validate: ~azure.mgmt.logic.models.Workflow or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(validate, 'Workflow') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate, (IO, bytes)): + _content = validate + else: + _json = self._serialize.body(validate, "Workflow") request = build_validate_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.validate_by_resource_group.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -998,8 +1456,67 @@ async def validate_by_resource_group( # pylint: disable=inconsistent-return-sta if cls: return cls(pipeline_response, None, {}) - validate_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate"} # type: ignore + validate_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate"} # type: ignore + + @overload + async def validate_by_location( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + location: str, + workflow_name: str, + validate: _models.Workflow, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Validates the workflow definition. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param location: The workflow location. Required. + :type location: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param validate: The workflow. Required. + :type validate: ~azure.mgmt.logic.models.Workflow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def validate_by_location( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + location: str, + workflow_name: str, + validate: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Validates the workflow definition. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param location: The workflow location. Required. + :type location: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param validate: The workflow. Required. + :type validate: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace_async async def validate_by_location( # pylint: disable=inconsistent-return-statements @@ -1007,53 +1524,70 @@ async def validate_by_location( # pylint: disable=inconsistent-return-statement resource_group_name: str, location: str, workflow_name: str, - validate: "_models.Workflow", + validate: Union[_models.Workflow, IO], **kwargs: Any ) -> None: """Validates the workflow definition. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param location: The workflow location. + :param location: The workflow location. Required. :type location: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param validate: The workflow. - :type validate: ~azure.mgmt.logic.models.Workflow + :param validate: The workflow. Is either a model type or a IO type. Required. + :type validate: ~azure.mgmt.logic.models.Workflow or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(validate, 'Workflow') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate, (IO, bytes)): + _content = validate + else: + _json = self._serialize.body(validate, "Workflow") request = build_validate_by_location_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, location=location, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.validate_by_location.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1064,5 +1598,4 @@ async def validate_by_location( # pylint: disable=inconsistent-return-statement if cls: return cls(pipeline_response, None, {}) - validate_by_location.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate"} # type: ignore - + validate_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate"} # type: ignore 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..44104f990475 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 @@ -212,306 +212,308 @@ from ._models_py3 import X12ValidationOverride from ._models_py3 import X12ValidationSettings - -from ._logic_management_client_enums import ( - AgreementType, - ApiDeploymentParameterVisibility, - ApiTier, - ApiType, - AzureAsyncOperationState, - DayOfWeek, - DaysOfWeek, - EdifactCharacterSet, - EdifactDecimalIndicator, - EncryptionAlgorithm, - ErrorResponseCode, - EventLevel, - HashingAlgorithm, - IntegrationAccountSkuName, - IntegrationServiceEnvironmentAccessEndpointType, - IntegrationServiceEnvironmentNetworkDependencyCategoryType, - IntegrationServiceEnvironmentNetworkDependencyHealthState, - IntegrationServiceEnvironmentNetworkEndPointAccessibilityState, - IntegrationServiceEnvironmentSkuName, - IntegrationServiceEnvironmentSkuScaleType, - KeyType, - ManagedServiceIdentityType, - MapType, - MessageFilterType, - OpenAuthenticationProviderType, - ParameterType, - PartnerType, - RecurrenceFrequency, - SchemaType, - SegmentTerminatorSuffix, - SigningAlgorithm, - SkuName, - StatusAnnotation, - SwaggerSchemaType, - TrackEventsOperationOptions, - TrackingRecordType, - TrailingSeparatorPolicy, - UsageIndicator, - WorkflowProvisioningState, - WorkflowState, - WorkflowStatus, - WorkflowTriggerProvisioningState, - WsdlImportMethod, - X12CharacterSet, - X12DateFormat, - X12TimeFormat, -) +from ._logic_management_client_enums import AgreementType +from ._logic_management_client_enums import ApiDeploymentParameterVisibility +from ._logic_management_client_enums import ApiTier +from ._logic_management_client_enums import ApiType +from ._logic_management_client_enums import AzureAsyncOperationState +from ._logic_management_client_enums import DayOfWeek +from ._logic_management_client_enums import DaysOfWeek +from ._logic_management_client_enums import EdifactCharacterSet +from ._logic_management_client_enums import EdifactDecimalIndicator +from ._logic_management_client_enums import EncryptionAlgorithm +from ._logic_management_client_enums import ErrorResponseCode +from ._logic_management_client_enums import EventLevel +from ._logic_management_client_enums import HashingAlgorithm +from ._logic_management_client_enums import IntegrationAccountSkuName +from ._logic_management_client_enums import IntegrationServiceEnvironmentAccessEndpointType +from ._logic_management_client_enums import IntegrationServiceEnvironmentNetworkDependencyCategoryType +from ._logic_management_client_enums import IntegrationServiceEnvironmentNetworkDependencyHealthState +from ._logic_management_client_enums import IntegrationServiceEnvironmentNetworkEndPointAccessibilityState +from ._logic_management_client_enums import IntegrationServiceEnvironmentSkuName +from ._logic_management_client_enums import IntegrationServiceEnvironmentSkuScaleType +from ._logic_management_client_enums import KeyType +from ._logic_management_client_enums import ManagedServiceIdentityType +from ._logic_management_client_enums import MapType +from ._logic_management_client_enums import MessageFilterType +from ._logic_management_client_enums import OpenAuthenticationProviderType +from ._logic_management_client_enums import ParameterType +from ._logic_management_client_enums import PartnerType +from ._logic_management_client_enums import RecurrenceFrequency +from ._logic_management_client_enums import SchemaType +from ._logic_management_client_enums import SegmentTerminatorSuffix +from ._logic_management_client_enums import SigningAlgorithm +from ._logic_management_client_enums import SkuName +from ._logic_management_client_enums import StatusAnnotation +from ._logic_management_client_enums import SwaggerSchemaType +from ._logic_management_client_enums import TrackEventsOperationOptions +from ._logic_management_client_enums import TrackingRecordType +from ._logic_management_client_enums import TrailingSeparatorPolicy +from ._logic_management_client_enums import UsageIndicator +from ._logic_management_client_enums import WorkflowProvisioningState +from ._logic_management_client_enums import WorkflowState +from ._logic_management_client_enums import WorkflowStatus +from ._logic_management_client_enums import WorkflowTriggerProvisioningState +from ._logic_management_client_enums import WsdlImportMethod +from ._logic_management_client_enums import X12CharacterSet +from ._logic_management_client_enums import X12DateFormat +from ._logic_management_client_enums import 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', - 'AS2EnvelopeSettings', - 'AS2ErrorSettings', - 'AS2MdnSettings', - 'AS2MessageConnectionSettings', - 'AS2OneWayAgreement', - 'AS2ProtocolSettings', - 'AS2SecuritySettings', - 'AS2ValidationSettings', - 'AgreementContent', - 'ApiDeploymentParameterMetadata', - 'ApiDeploymentParameterMetadataSet', - 'ApiOperation', - 'ApiOperationAnnotation', - 'ApiOperationListResult', - 'ApiOperationPropertiesDefinition', - 'ApiReference', - 'ApiResourceBackendService', - 'ApiResourceDefinitions', - 'ApiResourceGeneralInformation', - 'ApiResourceMetadata', - 'ApiResourcePolicies', - 'ApiResourceProperties', - 'ArtifactContentPropertiesDefinition', - 'ArtifactProperties', - 'AssemblyCollection', - 'AssemblyDefinition', - 'AssemblyProperties', - 'AzureResourceErrorInfo', - 'B2BPartnerContent', - 'BatchConfiguration', - 'BatchConfigurationCollection', - 'BatchConfigurationProperties', - 'BatchReleaseCriteria', - 'BusinessIdentity', - 'CallbackUrl', - 'ContentHash', - 'ContentLink', - 'Correlation', - 'EdifactAcknowledgementSettings', - 'EdifactAgreementContent', - 'EdifactDelimiterOverride', - 'EdifactEnvelopeOverride', - 'EdifactEnvelopeSettings', - 'EdifactFramingSettings', - 'EdifactMessageFilter', - 'EdifactMessageIdentifier', - 'EdifactOneWayAgreement', - 'EdifactProcessingSettings', - 'EdifactProtocolSettings', - 'EdifactSchemaReference', - 'EdifactValidationOverride', - 'EdifactValidationSettings', - 'ErrorInfo', - 'ErrorProperties', - 'ErrorResponse', - 'Expression', - 'ExpressionRoot', - 'ExpressionTraces', - 'ExtendedErrorInfo', - 'FlowAccessControlConfiguration', - 'FlowAccessControlConfigurationPolicy', - 'FlowEndpoints', - 'FlowEndpointsConfiguration', - 'GenerateUpgradedDefinitionParameters', - 'GetCallbackUrlParameters', - 'IntegrationAccount', - 'IntegrationAccountAgreement', - 'IntegrationAccountAgreementFilter', - 'IntegrationAccountAgreementListResult', - 'IntegrationAccountCertificate', - 'IntegrationAccountCertificateListResult', - 'IntegrationAccountListResult', - 'IntegrationAccountMap', - 'IntegrationAccountMapFilter', - 'IntegrationAccountMapListResult', - 'IntegrationAccountMapPropertiesParametersSchema', - 'IntegrationAccountPartner', - 'IntegrationAccountPartnerFilter', - 'IntegrationAccountPartnerListResult', - 'IntegrationAccountSchema', - 'IntegrationAccountSchemaFilter', - 'IntegrationAccountSchemaListResult', - 'IntegrationAccountSession', - 'IntegrationAccountSessionFilter', - 'IntegrationAccountSessionListResult', - 'IntegrationAccountSku', - 'IntegrationServiceEnvironmenEncryptionConfiguration', - 'IntegrationServiceEnvironmenEncryptionKeyReference', - 'IntegrationServiceEnvironment', - 'IntegrationServiceEnvironmentAccessEndpoint', - 'IntegrationServiceEnvironmentListResult', - 'IntegrationServiceEnvironmentManagedApi', - 'IntegrationServiceEnvironmentManagedApiDeploymentParameters', - 'IntegrationServiceEnvironmentManagedApiListResult', - 'IntegrationServiceEnvironmentManagedApiProperties', - 'IntegrationServiceEnvironmentNetworkDependency', - 'IntegrationServiceEnvironmentNetworkDependencyHealth', - 'IntegrationServiceEnvironmentNetworkEndpoint', - 'IntegrationServiceEnvironmentProperties', - 'IntegrationServiceEnvironmentSku', - 'IntegrationServiceEnvironmentSkuCapacity', - 'IntegrationServiceEnvironmentSkuDefinition', - 'IntegrationServiceEnvironmentSkuDefinitionSku', - 'IntegrationServiceEnvironmentSkuList', - 'IntegrationServiceEnvironmentSubnetNetworkHealth', - 'IpAddress', - 'IpAddressRange', - 'JsonSchema', - 'KeyVaultKey', - 'KeyVaultKeyAttributes', - 'KeyVaultKeyCollection', - 'KeyVaultKeyReference', - 'KeyVaultKeyReferenceKeyVault', - 'KeyVaultReference', - 'ListKeyVaultKeysDefinition', - 'ManagedApi', - 'ManagedApiListResult', - 'ManagedServiceIdentity', - 'NetworkConfiguration', - 'OpenAuthenticationAccessPolicies', - 'OpenAuthenticationAccessPolicy', - 'OpenAuthenticationPolicyClaim', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'OperationResult', - 'OperationResultProperties', - 'PartnerContent', - 'RecurrenceSchedule', - 'RecurrenceScheduleOccurrence', - 'RegenerateActionParameter', - 'RepetitionIndex', - 'Request', - 'RequestHistory', - 'RequestHistoryListResult', - 'RequestHistoryProperties', - 'Resource', - 'ResourceReference', - 'Response', - 'RetryHistory', - 'RunActionCorrelation', - 'RunCorrelation', - 'SetTriggerStateActionDefinition', - 'Sku', - 'SubResource', - 'SwaggerCustomDynamicList', - 'SwaggerCustomDynamicProperties', - 'SwaggerCustomDynamicSchema', - 'SwaggerCustomDynamicTree', - 'SwaggerCustomDynamicTreeCommand', - 'SwaggerCustomDynamicTreeParameter', - 'SwaggerCustomDynamicTreeSettings', - 'SwaggerExternalDocumentation', - 'SwaggerSchema', - 'SwaggerXml', - 'TrackingEvent', - 'TrackingEventErrorInfo', - 'TrackingEventsDefinition', - 'UserAssignedIdentity', - 'Workflow', - 'WorkflowFilter', - 'WorkflowListResult', - 'WorkflowOutputParameter', - 'WorkflowParameter', - 'WorkflowReference', - 'WorkflowRun', - 'WorkflowRunAction', - 'WorkflowRunActionFilter', - 'WorkflowRunActionListResult', - 'WorkflowRunActionRepetitionDefinition', - 'WorkflowRunActionRepetitionDefinitionCollection', - 'WorkflowRunActionRepetitionProperties', - 'WorkflowRunFilter', - 'WorkflowRunListResult', - 'WorkflowRunTrigger', - 'WorkflowTrigger', - 'WorkflowTriggerCallbackUrl', - 'WorkflowTriggerFilter', - 'WorkflowTriggerHistory', - 'WorkflowTriggerHistoryFilter', - 'WorkflowTriggerHistoryListResult', - 'WorkflowTriggerListCallbackUrlQueries', - 'WorkflowTriggerListResult', - 'WorkflowTriggerRecurrence', - 'WorkflowTriggerReference', - 'WorkflowVersion', - 'WorkflowVersionListResult', - 'WsdlService', - 'X12AcknowledgementSettings', - 'X12AgreementContent', - 'X12DelimiterOverrides', - 'X12EnvelopeOverride', - 'X12EnvelopeSettings', - 'X12FramingSettings', - 'X12MessageFilter', - 'X12MessageIdentifier', - 'X12OneWayAgreement', - 'X12ProcessingSettings', - 'X12ProtocolSettings', - 'X12SchemaReference', - 'X12SecuritySettings', - 'X12ValidationOverride', - 'X12ValidationSettings', - 'AgreementType', - 'ApiDeploymentParameterVisibility', - 'ApiTier', - 'ApiType', - 'AzureAsyncOperationState', - 'DayOfWeek', - 'DaysOfWeek', - 'EdifactCharacterSet', - 'EdifactDecimalIndicator', - 'EncryptionAlgorithm', - 'ErrorResponseCode', - 'EventLevel', - 'HashingAlgorithm', - 'IntegrationAccountSkuName', - 'IntegrationServiceEnvironmentAccessEndpointType', - 'IntegrationServiceEnvironmentNetworkDependencyCategoryType', - 'IntegrationServiceEnvironmentNetworkDependencyHealthState', - 'IntegrationServiceEnvironmentNetworkEndPointAccessibilityState', - 'IntegrationServiceEnvironmentSkuName', - 'IntegrationServiceEnvironmentSkuScaleType', - 'KeyType', - 'ManagedServiceIdentityType', - 'MapType', - 'MessageFilterType', - 'OpenAuthenticationProviderType', - 'ParameterType', - 'PartnerType', - 'RecurrenceFrequency', - 'SchemaType', - 'SegmentTerminatorSuffix', - 'SigningAlgorithm', - 'SkuName', - 'StatusAnnotation', - 'SwaggerSchemaType', - 'TrackEventsOperationOptions', - 'TrackingRecordType', - 'TrailingSeparatorPolicy', - 'UsageIndicator', - 'WorkflowProvisioningState', - 'WorkflowState', - 'WorkflowStatus', - 'WorkflowTriggerProvisioningState', - 'WsdlImportMethod', - 'X12CharacterSet', - 'X12DateFormat', - 'X12TimeFormat', + "AS2AcknowledgementConnectionSettings", + "AS2AgreementContent", + "AS2EnvelopeSettings", + "AS2ErrorSettings", + "AS2MdnSettings", + "AS2MessageConnectionSettings", + "AS2OneWayAgreement", + "AS2ProtocolSettings", + "AS2SecuritySettings", + "AS2ValidationSettings", + "AgreementContent", + "ApiDeploymentParameterMetadata", + "ApiDeploymentParameterMetadataSet", + "ApiOperation", + "ApiOperationAnnotation", + "ApiOperationListResult", + "ApiOperationPropertiesDefinition", + "ApiReference", + "ApiResourceBackendService", + "ApiResourceDefinitions", + "ApiResourceGeneralInformation", + "ApiResourceMetadata", + "ApiResourcePolicies", + "ApiResourceProperties", + "ArtifactContentPropertiesDefinition", + "ArtifactProperties", + "AssemblyCollection", + "AssemblyDefinition", + "AssemblyProperties", + "AzureResourceErrorInfo", + "B2BPartnerContent", + "BatchConfiguration", + "BatchConfigurationCollection", + "BatchConfigurationProperties", + "BatchReleaseCriteria", + "BusinessIdentity", + "CallbackUrl", + "ContentHash", + "ContentLink", + "Correlation", + "EdifactAcknowledgementSettings", + "EdifactAgreementContent", + "EdifactDelimiterOverride", + "EdifactEnvelopeOverride", + "EdifactEnvelopeSettings", + "EdifactFramingSettings", + "EdifactMessageFilter", + "EdifactMessageIdentifier", + "EdifactOneWayAgreement", + "EdifactProcessingSettings", + "EdifactProtocolSettings", + "EdifactSchemaReference", + "EdifactValidationOverride", + "EdifactValidationSettings", + "ErrorInfo", + "ErrorProperties", + "ErrorResponse", + "Expression", + "ExpressionRoot", + "ExpressionTraces", + "ExtendedErrorInfo", + "FlowAccessControlConfiguration", + "FlowAccessControlConfigurationPolicy", + "FlowEndpoints", + "FlowEndpointsConfiguration", + "GenerateUpgradedDefinitionParameters", + "GetCallbackUrlParameters", + "IntegrationAccount", + "IntegrationAccountAgreement", + "IntegrationAccountAgreementFilter", + "IntegrationAccountAgreementListResult", + "IntegrationAccountCertificate", + "IntegrationAccountCertificateListResult", + "IntegrationAccountListResult", + "IntegrationAccountMap", + "IntegrationAccountMapFilter", + "IntegrationAccountMapListResult", + "IntegrationAccountMapPropertiesParametersSchema", + "IntegrationAccountPartner", + "IntegrationAccountPartnerFilter", + "IntegrationAccountPartnerListResult", + "IntegrationAccountSchema", + "IntegrationAccountSchemaFilter", + "IntegrationAccountSchemaListResult", + "IntegrationAccountSession", + "IntegrationAccountSessionFilter", + "IntegrationAccountSessionListResult", + "IntegrationAccountSku", + "IntegrationServiceEnvironmenEncryptionConfiguration", + "IntegrationServiceEnvironmenEncryptionKeyReference", + "IntegrationServiceEnvironment", + "IntegrationServiceEnvironmentAccessEndpoint", + "IntegrationServiceEnvironmentListResult", + "IntegrationServiceEnvironmentManagedApi", + "IntegrationServiceEnvironmentManagedApiDeploymentParameters", + "IntegrationServiceEnvironmentManagedApiListResult", + "IntegrationServiceEnvironmentManagedApiProperties", + "IntegrationServiceEnvironmentNetworkDependency", + "IntegrationServiceEnvironmentNetworkDependencyHealth", + "IntegrationServiceEnvironmentNetworkEndpoint", + "IntegrationServiceEnvironmentProperties", + "IntegrationServiceEnvironmentSku", + "IntegrationServiceEnvironmentSkuCapacity", + "IntegrationServiceEnvironmentSkuDefinition", + "IntegrationServiceEnvironmentSkuDefinitionSku", + "IntegrationServiceEnvironmentSkuList", + "IntegrationServiceEnvironmentSubnetNetworkHealth", + "IpAddress", + "IpAddressRange", + "JsonSchema", + "KeyVaultKey", + "KeyVaultKeyAttributes", + "KeyVaultKeyCollection", + "KeyVaultKeyReference", + "KeyVaultKeyReferenceKeyVault", + "KeyVaultReference", + "ListKeyVaultKeysDefinition", + "ManagedApi", + "ManagedApiListResult", + "ManagedServiceIdentity", + "NetworkConfiguration", + "OpenAuthenticationAccessPolicies", + "OpenAuthenticationAccessPolicy", + "OpenAuthenticationPolicyClaim", + "Operation", + "OperationDisplay", + "OperationListResult", + "OperationResult", + "OperationResultProperties", + "PartnerContent", + "RecurrenceSchedule", + "RecurrenceScheduleOccurrence", + "RegenerateActionParameter", + "RepetitionIndex", + "Request", + "RequestHistory", + "RequestHistoryListResult", + "RequestHistoryProperties", + "Resource", + "ResourceReference", + "Response", + "RetryHistory", + "RunActionCorrelation", + "RunCorrelation", + "SetTriggerStateActionDefinition", + "Sku", + "SubResource", + "SwaggerCustomDynamicList", + "SwaggerCustomDynamicProperties", + "SwaggerCustomDynamicSchema", + "SwaggerCustomDynamicTree", + "SwaggerCustomDynamicTreeCommand", + "SwaggerCustomDynamicTreeParameter", + "SwaggerCustomDynamicTreeSettings", + "SwaggerExternalDocumentation", + "SwaggerSchema", + "SwaggerXml", + "TrackingEvent", + "TrackingEventErrorInfo", + "TrackingEventsDefinition", + "UserAssignedIdentity", + "Workflow", + "WorkflowFilter", + "WorkflowListResult", + "WorkflowOutputParameter", + "WorkflowParameter", + "WorkflowReference", + "WorkflowRun", + "WorkflowRunAction", + "WorkflowRunActionFilter", + "WorkflowRunActionListResult", + "WorkflowRunActionRepetitionDefinition", + "WorkflowRunActionRepetitionDefinitionCollection", + "WorkflowRunActionRepetitionProperties", + "WorkflowRunFilter", + "WorkflowRunListResult", + "WorkflowRunTrigger", + "WorkflowTrigger", + "WorkflowTriggerCallbackUrl", + "WorkflowTriggerFilter", + "WorkflowTriggerHistory", + "WorkflowTriggerHistoryFilter", + "WorkflowTriggerHistoryListResult", + "WorkflowTriggerListCallbackUrlQueries", + "WorkflowTriggerListResult", + "WorkflowTriggerRecurrence", + "WorkflowTriggerReference", + "WorkflowVersion", + "WorkflowVersionListResult", + "WsdlService", + "X12AcknowledgementSettings", + "X12AgreementContent", + "X12DelimiterOverrides", + "X12EnvelopeOverride", + "X12EnvelopeSettings", + "X12FramingSettings", + "X12MessageFilter", + "X12MessageIdentifier", + "X12OneWayAgreement", + "X12ProcessingSettings", + "X12ProtocolSettings", + "X12SchemaReference", + "X12SecuritySettings", + "X12ValidationOverride", + "X12ValidationSettings", + "AgreementType", + "ApiDeploymentParameterVisibility", + "ApiTier", + "ApiType", + "AzureAsyncOperationState", + "DayOfWeek", + "DaysOfWeek", + "EdifactCharacterSet", + "EdifactDecimalIndicator", + "EncryptionAlgorithm", + "ErrorResponseCode", + "EventLevel", + "HashingAlgorithm", + "IntegrationAccountSkuName", + "IntegrationServiceEnvironmentAccessEndpointType", + "IntegrationServiceEnvironmentNetworkDependencyCategoryType", + "IntegrationServiceEnvironmentNetworkDependencyHealthState", + "IntegrationServiceEnvironmentNetworkEndPointAccessibilityState", + "IntegrationServiceEnvironmentSkuName", + "IntegrationServiceEnvironmentSkuScaleType", + "KeyType", + "ManagedServiceIdentityType", + "MapType", + "MessageFilterType", + "OpenAuthenticationProviderType", + "ParameterType", + "PartnerType", + "RecurrenceFrequency", + "SchemaType", + "SegmentTerminatorSuffix", + "SigningAlgorithm", + "SkuName", + "StatusAnnotation", + "SwaggerSchemaType", + "TrackEventsOperationOptions", + "TrackingRecordType", + "TrailingSeparatorPolicy", + "UsageIndicator", + "WorkflowProvisioningState", + "WorkflowState", + "WorkflowStatus", + "WorkflowTriggerProvisioningState", + "WsdlImportMethod", + "X12CharacterSet", + "X12DateFormat", + "X12TimeFormat", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() 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..cbbc1d1329e4 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,54 +7,54 @@ # -------------------------------------------------------------------------- from enum import Enum -from six import with_metaclass from azure.core import CaseInsensitiveEnumMeta -class AgreementType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The agreement type. - """ +class AgreementType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The agreement type.""" NOT_SPECIFIED = "NotSpecified" AS2 = "AS2" X12 = "X12" EDIFACT = "Edifact" -class ApiDeploymentParameterVisibility(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Api deployment parameter visibility. - """ + +class ApiDeploymentParameterVisibility(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Api deployment parameter visibility.""" NOT_SPECIFIED = "NotSpecified" DEFAULT = "Default" INTERNAL = "Internal" -class ApiTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Api tier. - """ + +class ApiTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Api tier.""" NOT_SPECIFIED = "NotSpecified" ENTERPRISE = "Enterprise" STANDARD = "Standard" PREMIUM = "Premium" -class ApiType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class ApiType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ApiType.""" NOT_SPECIFIED = "NotSpecified" REST = "Rest" SOAP = "Soap" -class AzureAsyncOperationState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The Azure async operation state. - """ + +class AzureAsyncOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Azure async operation state.""" FAILED = "Failed" SUCCEEDED = "Succeeded" PENDING = "Pending" CANCELED = "Canceled" -class DayOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The day of the week. - """ + +class DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The day of the week.""" SUNDAY = "Sunday" MONDAY = "Monday" @@ -64,7 +64,9 @@ class DayOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" SATURDAY = "Saturday" -class DaysOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + +class DaysOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """DaysOfWeek.""" SUNDAY = "Sunday" MONDAY = "Monday" @@ -74,9 +76,9 @@ class DaysOfWeek(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): FRIDAY = "Friday" SATURDAY = "Saturday" -class EdifactCharacterSet(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The edifact character set. - """ + +class EdifactCharacterSet(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The edifact character set.""" NOT_SPECIFIED = "NotSpecified" UNOB = "UNOB" @@ -94,17 +96,17 @@ class EdifactCharacterSet(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): UNOY = "UNOY" KECA = "KECA" -class EdifactDecimalIndicator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The edifact decimal indicator. - """ + +class EdifactDecimalIndicator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The edifact decimal indicator.""" NOT_SPECIFIED = "NotSpecified" COMMA = "Comma" DECIMAL = "Decimal" -class EncryptionAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The encryption algorithm. - """ + +class EncryptionAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The encryption algorithm.""" NOT_SPECIFIED = "NotSpecified" NONE = "None" @@ -114,18 +116,18 @@ class EncryptionAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): AES192 = "AES192" AES256 = "AES256" -class ErrorResponseCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The error response code. - """ + +class ErrorResponseCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The error response code.""" NOT_SPECIFIED = "NotSpecified" INTEGRATION_SERVICE_ENVIRONMENT_NOT_FOUND = "IntegrationServiceEnvironmentNotFound" INTERNAL_SERVER_ERROR = "InternalServerError" INVALID_OPERATION_ID = "InvalidOperationId" -class EventLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The event level. - """ + +class EventLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The event level.""" LOG_ALWAYS = "LogAlways" CRITICAL = "Critical" @@ -134,9 +136,9 @@ class EventLevel(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): INFORMATIONAL = "Informational" VERBOSE = "Verbose" -class HashingAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The signing or hashing algorithm. - """ + +class HashingAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The signing or hashing algorithm.""" NOT_SPECIFIED = "NotSpecified" NONE = "None" @@ -146,26 +148,26 @@ class HashingAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SHA2384 = "SHA2384" SHA2512 = "SHA2512" -class IntegrationAccountSkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The integration account sku name. - """ + +class IntegrationAccountSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The integration account sku name.""" NOT_SPECIFIED = "NotSpecified" FREE = "Free" BASIC = "Basic" STANDARD = "Standard" -class IntegrationServiceEnvironmentAccessEndpointType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The integration service environment access endpoint type. - """ + +class IntegrationServiceEnvironmentAccessEndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The integration service environment access endpoint type.""" NOT_SPECIFIED = "NotSpecified" EXTERNAL = "External" INTERNAL = "Internal" -class IntegrationServiceEnvironmentNetworkDependencyCategoryType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The integration service environment network dependency category type. - """ + +class IntegrationServiceEnvironmentNetworkDependencyCategoryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The integration service environment network dependency category type.""" NOT_SPECIFIED = "NotSpecified" AZURE_STORAGE = "AzureStorage" @@ -180,49 +182,50 @@ class IntegrationServiceEnvironmentNetworkDependencyCategoryType(with_metaclass( SQL = "SQL" REGIONAL_SERVICE = "RegionalService" -class IntegrationServiceEnvironmentNetworkDependencyHealthState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The integration service environment network dependency health state. - """ + +class IntegrationServiceEnvironmentNetworkDependencyHealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The integration service environment network dependency health state.""" NOT_SPECIFIED = "NotSpecified" HEALTHY = "Healthy" UNHEALTHY = "Unhealthy" UNKNOWN = "Unknown" -class IntegrationServiceEnvironmentNetworkEndPointAccessibilityState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The integration service environment network endpoint accessibility state. - """ + +class IntegrationServiceEnvironmentNetworkEndPointAccessibilityState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The integration service environment network endpoint accessibility state.""" NOT_SPECIFIED = "NotSpecified" UNKNOWN = "Unknown" AVAILABLE = "Available" NOT_AVAILABLE = "NotAvailable" -class IntegrationServiceEnvironmentSkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The integration service environment sku name. - """ + +class IntegrationServiceEnvironmentSkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The integration service environment sku name.""" NOT_SPECIFIED = "NotSpecified" PREMIUM = "Premium" DEVELOPER = "Developer" -class IntegrationServiceEnvironmentSkuScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The integration service environment sku scale type. - """ + +class IntegrationServiceEnvironmentSkuScaleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The integration service environment sku scale type.""" MANUAL = "Manual" AUTOMATIC = "Automatic" NONE = "None" -class KeyType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The key type. - """ + +class KeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The key type.""" NOT_SPECIFIED = "NotSpecified" 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,9 +234,9 @@ class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, En USER_ASSIGNED = "UserAssigned" NONE = "None" -class MapType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The map type. - """ + +class MapType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The map type.""" NOT_SPECIFIED = "NotSpecified" XSLT = "Xslt" @@ -241,23 +244,23 @@ class MapType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): XSLT30 = "Xslt30" LIQUID = "Liquid" -class MessageFilterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The message filter type. - """ + +class MessageFilterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The message filter type.""" NOT_SPECIFIED = "NotSpecified" INCLUDE = "Include" EXCLUDE = "Exclude" -class OpenAuthenticationProviderType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Open authentication policy provider type. - """ + +class OpenAuthenticationProviderType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Open authentication policy provider type.""" AAD = "AAD" -class ParameterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The parameter type. - """ + +class ParameterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The parameter type.""" NOT_SPECIFIED = "NotSpecified" STRING = "String" @@ -269,16 +272,16 @@ class ParameterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): OBJECT = "Object" SECURE_OBJECT = "SecureObject" -class PartnerType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The partner type. - """ + +class PartnerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The partner type.""" NOT_SPECIFIED = "NotSpecified" B2_B = "B2B" -class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The recurrence frequency. - """ + +class RecurrenceFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The recurrence frequency.""" NOT_SPECIFIED = "NotSpecified" SECOND = "Second" @@ -289,16 +292,16 @@ class RecurrenceFrequency(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): MONTH = "Month" YEAR = "Year" -class SchemaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The schema type. - """ + +class SchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The schema type.""" NOT_SPECIFIED = "NotSpecified" XML = "Xml" -class SegmentTerminatorSuffix(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The segment terminator suffix. - """ + +class SegmentTerminatorSuffix(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The segment terminator suffix.""" NOT_SPECIFIED = "NotSpecified" NONE = "None" @@ -306,9 +309,9 @@ class SegmentTerminatorSuffix(with_metaclass(CaseInsensitiveEnumMeta, str, Enum) LF = "LF" CRLF = "CRLF" -class SigningAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The signing or hashing algorithm. - """ + +class SigningAlgorithm(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The signing or hashing algorithm.""" NOT_SPECIFIED = "NotSpecified" DEFAULT = "Default" @@ -317,9 +320,9 @@ class SigningAlgorithm(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): SHA2384 = "SHA2384" SHA2512 = "SHA2512" -class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The sku name. - """ + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The sku name.""" NOT_SPECIFIED = "NotSpecified" FREE = "Free" @@ -328,17 +331,17 @@ class SkuName(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): STANDARD = "Standard" PREMIUM = "Premium" -class StatusAnnotation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The status annotation. - """ + +class StatusAnnotation(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status annotation.""" NOT_SPECIFIED = "NotSpecified" PREVIEW = "Preview" PRODUCTION = "Production" -class SwaggerSchemaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The swagger schema type. - """ + +class SwaggerSchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The swagger schema type.""" STRING = "String" NUMBER = "Number" @@ -349,16 +352,16 @@ class SwaggerSchemaType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): OBJECT = "Object" NULL = "Null" -class TrackEventsOperationOptions(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The track events operation options. - """ + +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)): - """The tracking record type. - """ + +class TrackingRecordType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The tracking record type.""" NOT_SPECIFIED = "NotSpecified" CUSTOM = "Custom" @@ -377,27 +380,27 @@ class TrackingRecordType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): EDIFACT_FUNCTIONAL_GROUP_ACKNOWLEDGMENT = "EdifactFunctionalGroupAcknowledgment" EDIFACT_TRANSACTION_SET_ACKNOWLEDGMENT = "EdifactTransactionSetAcknowledgment" -class TrailingSeparatorPolicy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The trailing separator policy. - """ + +class TrailingSeparatorPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The trailing separator policy.""" NOT_SPECIFIED = "NotSpecified" NOT_ALLOWED = "NotAllowed" OPTIONAL = "Optional" MANDATORY = "Mandatory" -class UsageIndicator(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The usage indicator. - """ + +class UsageIndicator(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The usage indicator.""" NOT_SPECIFIED = "NotSpecified" TEST = "Test" INFORMATION = "Information" PRODUCTION = "Production" -class WorkflowProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The workflow provisioning state. - """ + +class WorkflowProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The workflow provisioning state.""" NOT_SPECIFIED = "NotSpecified" ACCEPTED = "Accepted" @@ -422,9 +425,9 @@ class WorkflowProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enu WAITING = "Waiting" IN_PROGRESS = "InProgress" -class WorkflowState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The workflow state. - """ + +class WorkflowState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The workflow state.""" NOT_SPECIFIED = "NotSpecified" COMPLETED = "Completed" @@ -433,9 +436,9 @@ class WorkflowState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): DELETED = "Deleted" SUSPENDED = "Suspended" -class WorkflowStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The workflow status. - """ + +class WorkflowStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The workflow status.""" NOT_SPECIFIED = "NotSpecified" PAUSED = "Paused" @@ -451,9 +454,9 @@ class WorkflowStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): ABORTED = "Aborted" IGNORED = "Ignored" -class WorkflowTriggerProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The workflow trigger provisioning state. - """ + +class WorkflowTriggerProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The workflow trigger provisioning state.""" NOT_SPECIFIED = "NotSpecified" ACCEPTED = "Accepted" @@ -474,34 +477,34 @@ class WorkflowTriggerProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, s UNREGISTERED = "Unregistered" COMPLETED = "Completed" -class WsdlImportMethod(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The WSDL import method. - """ + +class WsdlImportMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The WSDL import method.""" NOT_SPECIFIED = "NotSpecified" SOAP_TO_REST = "SoapToRest" SOAP_PASS_THROUGH = "SoapPassThrough" -class X12CharacterSet(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The X12 character set. - """ + +class X12CharacterSet(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The X12 character set.""" NOT_SPECIFIED = "NotSpecified" BASIC = "Basic" EXTENDED = "Extended" UTF8 = "UTF8" -class X12DateFormat(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The x12 date format. - """ + +class X12DateFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The x12 date format.""" NOT_SPECIFIED = "NotSpecified" CCYYMMDD = "CCYYMMDD" YYMMDD = "YYMMDD" -class X12TimeFormat(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The x12 time format. - """ + +class X12TimeFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The x12 time format.""" NOT_SPECIFIED = "NotSpecified" HHMM = "HHMM" 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..f420588f1186 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 @@ -1,4 +1,5 @@ # coding=utf-8 +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -7,15 +8,22 @@ # -------------------------------------------------------------------------- import datetime -from typing import Any, Dict, List, Optional, Union +import sys +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union -from azure.core.exceptions import HttpResponseError -import msrest.serialization +from .. import _serialization -from ._logic_management_client_enums import * +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -class AgreementContent(msrest.serialization.Model): +class AgreementContent(_serialization.Model): """The integration account agreement content. :ivar a_s2: The AS2 agreement content. @@ -27,17 +35,17 @@ class AgreementContent(msrest.serialization.Model): """ _attribute_map = { - 'a_s2': {'key': 'aS2', 'type': 'AS2AgreementContent'}, - 'x12': {'key': 'x12', 'type': 'X12AgreementContent'}, - 'edifact': {'key': 'edifact', 'type': 'EdifactAgreementContent'}, + "a_s2": {"key": "aS2", "type": "AS2AgreementContent"}, + "x12": {"key": "x12", "type": "X12AgreementContent"}, + "edifact": {"key": "edifact", "type": "EdifactAgreementContent"}, } 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 ): """ @@ -48,13 +56,13 @@ def __init__( :keyword edifact: The EDIFACT agreement content. :paramtype edifact: ~azure.mgmt.logic.models.EdifactAgreementContent """ - super(AgreementContent, self).__init__(**kwargs) + super().__init__(**kwargs) self.a_s2 = a_s2 self.x12 = x12 self.edifact = edifact -class ApiDeploymentParameterMetadata(msrest.serialization.Model): +class ApiDeploymentParameterMetadata(_serialization.Model): """The API deployment parameter metadata. :ivar type: The type. @@ -65,17 +73,16 @@ 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", and "Internal". :vartype visibility: str or ~azure.mgmt.logic.models.ApiDeploymentParameterVisibility """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'is_required': {'key': 'isRequired', 'type': 'bool'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'visibility': {'key': 'visibility', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "visibility": {"key": "visibility", "type": "str"}, } def __init__( @@ -85,7 +92,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,11 +104,11 @@ def __init__( :paramtype display_name: str :keyword description: The description. :paramtype description: str - :keyword visibility: The visibility. Possible values include: "NotSpecified", "Default", + :keyword visibility: The visibility. Known values are: "NotSpecified", "Default", and "Internal". :paramtype visibility: str or ~azure.mgmt.logic.models.ApiDeploymentParameterVisibility """ - super(ApiDeploymentParameterMetadata, self).__init__(**kwargs) + super().__init__(**kwargs) self.type = type self.is_required = is_required self.display_name = display_name @@ -109,7 +116,7 @@ def __init__( self.visibility = visibility -class ApiDeploymentParameterMetadataSet(msrest.serialization.Model): +class ApiDeploymentParameterMetadataSet(_serialization.Model): """The API deployment parameters metadata. :ivar package_content_link: The package content link parameter. @@ -119,15 +126,18 @@ class ApiDeploymentParameterMetadataSet(msrest.serialization.Model): """ _attribute_map = { - 'package_content_link': {'key': 'packageContentLink', 'type': 'ApiDeploymentParameterMetadata'}, - 'redis_cache_connection_string': {'key': 'redisCacheConnectionString', 'type': 'ApiDeploymentParameterMetadata'}, + "package_content_link": {"key": "packageContentLink", "type": "ApiDeploymentParameterMetadata"}, + "redis_cache_connection_string": { + "key": "redisCacheConnectionString", + "type": "ApiDeploymentParameterMetadata", + }, } 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 ): """ @@ -137,12 +147,12 @@ def __init__( :paramtype redis_cache_connection_string: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadata """ - super(ApiDeploymentParameterMetadataSet, self).__init__(**kwargs) + super().__init__(**kwargs) self.package_content_link = package_content_link self.redis_cache_connection_string = redis_cache_connection_string -class Resource(msrest.serialization.Model): +class Resource(_serialization.Model): """The base resource type. Variables are only populated by the server, and will be ignored when sending a request. @@ -155,38 +165,32 @@ class Resource(msrest.serialization.Model): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] """ - super(Resource, self).__init__(**kwargs) + super().__init__(**kwargs) self.id = None self.name = None self.type = None @@ -207,25 +211,25 @@ class ApiOperation(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar properties: The api operations properties. :vartype properties: ~azure.mgmt.logic.models.ApiOperationPropertiesDefinition """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'ApiOperationPropertiesDefinition'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "ApiOperationPropertiesDefinition"}, } def __init__( @@ -233,25 +237,25 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - properties: Optional["ApiOperationPropertiesDefinition"] = None, + properties: Optional["_models.ApiOperationPropertiesDefinition"] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword properties: The api operations properties. :paramtype properties: ~azure.mgmt.logic.models.ApiOperationPropertiesDefinition """ - super(ApiOperation, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.properties = properties -class ApiOperationAnnotation(msrest.serialization.Model): +class ApiOperationAnnotation(_serialization.Model): """The Api Operation Annotation. - :ivar status: The status annotation. Possible values include: "NotSpecified", "Preview", + :ivar status: The status annotation. Known values are: "NotSpecified", "Preview", and "Production". :vartype status: str or ~azure.mgmt.logic.models.StatusAnnotation :ivar family: The family. @@ -261,21 +265,21 @@ class ApiOperationAnnotation(msrest.serialization.Model): """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'family': {'key': 'family', 'type': 'str'}, - 'revision': {'key': 'revision', 'type': 'int'}, + "status": {"key": "status", "type": "str"}, + "family": {"key": "family", "type": "str"}, + "revision": {"key": "revision", "type": "int"}, } 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", and "Production". :paramtype status: str or ~azure.mgmt.logic.models.StatusAnnotation :keyword family: The family. @@ -283,13 +287,13 @@ def __init__( :keyword revision: The revision. :paramtype revision: int """ - super(ApiOperationAnnotation, self).__init__(**kwargs) + super().__init__(**kwargs) self.status = status self.family = family self.revision = revision -class ApiOperationListResult(msrest.serialization.Model): +class ApiOperationListResult(_serialization.Model): """The list of managed API operations. :ivar value: The api operation definitions for an API. @@ -299,16 +303,12 @@ class ApiOperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ApiOperation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ApiOperation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["ApiOperation"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.ApiOperation"]] = None, next_link: Optional[str] = None, **kwargs ): """ :keyword value: The api operation definitions for an API. @@ -316,12 +316,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(ApiOperationListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class ApiOperationPropertiesDefinition(msrest.serialization.Model): +class ApiOperationPropertiesDefinition(_serialization.Model): # pylint: disable=too-many-instance-attributes """The api operations properties. :ivar summary: The summary of the api operation. @@ -351,18 +351,18 @@ class ApiOperationPropertiesDefinition(msrest.serialization.Model): """ _attribute_map = { - 'summary': {'key': 'summary', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'visibility': {'key': 'visibility', 'type': 'str'}, - 'trigger': {'key': 'trigger', 'type': 'str'}, - 'trigger_hint': {'key': 'triggerHint', 'type': 'str'}, - 'pageable': {'key': 'pageable', 'type': 'bool'}, - 'annotation': {'key': 'annotation', 'type': 'ApiOperationAnnotation'}, - 'api': {'key': 'api', 'type': 'ApiReference'}, - 'inputs_definition': {'key': 'inputsDefinition', 'type': 'SwaggerSchema'}, - 'responses_definition': {'key': 'responsesDefinition', 'type': '{SwaggerSchema}'}, - 'is_webhook': {'key': 'isWebhook', 'type': 'bool'}, - 'is_notification': {'key': 'isNotification', 'type': 'bool'}, + "summary": {"key": "summary", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "visibility": {"key": "visibility", "type": "str"}, + "trigger": {"key": "trigger", "type": "str"}, + "trigger_hint": {"key": "triggerHint", "type": "str"}, + "pageable": {"key": "pageable", "type": "bool"}, + "annotation": {"key": "annotation", "type": "ApiOperationAnnotation"}, + "api": {"key": "api", "type": "ApiReference"}, + "inputs_definition": {"key": "inputsDefinition", "type": "SwaggerSchema"}, + "responses_definition": {"key": "responsesDefinition", "type": "{SwaggerSchema}"}, + "is_webhook": {"key": "isWebhook", "type": "bool"}, + "is_notification": {"key": "isNotification", "type": "bool"}, } def __init__( @@ -374,10 +374,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 @@ -408,7 +408,7 @@ def __init__( :keyword is_notification: Indicates whether the API operation is notification or not. :paramtype is_notification: bool """ - super(ApiOperationPropertiesDefinition, self).__init__(**kwargs) + super().__init__(**kwargs) self.summary = summary self.description = description self.visibility = visibility @@ -423,7 +423,7 @@ def __init__( self.is_notification = is_notification -class ResourceReference(msrest.serialization.Model): +class ResourceReference(_serialization.Model): """The resource reference. Variables are only populated by the server, and will be ignored when sending a request. @@ -437,27 +437,22 @@ class ResourceReference(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin """ :keyword id: The resource id. :paramtype id: str """ - super(ResourceReference, self).__init__(**kwargs) + super().__init__(**kwargs) self.id = id self.name = None self.type = None @@ -481,10 +476,10 @@ class ApiReference(ResourceReference): :ivar icon_uri: The icon uri of the api. :vartype icon_uri: str :ivar swagger: The swagger of the api. - :vartype swagger: any + :vartype swagger: JSON :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", and "Premium". :vartype category: str or ~azure.mgmt.logic.models.ApiTier :ivar integration_service_environment: The integration service environment reference. @@ -492,34 +487,34 @@ class ApiReference(ResourceReference): """ _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'icon_uri': {'key': 'iconUri', 'type': 'str'}, - 'swagger': {'key': 'swagger', 'type': 'object'}, - 'brand_color': {'key': 'brandColor', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'integration_service_environment': {'key': 'integrationServiceEnvironment', 'type': 'ResourceReference'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "icon_uri": {"key": "iconUri", "type": "str"}, + "swagger": {"key": "swagger", "type": "object"}, + "brand_color": {"key": "brandColor", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "integration_service_environment": {"key": "integrationServiceEnvironment", "type": "ResourceReference"}, } def __init__( self, *, - id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin display_name: Optional[str] = None, description: Optional[str] = None, icon_uri: Optional[str] = None, - swagger: Optional[Any] = None, + swagger: Optional[JSON] = 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 ): """ @@ -532,16 +527,16 @@ def __init__( :keyword icon_uri: The icon uri of the api. :paramtype icon_uri: str :keyword swagger: The swagger of the api. - :paramtype swagger: any + :paramtype swagger: JSON :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", and "Premium". :paramtype category: str or ~azure.mgmt.logic.models.ApiTier :keyword integration_service_environment: The integration service environment reference. :paramtype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference """ - super(ApiReference, self).__init__(id=id, **kwargs) + super().__init__(id=id, **kwargs) self.display_name = display_name self.description = description self.icon_uri = icon_uri @@ -551,7 +546,7 @@ def __init__( self.integration_service_environment = integration_service_environment -class ApiResourceBackendService(msrest.serialization.Model): +class ApiResourceBackendService(_serialization.Model): """The API backend service. :ivar service_url: The service URL. @@ -559,24 +554,19 @@ class ApiResourceBackendService(msrest.serialization.Model): """ _attribute_map = { - 'service_url': {'key': 'serviceUrl', 'type': 'str'}, + "service_url": {"key": "serviceUrl", "type": "str"}, } - def __init__( - self, - *, - service_url: Optional[str] = None, - **kwargs - ): + def __init__(self, *, service_url: Optional[str] = None, **kwargs): """ :keyword service_url: The service URL. :paramtype service_url: str """ - super(ApiResourceBackendService, self).__init__(**kwargs) + super().__init__(**kwargs) self.service_url = service_url -class ApiResourceDefinitions(msrest.serialization.Model): +class ApiResourceDefinitions(_serialization.Model): """The Api resource definition. :ivar original_swagger_url: The original swagger url. @@ -586,16 +576,12 @@ class ApiResourceDefinitions(msrest.serialization.Model): """ _attribute_map = { - 'original_swagger_url': {'key': 'originalSwaggerUrl', 'type': 'str'}, - 'modified_swagger_url': {'key': 'modifiedSwaggerUrl', 'type': 'str'}, + "original_swagger_url": {"key": "originalSwaggerUrl", "type": "str"}, + "modified_swagger_url": {"key": "modifiedSwaggerUrl", "type": "str"}, } def __init__( - self, - *, - original_swagger_url: Optional[str] = None, - modified_swagger_url: Optional[str] = None, - **kwargs + self, *, original_swagger_url: Optional[str] = None, modified_swagger_url: Optional[str] = None, **kwargs ): """ :keyword original_swagger_url: The original swagger url. @@ -603,12 +589,12 @@ def __init__( :keyword modified_swagger_url: The modified swagger url. :paramtype modified_swagger_url: str """ - super(ApiResourceDefinitions, self).__init__(**kwargs) + super().__init__(**kwargs) self.original_swagger_url = original_swagger_url self.modified_swagger_url = modified_swagger_url -class ApiResourceGeneralInformation(msrest.serialization.Model): +class ApiResourceGeneralInformation(_serialization.Model): """The API general information. :ivar icon_url: The icon url. @@ -621,18 +607,18 @@ 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", + :ivar tier: The tier. Known values are: "NotSpecified", "Enterprise", "Standard", and "Premium". :vartype tier: str or ~azure.mgmt.logic.models.ApiTier """ _attribute_map = { - 'icon_url': {'key': 'iconUrl', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'terms_of_use_url': {'key': 'termsOfUseUrl', 'type': 'str'}, - 'release_tag': {'key': 'releaseTag', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "icon_url": {"key": "iconUrl", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "terms_of_use_url": {"key": "termsOfUseUrl", "type": "str"}, + "release_tag": {"key": "releaseTag", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } def __init__( @@ -643,7 +629,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,11 +643,11 @@ 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", + :keyword tier: The tier. Known values are: "NotSpecified", "Enterprise", "Standard", and "Premium". :paramtype tier: str or ~azure.mgmt.logic.models.ApiTier """ - super(ApiResourceGeneralInformation, self).__init__(**kwargs) + super().__init__(**kwargs) self.icon_url = icon_url self.display_name = display_name self.description = description @@ -670,7 +656,7 @@ def __init__( self.tier = tier -class ApiResourceMetadata(msrest.serialization.Model): +class ApiResourceMetadata(_serialization.Model): """The api resource metadata. :ivar source: The source. @@ -679,37 +665,37 @@ class ApiResourceMetadata(msrest.serialization.Model): :vartype brand_color: str :ivar hide_key: The hide key. :vartype hide_key: str - :ivar tags: A set of tags. The tags. + :ivar 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", and "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", - "SoapToRest", "SoapPassThrough". + :ivar wsdl_import_method: The WSDL import method. Known values are: "NotSpecified", + "SoapToRest", and "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", - "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :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", and "InProgress". :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState :ivar deployment_parameters: The connector deployment parameters metadata. :vartype deployment_parameters: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadataSet """ _attribute_map = { - 'source': {'key': 'source', 'type': 'str'}, - 'brand_color': {'key': 'brandColor', 'type': 'str'}, - 'hide_key': {'key': 'hideKey', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'api_type': {'key': 'ApiType', 'type': 'str'}, - 'wsdl_service': {'key': 'wsdlService', 'type': 'WsdlService'}, - 'wsdl_import_method': {'key': 'wsdlImportMethod', 'type': 'str'}, - 'connection_type': {'key': 'connectionType', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'deployment_parameters': {'key': 'deploymentParameters', 'type': 'ApiDeploymentParameterMetadataSet'}, + "source": {"key": "source", "type": "str"}, + "brand_color": {"key": "brandColor", "type": "str"}, + "hide_key": {"key": "hideKey", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "api_type": {"key": "ApiType", "type": "str"}, + "wsdl_service": {"key": "wsdlService", "type": "WsdlService"}, + "wsdl_import_method": {"key": "wsdlImportMethod", "type": "str"}, + "connection_type": {"key": "connectionType", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "deployment_parameters": {"key": "deploymentParameters", "type": "ApiDeploymentParameterMetadataSet"}, } def __init__( @@ -719,12 +705,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 ): """ @@ -734,26 +720,26 @@ def __init__( :paramtype brand_color: str :keyword hide_key: The hide key. :paramtype hide_key: str - :keyword tags: A set of tags. The tags. + :keyword 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", and "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", - "SoapToRest", "SoapPassThrough". + :keyword wsdl_import_method: The WSDL import method. Known values are: "NotSpecified", + "SoapToRest", and "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". + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", and "InProgress". :paramtype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowProvisioningState :keyword deployment_parameters: The connector deployment parameters metadata. :paramtype deployment_parameters: ~azure.mgmt.logic.models.ApiDeploymentParameterMetadataSet """ - super(ApiResourceMetadata, self).__init__(**kwargs) + super().__init__(**kwargs) self.source = source self.brand_color = brand_color self.hide_key = hide_key @@ -766,7 +752,7 @@ def __init__( self.deployment_parameters = deployment_parameters -class ApiResourcePolicies(msrest.serialization.Model): +class ApiResourcePolicies(_serialization.Model): """The API resource policies. :ivar content: The API level only policies XML as embedded content. @@ -776,29 +762,23 @@ class ApiResourcePolicies(msrest.serialization.Model): """ _attribute_map = { - 'content': {'key': 'content', 'type': 'str'}, - 'content_link': {'key': 'contentLink', 'type': 'str'}, + "content": {"key": "content", "type": "str"}, + "content_link": {"key": "contentLink", "type": "str"}, } - def __init__( - self, - *, - content: Optional[str] = None, - content_link: Optional[str] = None, - **kwargs - ): + def __init__(self, *, content: Optional[str] = None, content_link: Optional[str] = None, **kwargs): """ :keyword content: The API level only policies XML as embedded content. :paramtype content: str :keyword content_link: The content link to the policies. :paramtype content_link: str """ - super(ApiResourcePolicies, self).__init__(**kwargs) + super().__init__(**kwargs) self.content = content self.content_link = content_link -class ApiResourceProperties(msrest.serialization.Model): +class ApiResourceProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes """The API resource properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -806,7 +786,7 @@ class ApiResourceProperties(msrest.serialization.Model): :ivar name: The name. :vartype name: str :ivar connection_parameters: The connection parameters. - :vartype connection_parameters: dict[str, any] + :vartype connection_parameters: dict[str, JSON] :ivar metadata: The metadata. :vartype metadata: ~azure.mgmt.logic.models.ApiResourceMetadata :ivar runtime_urls: The runtime urls. @@ -825,58 +805,53 @@ 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", - "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :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", and "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", and + "Premium". :vartype category: str or ~azure.mgmt.logic.models.ApiTier """ _validation = { - 'name': {'readonly': True}, - 'connection_parameters': {'readonly': True}, - 'metadata': {'readonly': True}, - 'runtime_urls': {'readonly': True}, - 'general_information': {'readonly': True}, - 'capabilities': {'readonly': True}, - 'backend_service': {'readonly': True}, - 'policies': {'readonly': True}, - 'api_definition_url': {'readonly': True}, - 'api_definitions': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'category': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'connection_parameters': {'key': 'connectionParameters', 'type': '{object}'}, - 'metadata': {'key': 'metadata', 'type': 'ApiResourceMetadata'}, - 'runtime_urls': {'key': 'runtimeUrls', 'type': '[str]'}, - 'general_information': {'key': 'generalInformation', 'type': 'ApiResourceGeneralInformation'}, - 'capabilities': {'key': 'capabilities', 'type': '[str]'}, - 'backend_service': {'key': 'backendService', 'type': 'ApiResourceBackendService'}, - 'policies': {'key': 'policies', 'type': 'ApiResourcePolicies'}, - 'api_definition_url': {'key': 'apiDefinitionUrl', 'type': 'str'}, - 'api_definitions': {'key': 'apiDefinitions', 'type': 'ApiResourceDefinitions'}, - 'integration_service_environment': {'key': 'integrationServiceEnvironment', 'type': 'ResourceReference'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - } - - def __init__( - self, - *, - integration_service_environment: Optional["ResourceReference"] = None, - **kwargs - ): + "name": {"readonly": True}, + "connection_parameters": {"readonly": True}, + "metadata": {"readonly": True}, + "runtime_urls": {"readonly": True}, + "general_information": {"readonly": True}, + "capabilities": {"readonly": True}, + "backend_service": {"readonly": True}, + "policies": {"readonly": True}, + "api_definition_url": {"readonly": True}, + "api_definitions": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "category": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "connection_parameters": {"key": "connectionParameters", "type": "{object}"}, + "metadata": {"key": "metadata", "type": "ApiResourceMetadata"}, + "runtime_urls": {"key": "runtimeUrls", "type": "[str]"}, + "general_information": {"key": "generalInformation", "type": "ApiResourceGeneralInformation"}, + "capabilities": {"key": "capabilities", "type": "[str]"}, + "backend_service": {"key": "backendService", "type": "ApiResourceBackendService"}, + "policies": {"key": "policies", "type": "ApiResourcePolicies"}, + "api_definition_url": {"key": "apiDefinitionUrl", "type": "str"}, + "api_definitions": {"key": "apiDefinitions", "type": "ApiResourceDefinitions"}, + "integration_service_environment": {"key": "integrationServiceEnvironment", "type": "ResourceReference"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "category": {"key": "category", "type": "str"}, + } + + def __init__(self, *, integration_service_environment: Optional["_models.ResourceReference"] = None, **kwargs): """ :keyword integration_service_environment: The integration service environment reference. :paramtype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference """ - super(ApiResourceProperties, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = None self.connection_parameters = None self.metadata = None @@ -892,7 +867,7 @@ def __init__( self.category = None -class ArtifactProperties(msrest.serialization.Model): +class ArtifactProperties(_serialization.Model): """The artifact properties definition. :ivar created_time: The artifact creation time. @@ -904,9 +879,9 @@ class ArtifactProperties(msrest.serialization.Model): """ _attribute_map = { - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "changed_time": {"key": "changedTime", "type": "iso-8601"}, + "metadata": {"key": "metadata", "type": "object"}, } def __init__( @@ -925,7 +900,7 @@ def __init__( :keyword metadata: Anything. :paramtype metadata: any """ - super(ArtifactProperties, self).__init__(**kwargs) + super().__init__(**kwargs) self.created_time = created_time self.changed_time = changed_time self.metadata = metadata @@ -949,12 +924,12 @@ class ArtifactContentPropertiesDefinition(ArtifactProperties): """ _attribute_map = { - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'content': {'key': 'content', 'type': 'object'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'content_link': {'key': 'contentLink', 'type': 'ContentLink'}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "changed_time": {"key": "changedTime", "type": "iso-8601"}, + "metadata": {"key": "metadata", "type": "object"}, + "content": {"key": "content", "type": "object"}, + "content_type": {"key": "contentType", "type": "str"}, + "content_link": {"key": "contentLink", "type": "ContentLink"}, } def __init__( @@ -965,7 +940,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 ): """ @@ -982,41 +957,41 @@ def __init__( :keyword content_link: The content link. :paramtype content_link: ~azure.mgmt.logic.models.ContentLink """ - super(ArtifactContentPropertiesDefinition, self).__init__(created_time=created_time, changed_time=changed_time, metadata=metadata, **kwargs) + super().__init__(created_time=created_time, changed_time=changed_time, metadata=metadata, **kwargs) self.content = content self.content_type = content_type self.content_link = content_link -class AS2AcknowledgementConnectionSettings(msrest.serialization.Model): +class AS2AcknowledgementConnectionSettings(_serialization.Model): """The AS2 agreement acknowledgement connection settings. All required parameters must be populated in order to send to Azure. - :ivar ignore_certificate_name_mismatch: Required. Indicates whether to ignore mismatch in - certificate name. + :ivar ignore_certificate_name_mismatch: Indicates whether to ignore mismatch in certificate + name. Required. :vartype ignore_certificate_name_mismatch: bool - :ivar support_http_status_code_continue: Required. Indicates whether to support HTTP status - code 'CONTINUE'. + :ivar support_http_status_code_continue: Indicates whether to support HTTP status code + 'CONTINUE'. Required. :vartype support_http_status_code_continue: bool - :ivar keep_http_connection_alive: Required. Indicates whether to keep the connection alive. + :ivar keep_http_connection_alive: Indicates whether to keep the connection alive. Required. :vartype keep_http_connection_alive: bool - :ivar unfold_http_headers: Required. Indicates whether to unfold the HTTP headers. + :ivar unfold_http_headers: Indicates whether to unfold the HTTP headers. Required. :vartype unfold_http_headers: bool """ _validation = { - 'ignore_certificate_name_mismatch': {'required': True}, - 'support_http_status_code_continue': {'required': True}, - 'keep_http_connection_alive': {'required': True}, - 'unfold_http_headers': {'required': True}, + "ignore_certificate_name_mismatch": {"required": True}, + "support_http_status_code_continue": {"required": True}, + "keep_http_connection_alive": {"required": True}, + "unfold_http_headers": {"required": True}, } _attribute_map = { - 'ignore_certificate_name_mismatch': {'key': 'ignoreCertificateNameMismatch', 'type': 'bool'}, - 'support_http_status_code_continue': {'key': 'supportHttpStatusCodeContinue', 'type': 'bool'}, - 'keep_http_connection_alive': {'key': 'keepHttpConnectionAlive', 'type': 'bool'}, - 'unfold_http_headers': {'key': 'unfoldHttpHeaders', 'type': 'bool'}, + "ignore_certificate_name_mismatch": {"key": "ignoreCertificateNameMismatch", "type": "bool"}, + "support_http_status_code_continue": {"key": "supportHttpStatusCodeContinue", "type": "bool"}, + "keep_http_connection_alive": {"key": "keepHttpConnectionAlive", "type": "bool"}, + "unfold_http_headers": {"key": "unfoldHttpHeaders", "type": "bool"}, } def __init__( @@ -1029,97 +1004,96 @@ def __init__( **kwargs ): """ - :keyword ignore_certificate_name_mismatch: Required. Indicates whether to ignore mismatch in - certificate name. + :keyword ignore_certificate_name_mismatch: Indicates whether to ignore mismatch in certificate + name. Required. :paramtype ignore_certificate_name_mismatch: bool - :keyword support_http_status_code_continue: Required. Indicates whether to support HTTP status - code 'CONTINUE'. + :keyword support_http_status_code_continue: Indicates whether to support HTTP status code + 'CONTINUE'. Required. :paramtype support_http_status_code_continue: bool - :keyword keep_http_connection_alive: Required. Indicates whether to keep the connection alive. + :keyword keep_http_connection_alive: Indicates whether to keep the connection alive. Required. :paramtype keep_http_connection_alive: bool - :keyword unfold_http_headers: Required. Indicates whether to unfold the HTTP headers. + :keyword unfold_http_headers: Indicates whether to unfold the HTTP headers. Required. :paramtype unfold_http_headers: bool """ - super(AS2AcknowledgementConnectionSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.ignore_certificate_name_mismatch = ignore_certificate_name_mismatch self.support_http_status_code_continue = support_http_status_code_continue self.keep_http_connection_alive = keep_http_connection_alive self.unfold_http_headers = unfold_http_headers -class AS2AgreementContent(msrest.serialization.Model): +class AS2AgreementContent(_serialization.Model): """The integration account AS2 agreement content. All required parameters must be populated in order to send to Azure. - :ivar receive_agreement: Required. The AS2 one-way receive agreement. + :ivar receive_agreement: The AS2 one-way receive agreement. Required. :vartype receive_agreement: ~azure.mgmt.logic.models.AS2OneWayAgreement - :ivar send_agreement: Required. The AS2 one-way send agreement. + :ivar send_agreement: The AS2 one-way send agreement. Required. :vartype send_agreement: ~azure.mgmt.logic.models.AS2OneWayAgreement """ _validation = { - 'receive_agreement': {'required': True}, - 'send_agreement': {'required': True}, + "receive_agreement": {"required": True}, + "send_agreement": {"required": True}, } _attribute_map = { - 'receive_agreement': {'key': 'receiveAgreement', 'type': 'AS2OneWayAgreement'}, - 'send_agreement': {'key': 'sendAgreement', 'type': 'AS2OneWayAgreement'}, + "receive_agreement": {"key": "receiveAgreement", "type": "AS2OneWayAgreement"}, + "send_agreement": {"key": "sendAgreement", "type": "AS2OneWayAgreement"}, } def __init__( - self, - *, - receive_agreement: "AS2OneWayAgreement", - send_agreement: "AS2OneWayAgreement", - **kwargs + self, *, receive_agreement: "_models.AS2OneWayAgreement", send_agreement: "_models.AS2OneWayAgreement", **kwargs ): """ - :keyword receive_agreement: Required. The AS2 one-way receive agreement. + :keyword receive_agreement: The AS2 one-way receive agreement. Required. :paramtype receive_agreement: ~azure.mgmt.logic.models.AS2OneWayAgreement - :keyword send_agreement: Required. The AS2 one-way send agreement. + :keyword send_agreement: The AS2 one-way send agreement. Required. :paramtype send_agreement: ~azure.mgmt.logic.models.AS2OneWayAgreement """ - super(AS2AgreementContent, self).__init__(**kwargs) + super().__init__(**kwargs) self.receive_agreement = receive_agreement self.send_agreement = send_agreement -class AS2EnvelopeSettings(msrest.serialization.Model): +class AS2EnvelopeSettings(_serialization.Model): """The AS2 agreement envelope settings. All required parameters must be populated in order to send to Azure. - :ivar message_content_type: Required. The message content type. + :ivar message_content_type: The message content type. Required. :vartype message_content_type: str - :ivar transmit_file_name_in_mime_header: Required. The value indicating whether to transmit - file name in mime header. + :ivar transmit_file_name_in_mime_header: The value indicating whether to transmit file name in + mime header. Required. :vartype transmit_file_name_in_mime_header: bool - :ivar file_name_template: Required. The template for file name. + :ivar file_name_template: The template for file name. Required. :vartype file_name_template: str - :ivar suspend_message_on_file_name_generation_error: Required. The value indicating whether to - suspend message on file name generation error. + :ivar suspend_message_on_file_name_generation_error: The value indicating whether to suspend + message on file name generation error. Required. :vartype suspend_message_on_file_name_generation_error: bool - :ivar autogenerate_file_name: Required. The value indicating whether to auto generate file - name. + :ivar autogenerate_file_name: The value indicating whether to auto generate file name. + Required. :vartype autogenerate_file_name: bool """ _validation = { - 'message_content_type': {'required': True}, - 'transmit_file_name_in_mime_header': {'required': True}, - 'file_name_template': {'required': True}, - 'suspend_message_on_file_name_generation_error': {'required': True}, - 'autogenerate_file_name': {'required': True}, + "message_content_type": {"required": True}, + "transmit_file_name_in_mime_header": {"required": True}, + "file_name_template": {"required": True}, + "suspend_message_on_file_name_generation_error": {"required": True}, + "autogenerate_file_name": {"required": True}, } _attribute_map = { - 'message_content_type': {'key': 'messageContentType', 'type': 'str'}, - 'transmit_file_name_in_mime_header': {'key': 'transmitFileNameInMimeHeader', 'type': 'bool'}, - 'file_name_template': {'key': 'fileNameTemplate', 'type': 'str'}, - 'suspend_message_on_file_name_generation_error': {'key': 'suspendMessageOnFileNameGenerationError', 'type': 'bool'}, - 'autogenerate_file_name': {'key': 'autogenerateFileName', 'type': 'bool'}, + "message_content_type": {"key": "messageContentType", "type": "str"}, + "transmit_file_name_in_mime_header": {"key": "transmitFileNameInMimeHeader", "type": "bool"}, + "file_name_template": {"key": "fileNameTemplate", "type": "str"}, + "suspend_message_on_file_name_generation_error": { + "key": "suspendMessageOnFileNameGenerationError", + "type": "bool", + }, + "autogenerate_file_name": {"key": "autogenerateFileName", "type": "bool"}, } def __init__( @@ -1133,21 +1107,21 @@ def __init__( **kwargs ): """ - :keyword message_content_type: Required. The message content type. + :keyword message_content_type: The message content type. Required. :paramtype message_content_type: str - :keyword transmit_file_name_in_mime_header: Required. The value indicating whether to transmit - file name in mime header. + :keyword transmit_file_name_in_mime_header: The value indicating whether to transmit file name + in mime header. Required. :paramtype transmit_file_name_in_mime_header: bool - :keyword file_name_template: Required. The template for file name. + :keyword file_name_template: The template for file name. Required. :paramtype file_name_template: str - :keyword suspend_message_on_file_name_generation_error: Required. The value indicating whether - to suspend message on file name generation error. + :keyword suspend_message_on_file_name_generation_error: The value indicating whether to suspend + message on file name generation error. Required. :paramtype suspend_message_on_file_name_generation_error: bool - :keyword autogenerate_file_name: Required. The value indicating whether to auto generate file - name. + :keyword autogenerate_file_name: The value indicating whether to auto generate file name. + Required. :paramtype autogenerate_file_name: bool """ - super(AS2EnvelopeSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_content_type = message_content_type self.transmit_file_name_in_mime_header = transmit_file_name_in_mime_header self.file_name_template = file_name_template @@ -1155,97 +1129,91 @@ def __init__( self.autogenerate_file_name = autogenerate_file_name -class AS2ErrorSettings(msrest.serialization.Model): +class AS2ErrorSettings(_serialization.Model): """The AS2 agreement error settings. All required parameters must be populated in order to send to Azure. - :ivar suspend_duplicate_message: Required. The value indicating whether to suspend duplicate - message. + :ivar suspend_duplicate_message: The value indicating whether to suspend duplicate message. + Required. :vartype suspend_duplicate_message: bool - :ivar resend_if_mdn_not_received: Required. The value indicating whether to resend message If - MDN is not received. + :ivar resend_if_mdn_not_received: The value indicating whether to resend message If MDN is not + received. Required. :vartype resend_if_mdn_not_received: bool """ _validation = { - 'suspend_duplicate_message': {'required': True}, - 'resend_if_mdn_not_received': {'required': True}, + "suspend_duplicate_message": {"required": True}, + "resend_if_mdn_not_received": {"required": True}, } _attribute_map = { - 'suspend_duplicate_message': {'key': 'suspendDuplicateMessage', 'type': 'bool'}, - 'resend_if_mdn_not_received': {'key': 'resendIfMDNNotReceived', 'type': 'bool'}, + "suspend_duplicate_message": {"key": "suspendDuplicateMessage", "type": "bool"}, + "resend_if_mdn_not_received": {"key": "resendIfMDNNotReceived", "type": "bool"}, } - def __init__( - self, - *, - suspend_duplicate_message: bool, - resend_if_mdn_not_received: bool, - **kwargs - ): + def __init__(self, *, suspend_duplicate_message: bool, resend_if_mdn_not_received: bool, **kwargs): """ - :keyword suspend_duplicate_message: Required. The value indicating whether to suspend duplicate - message. + :keyword suspend_duplicate_message: The value indicating whether to suspend duplicate message. + Required. :paramtype suspend_duplicate_message: bool - :keyword resend_if_mdn_not_received: Required. The value indicating whether to resend message - If MDN is not received. + :keyword resend_if_mdn_not_received: The value indicating whether to resend message If MDN is + not received. Required. :paramtype resend_if_mdn_not_received: bool """ - super(AS2ErrorSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.suspend_duplicate_message = suspend_duplicate_message self.resend_if_mdn_not_received = resend_if_mdn_not_received -class AS2MdnSettings(msrest.serialization.Model): +class AS2MdnSettings(_serialization.Model): """The AS2 agreement mdn settings. All required parameters must be populated in order to send to Azure. - :ivar need_mdn: Required. The value indicating whether to send or request a MDN. + :ivar need_mdn: The value indicating whether to send or request a MDN. Required. :vartype need_mdn: bool - :ivar sign_mdn: Required. The value indicating whether the MDN needs to be signed or not. + :ivar sign_mdn: The value indicating whether the MDN needs to be signed or not. Required. :vartype sign_mdn: bool - :ivar send_mdn_asynchronously: Required. The value indicating whether to send the asynchronous - MDN. + :ivar send_mdn_asynchronously: The value indicating whether to send the asynchronous MDN. + Required. :vartype send_mdn_asynchronously: bool :ivar receipt_delivery_url: The receipt delivery URL. :vartype receipt_delivery_url: str :ivar disposition_notification_to: The disposition notification to header value. :vartype disposition_notification_to: str - :ivar sign_outbound_mdn_if_optional: Required. The value indicating whether to sign the - outbound MDN if optional. + :ivar sign_outbound_mdn_if_optional: The value indicating whether to sign the outbound MDN if + optional. Required. :vartype sign_outbound_mdn_if_optional: bool :ivar mdn_text: The MDN text. :vartype mdn_text: str - :ivar send_inbound_mdn_to_message_box: Required. The value indicating whether to send inbound - MDN to message box. + :ivar send_inbound_mdn_to_message_box: The value indicating whether to send inbound MDN to + message box. Required. :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: The signing or hashing algorithm. Required. Known values are: + "NotSpecified", "None", "MD5", "SHA1", "SHA2256", "SHA2384", and "SHA2512". :vartype mic_hashing_algorithm: str or ~azure.mgmt.logic.models.HashingAlgorithm """ _validation = { - 'need_mdn': {'required': True}, - 'sign_mdn': {'required': True}, - 'send_mdn_asynchronously': {'required': True}, - 'sign_outbound_mdn_if_optional': {'required': True}, - 'send_inbound_mdn_to_message_box': {'required': True}, - 'mic_hashing_algorithm': {'required': True}, + "need_mdn": {"required": True}, + "sign_mdn": {"required": True}, + "send_mdn_asynchronously": {"required": True}, + "sign_outbound_mdn_if_optional": {"required": True}, + "send_inbound_mdn_to_message_box": {"required": True}, + "mic_hashing_algorithm": {"required": True}, } _attribute_map = { - 'need_mdn': {'key': 'needMDN', 'type': 'bool'}, - 'sign_mdn': {'key': 'signMDN', 'type': 'bool'}, - 'send_mdn_asynchronously': {'key': 'sendMDNAsynchronously', 'type': 'bool'}, - 'receipt_delivery_url': {'key': 'receiptDeliveryUrl', 'type': 'str'}, - 'disposition_notification_to': {'key': 'dispositionNotificationTo', 'type': 'str'}, - 'sign_outbound_mdn_if_optional': {'key': 'signOutboundMDNIfOptional', 'type': 'bool'}, - 'mdn_text': {'key': 'mdnText', 'type': 'str'}, - 'send_inbound_mdn_to_message_box': {'key': 'sendInboundMDNToMessageBox', 'type': 'bool'}, - 'mic_hashing_algorithm': {'key': 'micHashingAlgorithm', 'type': 'str'}, + "need_mdn": {"key": "needMDN", "type": "bool"}, + "sign_mdn": {"key": "signMDN", "type": "bool"}, + "send_mdn_asynchronously": {"key": "sendMDNAsynchronously", "type": "bool"}, + "receipt_delivery_url": {"key": "receiptDeliveryUrl", "type": "str"}, + "disposition_notification_to": {"key": "dispositionNotificationTo", "type": "str"}, + "sign_outbound_mdn_if_optional": {"key": "signOutboundMDNIfOptional", "type": "bool"}, + "mdn_text": {"key": "mdnText", "type": "str"}, + "send_inbound_mdn_to_message_box": {"key": "sendInboundMDNToMessageBox", "type": "bool"}, + "mic_hashing_algorithm": {"key": "micHashingAlgorithm", "type": "str"}, } def __init__( @@ -1256,37 +1224,37 @@ 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, **kwargs ): """ - :keyword need_mdn: Required. The value indicating whether to send or request a MDN. + :keyword need_mdn: The value indicating whether to send or request a MDN. Required. :paramtype need_mdn: bool - :keyword sign_mdn: Required. The value indicating whether the MDN needs to be signed or not. + :keyword sign_mdn: The value indicating whether the MDN needs to be signed or not. Required. :paramtype sign_mdn: bool - :keyword send_mdn_asynchronously: Required. The value indicating whether to send the - asynchronous MDN. + :keyword send_mdn_asynchronously: The value indicating whether to send the asynchronous MDN. + Required. :paramtype send_mdn_asynchronously: bool :keyword receipt_delivery_url: The receipt delivery URL. :paramtype receipt_delivery_url: str :keyword disposition_notification_to: The disposition notification to header value. :paramtype disposition_notification_to: str - :keyword sign_outbound_mdn_if_optional: Required. The value indicating whether to sign the - outbound MDN if optional. + :keyword sign_outbound_mdn_if_optional: The value indicating whether to sign the outbound MDN + if optional. Required. :paramtype sign_outbound_mdn_if_optional: bool :keyword mdn_text: The MDN text. :paramtype mdn_text: str - :keyword send_inbound_mdn_to_message_box: Required. The value indicating whether to send - inbound MDN to message box. + :keyword send_inbound_mdn_to_message_box: The value indicating whether to send inbound MDN to + message box. Required. :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: The signing or hashing algorithm. Required. Known values are: + "NotSpecified", "None", "MD5", "SHA1", "SHA2256", "SHA2384", and "SHA2512". :paramtype mic_hashing_algorithm: str or ~azure.mgmt.logic.models.HashingAlgorithm """ - super(AS2MdnSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.need_mdn = need_mdn self.sign_mdn = sign_mdn self.send_mdn_asynchronously = send_mdn_asynchronously @@ -1298,36 +1266,36 @@ def __init__( self.mic_hashing_algorithm = mic_hashing_algorithm -class AS2MessageConnectionSettings(msrest.serialization.Model): +class AS2MessageConnectionSettings(_serialization.Model): """The AS2 agreement message connection settings. All required parameters must be populated in order to send to Azure. - :ivar ignore_certificate_name_mismatch: Required. The value indicating whether to ignore - mismatch in certificate name. + :ivar ignore_certificate_name_mismatch: The value indicating whether to ignore mismatch in + certificate name. Required. :vartype ignore_certificate_name_mismatch: bool - :ivar support_http_status_code_continue: Required. The value indicating whether to support HTTP - status code 'CONTINUE'. + :ivar support_http_status_code_continue: The value indicating whether to support HTTP status + code 'CONTINUE'. Required. :vartype support_http_status_code_continue: bool - :ivar keep_http_connection_alive: Required. The value indicating whether to keep the connection - alive. + :ivar keep_http_connection_alive: The value indicating whether to keep the connection alive. + Required. :vartype keep_http_connection_alive: bool - :ivar unfold_http_headers: Required. The value indicating whether to unfold the HTTP headers. + :ivar unfold_http_headers: The value indicating whether to unfold the HTTP headers. Required. :vartype unfold_http_headers: bool """ _validation = { - 'ignore_certificate_name_mismatch': {'required': True}, - 'support_http_status_code_continue': {'required': True}, - 'keep_http_connection_alive': {'required': True}, - 'unfold_http_headers': {'required': True}, + "ignore_certificate_name_mismatch": {"required": True}, + "support_http_status_code_continue": {"required": True}, + "keep_http_connection_alive": {"required": True}, + "unfold_http_headers": {"required": True}, } _attribute_map = { - 'ignore_certificate_name_mismatch': {'key': 'ignoreCertificateNameMismatch', 'type': 'bool'}, - 'support_http_status_code_continue': {'key': 'supportHttpStatusCodeContinue', 'type': 'bool'}, - 'keep_http_connection_alive': {'key': 'keepHttpConnectionAlive', 'type': 'bool'}, - 'unfold_http_headers': {'key': 'unfoldHttpHeaders', 'type': 'bool'}, + "ignore_certificate_name_mismatch": {"key": "ignoreCertificateNameMismatch", "type": "bool"}, + "support_http_status_code_continue": {"key": "supportHttpStatusCodeContinue", "type": "bool"}, + "keep_http_connection_alive": {"key": "keepHttpConnectionAlive", "type": "bool"}, + "unfold_http_headers": {"key": "unfoldHttpHeaders", "type": "bool"}, } def __init__( @@ -1340,146 +1308,149 @@ def __init__( **kwargs ): """ - :keyword ignore_certificate_name_mismatch: Required. The value indicating whether to ignore - mismatch in certificate name. + :keyword ignore_certificate_name_mismatch: The value indicating whether to ignore mismatch in + certificate name. Required. :paramtype ignore_certificate_name_mismatch: bool - :keyword support_http_status_code_continue: Required. The value indicating whether to support - HTTP status code 'CONTINUE'. + :keyword support_http_status_code_continue: The value indicating whether to support HTTP status + code 'CONTINUE'. Required. :paramtype support_http_status_code_continue: bool - :keyword keep_http_connection_alive: Required. The value indicating whether to keep the - connection alive. + :keyword keep_http_connection_alive: The value indicating whether to keep the connection alive. + Required. :paramtype keep_http_connection_alive: bool - :keyword unfold_http_headers: Required. The value indicating whether to unfold the HTTP - headers. + :keyword unfold_http_headers: The value indicating whether to unfold the HTTP headers. + Required. :paramtype unfold_http_headers: bool """ - super(AS2MessageConnectionSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.ignore_certificate_name_mismatch = ignore_certificate_name_mismatch self.support_http_status_code_continue = support_http_status_code_continue self.keep_http_connection_alive = keep_http_connection_alive self.unfold_http_headers = unfold_http_headers -class AS2OneWayAgreement(msrest.serialization.Model): +class AS2OneWayAgreement(_serialization.Model): """The integration account AS2 one-way agreement. All required parameters must be populated in order to send to Azure. - :ivar sender_business_identity: Required. The sender business identity. + :ivar sender_business_identity: The sender business identity. Required. :vartype sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :ivar receiver_business_identity: Required. The receiver business identity. + :ivar receiver_business_identity: The receiver business identity. Required. :vartype receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :ivar protocol_settings: Required. The AS2 protocol settings. + :ivar protocol_settings: The AS2 protocol settings. Required. :vartype protocol_settings: ~azure.mgmt.logic.models.AS2ProtocolSettings """ _validation = { - 'sender_business_identity': {'required': True}, - 'receiver_business_identity': {'required': True}, - 'protocol_settings': {'required': True}, + "sender_business_identity": {"required": True}, + "receiver_business_identity": {"required": True}, + "protocol_settings": {"required": True}, } _attribute_map = { - 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, - 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, - 'protocol_settings': {'key': 'protocolSettings', 'type': 'AS2ProtocolSettings'}, + "sender_business_identity": {"key": "senderBusinessIdentity", "type": "BusinessIdentity"}, + "receiver_business_identity": {"key": "receiverBusinessIdentity", "type": "BusinessIdentity"}, + "protocol_settings": {"key": "protocolSettings", "type": "AS2ProtocolSettings"}, } 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 ): """ - :keyword sender_business_identity: Required. The sender business identity. + :keyword sender_business_identity: The sender business identity. Required. :paramtype sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :keyword receiver_business_identity: Required. The receiver business identity. + :keyword receiver_business_identity: The receiver business identity. Required. :paramtype receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :keyword protocol_settings: Required. The AS2 protocol settings. + :keyword protocol_settings: The AS2 protocol settings. Required. :paramtype protocol_settings: ~azure.mgmt.logic.models.AS2ProtocolSettings """ - super(AS2OneWayAgreement, self).__init__(**kwargs) + super().__init__(**kwargs) self.sender_business_identity = sender_business_identity self.receiver_business_identity = receiver_business_identity self.protocol_settings = protocol_settings -class AS2ProtocolSettings(msrest.serialization.Model): +class AS2ProtocolSettings(_serialization.Model): """The AS2 agreement protocol settings. All required parameters must be populated in order to send to Azure. - :ivar message_connection_settings: Required. The message connection settings. + :ivar message_connection_settings: The message connection settings. Required. :vartype message_connection_settings: ~azure.mgmt.logic.models.AS2MessageConnectionSettings - :ivar acknowledgement_connection_settings: Required. The acknowledgement connection settings. + :ivar acknowledgement_connection_settings: The acknowledgement connection settings. Required. :vartype acknowledgement_connection_settings: ~azure.mgmt.logic.models.AS2AcknowledgementConnectionSettings - :ivar mdn_settings: Required. The MDN settings. + :ivar mdn_settings: The MDN settings. Required. :vartype mdn_settings: ~azure.mgmt.logic.models.AS2MdnSettings - :ivar security_settings: Required. The security settings. + :ivar security_settings: The security settings. Required. :vartype security_settings: ~azure.mgmt.logic.models.AS2SecuritySettings - :ivar validation_settings: Required. The validation settings. + :ivar validation_settings: The validation settings. Required. :vartype validation_settings: ~azure.mgmt.logic.models.AS2ValidationSettings - :ivar envelope_settings: Required. The envelope settings. + :ivar envelope_settings: The envelope settings. Required. :vartype envelope_settings: ~azure.mgmt.logic.models.AS2EnvelopeSettings - :ivar error_settings: Required. The error settings. + :ivar error_settings: The error settings. Required. :vartype error_settings: ~azure.mgmt.logic.models.AS2ErrorSettings """ _validation = { - 'message_connection_settings': {'required': True}, - 'acknowledgement_connection_settings': {'required': True}, - 'mdn_settings': {'required': True}, - 'security_settings': {'required': True}, - 'validation_settings': {'required': True}, - 'envelope_settings': {'required': True}, - 'error_settings': {'required': True}, + "message_connection_settings": {"required": True}, + "acknowledgement_connection_settings": {"required": True}, + "mdn_settings": {"required": True}, + "security_settings": {"required": True}, + "validation_settings": {"required": True}, + "envelope_settings": {"required": True}, + "error_settings": {"required": True}, } _attribute_map = { - 'message_connection_settings': {'key': 'messageConnectionSettings', 'type': 'AS2MessageConnectionSettings'}, - 'acknowledgement_connection_settings': {'key': 'acknowledgementConnectionSettings', 'type': 'AS2AcknowledgementConnectionSettings'}, - 'mdn_settings': {'key': 'mdnSettings', 'type': 'AS2MdnSettings'}, - 'security_settings': {'key': 'securitySettings', 'type': 'AS2SecuritySettings'}, - 'validation_settings': {'key': 'validationSettings', 'type': 'AS2ValidationSettings'}, - 'envelope_settings': {'key': 'envelopeSettings', 'type': 'AS2EnvelopeSettings'}, - 'error_settings': {'key': 'errorSettings', 'type': 'AS2ErrorSettings'}, + "message_connection_settings": {"key": "messageConnectionSettings", "type": "AS2MessageConnectionSettings"}, + "acknowledgement_connection_settings": { + "key": "acknowledgementConnectionSettings", + "type": "AS2AcknowledgementConnectionSettings", + }, + "mdn_settings": {"key": "mdnSettings", "type": "AS2MdnSettings"}, + "security_settings": {"key": "securitySettings", "type": "AS2SecuritySettings"}, + "validation_settings": {"key": "validationSettings", "type": "AS2ValidationSettings"}, + "envelope_settings": {"key": "envelopeSettings", "type": "AS2EnvelopeSettings"}, + "error_settings": {"key": "errorSettings", "type": "AS2ErrorSettings"}, } 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 ): """ - :keyword message_connection_settings: Required. The message connection settings. + :keyword message_connection_settings: The message connection settings. Required. :paramtype message_connection_settings: ~azure.mgmt.logic.models.AS2MessageConnectionSettings - :keyword acknowledgement_connection_settings: Required. The acknowledgement connection - settings. + :keyword acknowledgement_connection_settings: The acknowledgement connection settings. + Required. :paramtype acknowledgement_connection_settings: ~azure.mgmt.logic.models.AS2AcknowledgementConnectionSettings - :keyword mdn_settings: Required. The MDN settings. + :keyword mdn_settings: The MDN settings. Required. :paramtype mdn_settings: ~azure.mgmt.logic.models.AS2MdnSettings - :keyword security_settings: Required. The security settings. + :keyword security_settings: The security settings. Required. :paramtype security_settings: ~azure.mgmt.logic.models.AS2SecuritySettings - :keyword validation_settings: Required. The validation settings. + :keyword validation_settings: The validation settings. Required. :paramtype validation_settings: ~azure.mgmt.logic.models.AS2ValidationSettings - :keyword envelope_settings: Required. The envelope settings. + :keyword envelope_settings: The envelope settings. Required. :paramtype envelope_settings: ~azure.mgmt.logic.models.AS2EnvelopeSettings - :keyword error_settings: Required. The error settings. + :keyword error_settings: The error settings. Required. :paramtype error_settings: ~azure.mgmt.logic.models.AS2ErrorSettings """ - super(AS2ProtocolSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_connection_settings = message_connection_settings self.acknowledgement_connection_settings = acknowledgement_connection_settings self.mdn_settings = mdn_settings @@ -1489,35 +1460,35 @@ def __init__( self.error_settings = error_settings -class AS2SecuritySettings(msrest.serialization.Model): +class AS2SecuritySettings(_serialization.Model): """The AS2 agreement security settings. All required parameters must be populated in order to send to Azure. - :ivar override_group_signing_certificate: Required. The value indicating whether to send or - request a MDN. + :ivar override_group_signing_certificate: The value indicating whether to send or request a + MDN. Required. :vartype override_group_signing_certificate: bool :ivar signing_certificate_name: The name of the signing certificate. :vartype signing_certificate_name: str :ivar encryption_certificate_name: The name of the encryption certificate. :vartype encryption_certificate_name: str - :ivar enable_nrr_for_inbound_encoded_messages: Required. The value indicating whether to enable - NRR for inbound encoded messages. + :ivar enable_nrr_for_inbound_encoded_messages: The value indicating whether to enable NRR for + inbound encoded messages. Required. :vartype enable_nrr_for_inbound_encoded_messages: bool - :ivar enable_nrr_for_inbound_decoded_messages: Required. The value indicating whether to enable - NRR for inbound decoded messages. + :ivar enable_nrr_for_inbound_decoded_messages: The value indicating whether to enable NRR for + inbound decoded messages. Required. :vartype enable_nrr_for_inbound_decoded_messages: bool - :ivar enable_nrr_for_outbound_mdn: Required. The value indicating whether to enable NRR for - outbound MDN. + :ivar enable_nrr_for_outbound_mdn: The value indicating whether to enable NRR for outbound MDN. + Required. :vartype enable_nrr_for_outbound_mdn: bool - :ivar enable_nrr_for_outbound_encoded_messages: Required. The value indicating whether to - enable NRR for outbound encoded messages. + :ivar enable_nrr_for_outbound_encoded_messages: The value indicating whether to enable NRR for + outbound encoded messages. Required. :vartype enable_nrr_for_outbound_encoded_messages: bool - :ivar enable_nrr_for_outbound_decoded_messages: Required. The value indicating whether to - enable NRR for outbound decoded messages. + :ivar enable_nrr_for_outbound_decoded_messages: The value indicating whether to enable NRR for + outbound decoded messages. Required. :vartype enable_nrr_for_outbound_decoded_messages: bool - :ivar enable_nrr_for_inbound_mdn: Required. The value indicating whether to enable NRR for - inbound MDN. + :ivar enable_nrr_for_inbound_mdn: The value indicating whether to enable NRR for inbound MDN. + Required. :vartype enable_nrr_for_inbound_mdn: bool :ivar sha2_algorithm_format: The Sha2 algorithm format. Valid values are Sha2, ShaHashSize, ShaHyphenHashSize, Sha2UnderscoreHashSize. @@ -1525,26 +1496,26 @@ class AS2SecuritySettings(msrest.serialization.Model): """ _validation = { - 'override_group_signing_certificate': {'required': True}, - 'enable_nrr_for_inbound_encoded_messages': {'required': True}, - 'enable_nrr_for_inbound_decoded_messages': {'required': True}, - 'enable_nrr_for_outbound_mdn': {'required': True}, - 'enable_nrr_for_outbound_encoded_messages': {'required': True}, - 'enable_nrr_for_outbound_decoded_messages': {'required': True}, - 'enable_nrr_for_inbound_mdn': {'required': True}, + "override_group_signing_certificate": {"required": True}, + "enable_nrr_for_inbound_encoded_messages": {"required": True}, + "enable_nrr_for_inbound_decoded_messages": {"required": True}, + "enable_nrr_for_outbound_mdn": {"required": True}, + "enable_nrr_for_outbound_encoded_messages": {"required": True}, + "enable_nrr_for_outbound_decoded_messages": {"required": True}, + "enable_nrr_for_inbound_mdn": {"required": True}, } _attribute_map = { - 'override_group_signing_certificate': {'key': 'overrideGroupSigningCertificate', 'type': 'bool'}, - 'signing_certificate_name': {'key': 'signingCertificateName', 'type': 'str'}, - 'encryption_certificate_name': {'key': 'encryptionCertificateName', 'type': 'str'}, - 'enable_nrr_for_inbound_encoded_messages': {'key': 'enableNRRForInboundEncodedMessages', 'type': 'bool'}, - 'enable_nrr_for_inbound_decoded_messages': {'key': 'enableNRRForInboundDecodedMessages', 'type': 'bool'}, - 'enable_nrr_for_outbound_mdn': {'key': 'enableNRRForOutboundMDN', 'type': 'bool'}, - 'enable_nrr_for_outbound_encoded_messages': {'key': 'enableNRRForOutboundEncodedMessages', 'type': 'bool'}, - 'enable_nrr_for_outbound_decoded_messages': {'key': 'enableNRRForOutboundDecodedMessages', 'type': 'bool'}, - 'enable_nrr_for_inbound_mdn': {'key': 'enableNRRForInboundMDN', 'type': 'bool'}, - 'sha2_algorithm_format': {'key': 'sha2AlgorithmFormat', 'type': 'str'}, + "override_group_signing_certificate": {"key": "overrideGroupSigningCertificate", "type": "bool"}, + "signing_certificate_name": {"key": "signingCertificateName", "type": "str"}, + "encryption_certificate_name": {"key": "encryptionCertificateName", "type": "str"}, + "enable_nrr_for_inbound_encoded_messages": {"key": "enableNRRForInboundEncodedMessages", "type": "bool"}, + "enable_nrr_for_inbound_decoded_messages": {"key": "enableNRRForInboundDecodedMessages", "type": "bool"}, + "enable_nrr_for_outbound_mdn": {"key": "enableNRRForOutboundMDN", "type": "bool"}, + "enable_nrr_for_outbound_encoded_messages": {"key": "enableNRRForOutboundEncodedMessages", "type": "bool"}, + "enable_nrr_for_outbound_decoded_messages": {"key": "enableNRRForOutboundDecodedMessages", "type": "bool"}, + "enable_nrr_for_inbound_mdn": {"key": "enableNRRForInboundMDN", "type": "bool"}, + "sha2_algorithm_format": {"key": "sha2AlgorithmFormat", "type": "str"}, } def __init__( @@ -1563,36 +1534,36 @@ def __init__( **kwargs ): """ - :keyword override_group_signing_certificate: Required. The value indicating whether to send or - request a MDN. + :keyword override_group_signing_certificate: The value indicating whether to send or request a + MDN. Required. :paramtype override_group_signing_certificate: bool :keyword signing_certificate_name: The name of the signing certificate. :paramtype signing_certificate_name: str :keyword encryption_certificate_name: The name of the encryption certificate. :paramtype encryption_certificate_name: str - :keyword enable_nrr_for_inbound_encoded_messages: Required. The value indicating whether to - enable NRR for inbound encoded messages. + :keyword enable_nrr_for_inbound_encoded_messages: The value indicating whether to enable NRR + for inbound encoded messages. Required. :paramtype enable_nrr_for_inbound_encoded_messages: bool - :keyword enable_nrr_for_inbound_decoded_messages: Required. The value indicating whether to - enable NRR for inbound decoded messages. + :keyword enable_nrr_for_inbound_decoded_messages: The value indicating whether to enable NRR + for inbound decoded messages. Required. :paramtype enable_nrr_for_inbound_decoded_messages: bool - :keyword enable_nrr_for_outbound_mdn: Required. The value indicating whether to enable NRR for - outbound MDN. + :keyword enable_nrr_for_outbound_mdn: The value indicating whether to enable NRR for outbound + MDN. Required. :paramtype enable_nrr_for_outbound_mdn: bool - :keyword enable_nrr_for_outbound_encoded_messages: Required. The value indicating whether to - enable NRR for outbound encoded messages. + :keyword enable_nrr_for_outbound_encoded_messages: The value indicating whether to enable NRR + for outbound encoded messages. Required. :paramtype enable_nrr_for_outbound_encoded_messages: bool - :keyword enable_nrr_for_outbound_decoded_messages: Required. The value indicating whether to - enable NRR for outbound decoded messages. + :keyword enable_nrr_for_outbound_decoded_messages: The value indicating whether to enable NRR + for outbound decoded messages. Required. :paramtype enable_nrr_for_outbound_decoded_messages: bool - :keyword enable_nrr_for_inbound_mdn: Required. The value indicating whether to enable NRR for - inbound MDN. + :keyword enable_nrr_for_inbound_mdn: The value indicating whether to enable NRR for inbound + MDN. Required. :paramtype enable_nrr_for_inbound_mdn: bool :keyword sha2_algorithm_format: The Sha2 algorithm format. Valid values are Sha2, ShaHashSize, ShaHyphenHashSize, Sha2UnderscoreHashSize. :paramtype sha2_algorithm_format: str """ - super(AS2SecuritySettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.override_group_signing_certificate = override_group_signing_certificate self.signing_certificate_name = signing_certificate_name self.encryption_certificate_name = encryption_certificate_name @@ -1605,64 +1576,67 @@ def __init__( self.sha2_algorithm_format = sha2_algorithm_format -class AS2ValidationSettings(msrest.serialization.Model): +class AS2ValidationSettings(_serialization.Model): """The AS2 agreement validation settings. All required parameters must be populated in order to send to Azure. - :ivar override_message_properties: Required. The value indicating whether to override incoming - message properties with those in agreement. + :ivar override_message_properties: The value indicating whether to override incoming message + properties with those in agreement. Required. :vartype override_message_properties: bool - :ivar encrypt_message: Required. The value indicating whether the message has to be encrypted. + :ivar encrypt_message: The value indicating whether the message has to be encrypted. Required. :vartype encrypt_message: bool - :ivar sign_message: Required. The value indicating whether the message has to be signed. + :ivar sign_message: The value indicating whether the message has to be signed. Required. :vartype sign_message: bool - :ivar compress_message: Required. The value indicating whether the message has to be - compressed. + :ivar compress_message: The value indicating whether the message has to be compressed. + Required. :vartype compress_message: bool - :ivar check_duplicate_message: Required. The value indicating whether to check for duplicate - message. + :ivar check_duplicate_message: The value indicating whether to check for duplicate message. + Required. :vartype check_duplicate_message: bool - :ivar interchange_duplicates_validity_days: Required. The number of days to look back for - duplicate interchange. + :ivar interchange_duplicates_validity_days: The number of days to look back for duplicate + interchange. Required. :vartype interchange_duplicates_validity_days: int - :ivar check_certificate_revocation_list_on_send: Required. The value indicating whether to - check for certificate revocation list on send. + :ivar check_certificate_revocation_list_on_send: The value indicating whether to check for + certificate revocation list on send. Required. :vartype check_certificate_revocation_list_on_send: bool - :ivar check_certificate_revocation_list_on_receive: Required. The value indicating whether to - check for certificate revocation list on receive. + :ivar check_certificate_revocation_list_on_receive: The value indicating whether to check for + certificate revocation list on receive. Required. :vartype check_certificate_revocation_list_on_receive: bool - :ivar encryption_algorithm: Required. The encryption algorithm. Possible values include: - "NotSpecified", "None", "DES3", "RC2", "AES128", "AES192", "AES256". + :ivar encryption_algorithm: The encryption algorithm. Required. Known values are: + "NotSpecified", "None", "DES3", "RC2", "AES128", "AES192", and "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", and "SHA2512". :vartype signing_algorithm: str or ~azure.mgmt.logic.models.SigningAlgorithm """ _validation = { - 'override_message_properties': {'required': True}, - 'encrypt_message': {'required': True}, - 'sign_message': {'required': True}, - 'compress_message': {'required': True}, - 'check_duplicate_message': {'required': True}, - 'interchange_duplicates_validity_days': {'required': True}, - 'check_certificate_revocation_list_on_send': {'required': True}, - 'check_certificate_revocation_list_on_receive': {'required': True}, - 'encryption_algorithm': {'required': True}, + "override_message_properties": {"required": True}, + "encrypt_message": {"required": True}, + "sign_message": {"required": True}, + "compress_message": {"required": True}, + "check_duplicate_message": {"required": True}, + "interchange_duplicates_validity_days": {"required": True}, + "check_certificate_revocation_list_on_send": {"required": True}, + "check_certificate_revocation_list_on_receive": {"required": True}, + "encryption_algorithm": {"required": True}, } _attribute_map = { - 'override_message_properties': {'key': 'overrideMessageProperties', 'type': 'bool'}, - 'encrypt_message': {'key': 'encryptMessage', 'type': 'bool'}, - 'sign_message': {'key': 'signMessage', 'type': 'bool'}, - 'compress_message': {'key': 'compressMessage', 'type': 'bool'}, - 'check_duplicate_message': {'key': 'checkDuplicateMessage', 'type': 'bool'}, - 'interchange_duplicates_validity_days': {'key': 'interchangeDuplicatesValidityDays', 'type': 'int'}, - 'check_certificate_revocation_list_on_send': {'key': 'checkCertificateRevocationListOnSend', 'type': 'bool'}, - 'check_certificate_revocation_list_on_receive': {'key': 'checkCertificateRevocationListOnReceive', 'type': 'bool'}, - 'encryption_algorithm': {'key': 'encryptionAlgorithm', 'type': 'str'}, - 'signing_algorithm': {'key': 'signingAlgorithm', 'type': 'str'}, + "override_message_properties": {"key": "overrideMessageProperties", "type": "bool"}, + "encrypt_message": {"key": "encryptMessage", "type": "bool"}, + "sign_message": {"key": "signMessage", "type": "bool"}, + "compress_message": {"key": "compressMessage", "type": "bool"}, + "check_duplicate_message": {"key": "checkDuplicateMessage", "type": "bool"}, + "interchange_duplicates_validity_days": {"key": "interchangeDuplicatesValidityDays", "type": "int"}, + "check_certificate_revocation_list_on_send": {"key": "checkCertificateRevocationListOnSend", "type": "bool"}, + "check_certificate_revocation_list_on_receive": { + "key": "checkCertificateRevocationListOnReceive", + "type": "bool", + }, + "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, + "signing_algorithm": {"key": "signingAlgorithm", "type": "str"}, } def __init__( @@ -1676,42 +1650,42 @@ 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 ): """ - :keyword override_message_properties: Required. The value indicating whether to override - incoming message properties with those in agreement. + :keyword override_message_properties: The value indicating whether to override incoming message + properties with those in agreement. Required. :paramtype override_message_properties: bool - :keyword encrypt_message: Required. The value indicating whether the message has to be - encrypted. + :keyword encrypt_message: The value indicating whether the message has to be encrypted. + Required. :paramtype encrypt_message: bool - :keyword sign_message: Required. The value indicating whether the message has to be signed. + :keyword sign_message: The value indicating whether the message has to be signed. Required. :paramtype sign_message: bool - :keyword compress_message: Required. The value indicating whether the message has to be - compressed. + :keyword compress_message: The value indicating whether the message has to be compressed. + Required. :paramtype compress_message: bool - :keyword check_duplicate_message: Required. The value indicating whether to check for duplicate - message. + :keyword check_duplicate_message: The value indicating whether to check for duplicate message. + Required. :paramtype check_duplicate_message: bool - :keyword interchange_duplicates_validity_days: Required. The number of days to look back for - duplicate interchange. + :keyword interchange_duplicates_validity_days: The number of days to look back for duplicate + interchange. Required. :paramtype interchange_duplicates_validity_days: int - :keyword check_certificate_revocation_list_on_send: Required. The value indicating whether to - check for certificate revocation list on send. + :keyword check_certificate_revocation_list_on_send: The value indicating whether to check for + certificate revocation list on send. Required. :paramtype check_certificate_revocation_list_on_send: bool - :keyword check_certificate_revocation_list_on_receive: Required. The value indicating whether - to check for certificate revocation list on receive. + :keyword check_certificate_revocation_list_on_receive: The value indicating whether to check + for certificate revocation list on receive. Required. :paramtype check_certificate_revocation_list_on_receive: bool - :keyword encryption_algorithm: Required. The encryption algorithm. Possible values include: - "NotSpecified", "None", "DES3", "RC2", "AES128", "AES192", "AES256". + :keyword encryption_algorithm: The encryption algorithm. Required. Known values are: + "NotSpecified", "None", "DES3", "RC2", "AES128", "AES192", and "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", and "SHA2512". :paramtype signing_algorithm: str or ~azure.mgmt.logic.models.SigningAlgorithm """ - super(AS2ValidationSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.override_message_properties = override_message_properties self.encrypt_message = encrypt_message self.sign_message = sign_message @@ -1724,7 +1698,7 @@ def __init__( self.signing_algorithm = signing_algorithm -class AssemblyCollection(msrest.serialization.Model): +class AssemblyCollection(_serialization.Model): """A collection of assembly definitions. :ivar value: @@ -1732,20 +1706,15 @@ class AssemblyCollection(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[AssemblyDefinition]'}, + "value": {"key": "value", "type": "[AssemblyDefinition]"}, } - def __init__( - self, - *, - value: Optional[List["AssemblyDefinition"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.AssemblyDefinition"]] = None, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.logic.models.AssemblyDefinition] """ - super(AssemblyCollection, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value @@ -1764,32 +1733,32 @@ class AssemblyDefinition(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] - :ivar properties: Required. The assembly properties. + :ivar properties: The assembly properties. Required. :vartype properties: ~azure.mgmt.logic.models.AssemblyProperties """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'AssemblyProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "AssemblyProperties"}, } def __init__( self, *, - properties: "AssemblyProperties", + properties: "_models.AssemblyProperties", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs @@ -1797,12 +1766,12 @@ def __init__( """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] - :keyword properties: Required. The assembly properties. + :keyword properties: The assembly properties. Required. :paramtype properties: ~azure.mgmt.logic.models.AssemblyProperties """ - super(AssemblyDefinition, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.properties = properties @@ -1823,7 +1792,7 @@ class AssemblyProperties(ArtifactContentPropertiesDefinition): :vartype content_type: str :ivar content_link: The content link. :vartype content_link: ~azure.mgmt.logic.models.ContentLink - :ivar assembly_name: Required. The assembly name. + :ivar assembly_name: The assembly name. Required. :vartype assembly_name: str :ivar assembly_version: The assembly version. :vartype assembly_version: str @@ -1834,20 +1803,20 @@ class AssemblyProperties(ArtifactContentPropertiesDefinition): """ _validation = { - 'assembly_name': {'required': True}, + "assembly_name": {"required": True}, } _attribute_map = { - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'content': {'key': 'content', 'type': 'object'}, - 'content_type': {'key': 'contentType', 'type': 'str'}, - 'content_link': {'key': 'contentLink', 'type': 'ContentLink'}, - 'assembly_name': {'key': 'assemblyName', 'type': 'str'}, - 'assembly_version': {'key': 'assemblyVersion', 'type': 'str'}, - 'assembly_culture': {'key': 'assemblyCulture', 'type': 'str'}, - 'assembly_public_key_token': {'key': 'assemblyPublicKeyToken', 'type': 'str'}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "changed_time": {"key": "changedTime", "type": "iso-8601"}, + "metadata": {"key": "metadata", "type": "object"}, + "content": {"key": "content", "type": "object"}, + "content_type": {"key": "contentType", "type": "str"}, + "content_link": {"key": "contentLink", "type": "ContentLink"}, + "assembly_name": {"key": "assemblyName", "type": "str"}, + "assembly_version": {"key": "assemblyVersion", "type": "str"}, + "assembly_culture": {"key": "assemblyCulture", "type": "str"}, + "assembly_public_key_token": {"key": "assemblyPublicKeyToken", "type": "str"}, } def __init__( @@ -1859,7 +1828,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, @@ -1878,7 +1847,7 @@ def __init__( :paramtype content_type: str :keyword content_link: The content link. :paramtype content_link: ~azure.mgmt.logic.models.ContentLink - :keyword assembly_name: Required. The assembly name. + :keyword assembly_name: The assembly name. Required. :paramtype assembly_name: str :keyword assembly_version: The assembly version. :paramtype assembly_version: str @@ -1887,41 +1856,44 @@ def __init__( :keyword assembly_public_key_token: The assembly public key token. :paramtype assembly_public_key_token: str """ - super(AssemblyProperties, self).__init__(created_time=created_time, changed_time=changed_time, metadata=metadata, content=content, content_type=content_type, content_link=content_link, **kwargs) + super().__init__( + created_time=created_time, + changed_time=changed_time, + metadata=metadata, + content=content, + content_type=content_type, + content_link=content_link, + **kwargs + ) self.assembly_name = assembly_name self.assembly_version = assembly_version self.assembly_culture = assembly_culture self.assembly_public_key_token = assembly_public_key_token -class ErrorInfo(msrest.serialization.Model): +class ErrorInfo(_serialization.Model): """The error info. All required parameters must be populated in order to send to Azure. - :ivar code: Required. The error code. + :ivar code: The error code. Required. :vartype code: str """ _validation = { - 'code': {'required': True}, + "code": {"required": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, } - def __init__( - self, - *, - code: str, - **kwargs - ): + def __init__(self, *, code: str, **kwargs): """ - :keyword code: Required. The error code. + :keyword code: The error code. Required. :paramtype code: str """ - super(ErrorInfo, self).__init__(**kwargs) + super().__init__(**kwargs) self.code = code @@ -1930,47 +1902,42 @@ class AzureResourceErrorInfo(ErrorInfo): All required parameters must be populated in order to send to Azure. - :ivar code: Required. The error code. + :ivar code: The error code. Required. :vartype code: str - :ivar message: Required. The error message. + :ivar message: The error message. Required. :vartype message: str :ivar details: The error details. :vartype details: list[~azure.mgmt.logic.models.AzureResourceErrorInfo] """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + "code": {"required": True}, + "message": {"required": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[AzureResourceErrorInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "details": {"key": "details", "type": "[AzureResourceErrorInfo]"}, } def __init__( - self, - *, - code: str, - message: str, - details: Optional[List["AzureResourceErrorInfo"]] = None, - **kwargs + self, *, code: str, message: str, details: Optional[List["_models.AzureResourceErrorInfo"]] = None, **kwargs ): """ - :keyword code: Required. The error code. + :keyword code: The error code. Required. :paramtype code: str - :keyword message: Required. The error message. + :keyword message: The error message. Required. :paramtype message: str :keyword details: The error details. :paramtype details: list[~azure.mgmt.logic.models.AzureResourceErrorInfo] """ - super(AzureResourceErrorInfo, self).__init__(code=code, **kwargs) + super().__init__(code=code, **kwargs) self.message = message self.details = details -class B2BPartnerContent(msrest.serialization.Model): +class B2BPartnerContent(_serialization.Model): """The B2B partner content. :ivar business_identities: The list of partner business identities. @@ -1978,20 +1945,15 @@ class B2BPartnerContent(msrest.serialization.Model): """ _attribute_map = { - 'business_identities': {'key': 'businessIdentities', 'type': '[BusinessIdentity]'}, + "business_identities": {"key": "businessIdentities", "type": "[BusinessIdentity]"}, } - def __init__( - self, - *, - business_identities: Optional[List["BusinessIdentity"]] = None, - **kwargs - ): + def __init__(self, *, business_identities: Optional[List["_models.BusinessIdentity"]] = None, **kwargs): """ :keyword business_identities: The list of partner business identities. :paramtype business_identities: list[~azure.mgmt.logic.models.BusinessIdentity] """ - super(B2BPartnerContent, self).__init__(**kwargs) + super().__init__(**kwargs) self.business_identities = business_identities @@ -2010,32 +1972,32 @@ class BatchConfiguration(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] - :ivar properties: Required. The batch configuration properties. + :ivar properties: The batch configuration properties. Required. :vartype properties: ~azure.mgmt.logic.models.BatchConfigurationProperties """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "properties": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'BatchConfigurationProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "BatchConfigurationProperties"}, } def __init__( self, *, - properties: "BatchConfigurationProperties", + properties: "_models.BatchConfigurationProperties", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs @@ -2043,16 +2005,16 @@ def __init__( """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] - :keyword properties: Required. The batch configuration properties. + :keyword properties: The batch configuration properties. Required. :paramtype properties: ~azure.mgmt.logic.models.BatchConfigurationProperties """ - super(BatchConfiguration, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.properties = properties -class BatchConfigurationCollection(msrest.serialization.Model): +class BatchConfigurationCollection(_serialization.Model): """A collection of batch configurations. :ivar value: @@ -2060,20 +2022,15 @@ class BatchConfigurationCollection(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[BatchConfiguration]'}, + "value": {"key": "value", "type": "[BatchConfiguration]"}, } - def __init__( - self, - *, - value: Optional[List["BatchConfiguration"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.BatchConfiguration"]] = None, **kwargs): """ :keyword value: :paramtype value: list[~azure.mgmt.logic.models.BatchConfiguration] """ - super(BatchConfigurationCollection, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value @@ -2088,30 +2045,30 @@ class BatchConfigurationProperties(ArtifactProperties): :vartype changed_time: ~datetime.datetime :ivar metadata: Anything. :vartype metadata: any - :ivar batch_group_name: Required. The name of the batch group. + :ivar batch_group_name: The name of the batch group. Required. :vartype batch_group_name: str - :ivar release_criteria: Required. The batch release criteria. + :ivar release_criteria: The batch release criteria. Required. :vartype release_criteria: ~azure.mgmt.logic.models.BatchReleaseCriteria """ _validation = { - 'batch_group_name': {'required': True}, - 'release_criteria': {'required': True}, + "batch_group_name": {"required": True}, + "release_criteria": {"required": True}, } _attribute_map = { - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'batch_group_name': {'key': 'batchGroupName', 'type': 'str'}, - 'release_criteria': {'key': 'releaseCriteria', 'type': 'BatchReleaseCriteria'}, + "created_time": {"key": "createdTime", "type": "iso-8601"}, + "changed_time": {"key": "changedTime", "type": "iso-8601"}, + "metadata": {"key": "metadata", "type": "object"}, + "batch_group_name": {"key": "batchGroupName", "type": "str"}, + "release_criteria": {"key": "releaseCriteria", "type": "BatchReleaseCriteria"}, } 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, @@ -2124,17 +2081,17 @@ def __init__( :paramtype changed_time: ~datetime.datetime :keyword metadata: Anything. :paramtype metadata: any - :keyword batch_group_name: Required. The name of the batch group. + :keyword batch_group_name: The name of the batch group. Required. :paramtype batch_group_name: str - :keyword release_criteria: Required. The batch release criteria. + :keyword release_criteria: The batch release criteria. Required. :paramtype release_criteria: ~azure.mgmt.logic.models.BatchReleaseCriteria """ - super(BatchConfigurationProperties, self).__init__(created_time=created_time, changed_time=changed_time, metadata=metadata, **kwargs) + super().__init__(created_time=created_time, changed_time=changed_time, metadata=metadata, **kwargs) self.batch_group_name = batch_group_name self.release_criteria = release_criteria -class BatchReleaseCriteria(msrest.serialization.Model): +class BatchReleaseCriteria(_serialization.Model): """The batch release criteria. :ivar message_count: The message count. @@ -2146,9 +2103,9 @@ class BatchReleaseCriteria(msrest.serialization.Model): """ _attribute_map = { - 'message_count': {'key': 'messageCount', 'type': 'int'}, - 'batch_size': {'key': 'batchSize', 'type': 'int'}, - 'recurrence': {'key': 'recurrence', 'type': 'WorkflowTriggerRecurrence'}, + "message_count": {"key": "messageCount", "type": "int"}, + "batch_size": {"key": "batchSize", "type": "int"}, + "recurrence": {"key": "recurrence", "type": "WorkflowTriggerRecurrence"}, } def __init__( @@ -2156,7 +2113,7 @@ def __init__( *, message_count: Optional[int] = None, batch_size: Optional[int] = None, - recurrence: Optional["WorkflowTriggerRecurrence"] = None, + recurrence: Optional["_models.WorkflowTriggerRecurrence"] = None, **kwargs ): """ @@ -2167,53 +2124,47 @@ def __init__( :keyword recurrence: The recurrence. :paramtype recurrence: ~azure.mgmt.logic.models.WorkflowTriggerRecurrence """ - super(BatchReleaseCriteria, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_count = message_count self.batch_size = batch_size self.recurrence = recurrence -class BusinessIdentity(msrest.serialization.Model): +class BusinessIdentity(_serialization.Model): """The integration account partner's business identity. All required parameters must be populated in order to send to Azure. - :ivar qualifier: Required. The business identity qualifier e.g. as2identity, ZZ, ZZZ, 31, 32. + :ivar qualifier: The business identity qualifier e.g. as2identity, ZZ, ZZZ, 31, 32. Required. :vartype qualifier: str - :ivar value: Required. The user defined business identity value. + :ivar value: The user defined business identity value. Required. :vartype value: str """ _validation = { - 'qualifier': {'required': True}, - 'value': {'required': True}, + "qualifier": {"required": True}, + "value": {"required": True}, } _attribute_map = { - 'qualifier': {'key': 'qualifier', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "qualifier": {"key": "qualifier", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - *, - qualifier: str, - value: str, - **kwargs - ): + def __init__(self, *, qualifier: str, value: str, **kwargs): """ - :keyword qualifier: Required. The business identity qualifier e.g. as2identity, ZZ, ZZZ, 31, - 32. + :keyword qualifier: The business identity qualifier e.g. as2identity, ZZ, ZZZ, 31, 32. + Required. :paramtype qualifier: str - :keyword value: Required. The user defined business identity value. + :keyword value: The user defined business identity value. Required. :paramtype value: str """ - super(BusinessIdentity, self).__init__(**kwargs) + super().__init__(**kwargs) self.qualifier = qualifier self.value = value -class CallbackUrl(msrest.serialization.Model): +class CallbackUrl(_serialization.Model): """The callback url. :ivar value: The URL value. @@ -2221,24 +2172,19 @@ class CallbackUrl(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - *, - value: Optional[str] = None, - **kwargs - ): + def __init__(self, *, value: Optional[str] = None, **kwargs): """ :keyword value: The URL value. :paramtype value: str """ - super(CallbackUrl, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value -class ContentHash(msrest.serialization.Model): +class ContentHash(_serialization.Model): """The content hash. :ivar algorithm: The algorithm of the content hash. @@ -2248,29 +2194,23 @@ class ContentHash(msrest.serialization.Model): """ _attribute_map = { - 'algorithm': {'key': 'algorithm', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "algorithm": {"key": "algorithm", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - *, - algorithm: Optional[str] = None, - value: Optional[str] = None, - **kwargs - ): + def __init__(self, *, algorithm: Optional[str] = None, value: Optional[str] = None, **kwargs): """ :keyword algorithm: The algorithm of the content hash. :paramtype algorithm: str :keyword value: The value of the content hash. :paramtype value: str """ - super(ContentHash, self).__init__(**kwargs) + super().__init__(**kwargs) self.algorithm = algorithm self.value = value -class ContentLink(msrest.serialization.Model): +class ContentLink(_serialization.Model): """The content link. Variables are only populated by the server, and will be ignored when sending a request. @@ -2280,39 +2220,34 @@ class ContentLink(msrest.serialization.Model): :ivar content_version: The content version. :vartype content_version: str :ivar content_size: The content size. - :vartype content_size: long + :vartype content_size: int :ivar content_hash: The content hash. :vartype content_hash: ~azure.mgmt.logic.models.ContentHash :ivar metadata: The metadata. - :vartype metadata: any + :vartype metadata: JSON """ _validation = { - 'content_version': {'readonly': True}, - 'content_size': {'readonly': True}, - 'content_hash': {'readonly': True}, - 'metadata': {'readonly': True}, + "content_version": {"readonly": True}, + "content_size": {"readonly": True}, + "content_hash": {"readonly": True}, + "metadata": {"readonly": True}, } _attribute_map = { - 'uri': {'key': 'uri', 'type': 'str'}, - 'content_version': {'key': 'contentVersion', 'type': 'str'}, - 'content_size': {'key': 'contentSize', 'type': 'long'}, - 'content_hash': {'key': 'contentHash', 'type': 'ContentHash'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, + "uri": {"key": "uri", "type": "str"}, + "content_version": {"key": "contentVersion", "type": "str"}, + "content_size": {"key": "contentSize", "type": "int"}, + "content_hash": {"key": "contentHash", "type": "ContentHash"}, + "metadata": {"key": "metadata", "type": "object"}, } - def __init__( - self, - *, - uri: Optional[str] = None, - **kwargs - ): + def __init__(self, *, uri: Optional[str] = None, **kwargs): """ :keyword uri: The content link URI. :paramtype uri: str """ - super(ContentLink, self).__init__(**kwargs) + super().__init__(**kwargs) self.uri = uri self.content_version = None self.content_size = None @@ -2320,7 +2255,7 @@ def __init__( self.metadata = None -class Correlation(msrest.serialization.Model): +class Correlation(_serialization.Model): """The correlation property. :ivar client_tracking_id: The client tracking id. @@ -2328,85 +2263,80 @@ class Correlation(msrest.serialization.Model): """ _attribute_map = { - 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, + "client_tracking_id": {"key": "clientTrackingId", "type": "str"}, } - def __init__( - self, - *, - client_tracking_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_tracking_id: Optional[str] = None, **kwargs): """ :keyword client_tracking_id: The client tracking id. :paramtype client_tracking_id: str """ - super(Correlation, self).__init__(**kwargs) + super().__init__(**kwargs) self.client_tracking_id = client_tracking_id -class EdifactAcknowledgementSettings(msrest.serialization.Model): +class EdifactAcknowledgementSettings(_serialization.Model): # pylint: disable=too-many-instance-attributes """The Edifact agreement acknowledgement settings. All required parameters must be populated in order to send to Azure. - :ivar need_technical_acknowledgement: Required. The value indicating whether technical - acknowledgement is needed. + :ivar need_technical_acknowledgement: The value indicating whether technical acknowledgement is + needed. Required. :vartype need_technical_acknowledgement: bool - :ivar batch_technical_acknowledgements: Required. The value indicating whether to batch the - technical acknowledgements. + :ivar batch_technical_acknowledgements: The value indicating whether to batch the technical + acknowledgements. Required. :vartype batch_technical_acknowledgements: bool - :ivar need_functional_acknowledgement: Required. The value indicating whether functional - acknowledgement is needed. + :ivar need_functional_acknowledgement: The value indicating whether functional acknowledgement + is needed. Required. :vartype need_functional_acknowledgement: bool - :ivar batch_functional_acknowledgements: Required. The value indicating whether to batch - functional acknowledgements. + :ivar batch_functional_acknowledgements: The value indicating whether to batch functional + acknowledgements. Required. :vartype batch_functional_acknowledgements: bool - :ivar need_loop_for_valid_messages: Required. The value indicating whether a loop is needed for - valid messages. + :ivar need_loop_for_valid_messages: The value indicating whether a loop is needed for valid + messages. Required. :vartype need_loop_for_valid_messages: bool - :ivar send_synchronous_acknowledgement: Required. The value indicating whether to send - synchronous acknowledgement. + :ivar send_synchronous_acknowledgement: The value indicating whether to send synchronous + acknowledgement. Required. :vartype send_synchronous_acknowledgement: bool :ivar acknowledgement_control_number_prefix: The acknowledgement control number prefix. :vartype acknowledgement_control_number_prefix: str :ivar acknowledgement_control_number_suffix: The acknowledgement control number suffix. :vartype acknowledgement_control_number_suffix: str - :ivar acknowledgement_control_number_lower_bound: Required. The acknowledgement control number - lower bound. + :ivar acknowledgement_control_number_lower_bound: The acknowledgement control number lower + bound. Required. :vartype acknowledgement_control_number_lower_bound: int - :ivar acknowledgement_control_number_upper_bound: Required. The acknowledgement control number - upper bound. + :ivar acknowledgement_control_number_upper_bound: The acknowledgement control number upper + bound. Required. :vartype acknowledgement_control_number_upper_bound: int - :ivar rollover_acknowledgement_control_number: Required. The value indicating whether to - rollover acknowledgement control number. + :ivar rollover_acknowledgement_control_number: The value indicating whether to rollover + acknowledgement control number. Required. :vartype rollover_acknowledgement_control_number: bool """ _validation = { - 'need_technical_acknowledgement': {'required': True}, - 'batch_technical_acknowledgements': {'required': True}, - 'need_functional_acknowledgement': {'required': True}, - 'batch_functional_acknowledgements': {'required': True}, - 'need_loop_for_valid_messages': {'required': True}, - 'send_synchronous_acknowledgement': {'required': True}, - 'acknowledgement_control_number_lower_bound': {'required': True}, - 'acknowledgement_control_number_upper_bound': {'required': True}, - 'rollover_acknowledgement_control_number': {'required': True}, + "need_technical_acknowledgement": {"required": True}, + "batch_technical_acknowledgements": {"required": True}, + "need_functional_acknowledgement": {"required": True}, + "batch_functional_acknowledgements": {"required": True}, + "need_loop_for_valid_messages": {"required": True}, + "send_synchronous_acknowledgement": {"required": True}, + "acknowledgement_control_number_lower_bound": {"required": True}, + "acknowledgement_control_number_upper_bound": {"required": True}, + "rollover_acknowledgement_control_number": {"required": True}, } _attribute_map = { - 'need_technical_acknowledgement': {'key': 'needTechnicalAcknowledgement', 'type': 'bool'}, - 'batch_technical_acknowledgements': {'key': 'batchTechnicalAcknowledgements', 'type': 'bool'}, - 'need_functional_acknowledgement': {'key': 'needFunctionalAcknowledgement', 'type': 'bool'}, - 'batch_functional_acknowledgements': {'key': 'batchFunctionalAcknowledgements', 'type': 'bool'}, - 'need_loop_for_valid_messages': {'key': 'needLoopForValidMessages', 'type': 'bool'}, - 'send_synchronous_acknowledgement': {'key': 'sendSynchronousAcknowledgement', 'type': 'bool'}, - 'acknowledgement_control_number_prefix': {'key': 'acknowledgementControlNumberPrefix', 'type': 'str'}, - 'acknowledgement_control_number_suffix': {'key': 'acknowledgementControlNumberSuffix', 'type': 'str'}, - 'acknowledgement_control_number_lower_bound': {'key': 'acknowledgementControlNumberLowerBound', 'type': 'int'}, - 'acknowledgement_control_number_upper_bound': {'key': 'acknowledgementControlNumberUpperBound', 'type': 'int'}, - 'rollover_acknowledgement_control_number': {'key': 'rolloverAcknowledgementControlNumber', 'type': 'bool'}, + "need_technical_acknowledgement": {"key": "needTechnicalAcknowledgement", "type": "bool"}, + "batch_technical_acknowledgements": {"key": "batchTechnicalAcknowledgements", "type": "bool"}, + "need_functional_acknowledgement": {"key": "needFunctionalAcknowledgement", "type": "bool"}, + "batch_functional_acknowledgements": {"key": "batchFunctionalAcknowledgements", "type": "bool"}, + "need_loop_for_valid_messages": {"key": "needLoopForValidMessages", "type": "bool"}, + "send_synchronous_acknowledgement": {"key": "sendSynchronousAcknowledgement", "type": "bool"}, + "acknowledgement_control_number_prefix": {"key": "acknowledgementControlNumberPrefix", "type": "str"}, + "acknowledgement_control_number_suffix": {"key": "acknowledgementControlNumberSuffix", "type": "str"}, + "acknowledgement_control_number_lower_bound": {"key": "acknowledgementControlNumberLowerBound", "type": "int"}, + "acknowledgement_control_number_upper_bound": {"key": "acknowledgementControlNumberUpperBound", "type": "int"}, + "rollover_acknowledgement_control_number": {"key": "rolloverAcknowledgementControlNumber", "type": "bool"}, } def __init__( @@ -2426,39 +2356,39 @@ def __init__( **kwargs ): """ - :keyword need_technical_acknowledgement: Required. The value indicating whether technical - acknowledgement is needed. + :keyword need_technical_acknowledgement: The value indicating whether technical acknowledgement + is needed. Required. :paramtype need_technical_acknowledgement: bool - :keyword batch_technical_acknowledgements: Required. The value indicating whether to batch the - technical acknowledgements. + :keyword batch_technical_acknowledgements: The value indicating whether to batch the technical + acknowledgements. Required. :paramtype batch_technical_acknowledgements: bool - :keyword need_functional_acknowledgement: Required. The value indicating whether functional - acknowledgement is needed. + :keyword need_functional_acknowledgement: The value indicating whether functional + acknowledgement is needed. Required. :paramtype need_functional_acknowledgement: bool - :keyword batch_functional_acknowledgements: Required. The value indicating whether to batch - functional acknowledgements. + :keyword batch_functional_acknowledgements: The value indicating whether to batch functional + acknowledgements. Required. :paramtype batch_functional_acknowledgements: bool - :keyword need_loop_for_valid_messages: Required. The value indicating whether a loop is needed - for valid messages. + :keyword need_loop_for_valid_messages: The value indicating whether a loop is needed for valid + messages. Required. :paramtype need_loop_for_valid_messages: bool - :keyword send_synchronous_acknowledgement: Required. The value indicating whether to send - synchronous acknowledgement. + :keyword send_synchronous_acknowledgement: The value indicating whether to send synchronous + acknowledgement. Required. :paramtype send_synchronous_acknowledgement: bool :keyword acknowledgement_control_number_prefix: The acknowledgement control number prefix. :paramtype acknowledgement_control_number_prefix: str :keyword acknowledgement_control_number_suffix: The acknowledgement control number suffix. :paramtype acknowledgement_control_number_suffix: str - :keyword acknowledgement_control_number_lower_bound: Required. The acknowledgement control - number lower bound. + :keyword acknowledgement_control_number_lower_bound: The acknowledgement control number lower + bound. Required. :paramtype acknowledgement_control_number_lower_bound: int - :keyword acknowledgement_control_number_upper_bound: Required. The acknowledgement control - number upper bound. + :keyword acknowledgement_control_number_upper_bound: The acknowledgement control number upper + bound. Required. :paramtype acknowledgement_control_number_upper_bound: int - :keyword rollover_acknowledgement_control_number: Required. The value indicating whether to - rollover acknowledgement control number. + :keyword rollover_acknowledgement_control_number: The value indicating whether to rollover + acknowledgement control number. Required. :paramtype rollover_acknowledgement_control_number: bool """ - super(EdifactAcknowledgementSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.need_technical_acknowledgement = need_technical_acknowledgement self.batch_technical_acknowledgements = batch_technical_acknowledgements self.need_functional_acknowledgement = need_functional_acknowledgement @@ -2472,46 +2402,46 @@ def __init__( self.rollover_acknowledgement_control_number = rollover_acknowledgement_control_number -class EdifactAgreementContent(msrest.serialization.Model): +class EdifactAgreementContent(_serialization.Model): """The Edifact agreement content. All required parameters must be populated in order to send to Azure. - :ivar receive_agreement: Required. The EDIFACT one-way receive agreement. + :ivar receive_agreement: The EDIFACT one-way receive agreement. Required. :vartype receive_agreement: ~azure.mgmt.logic.models.EdifactOneWayAgreement - :ivar send_agreement: Required. The EDIFACT one-way send agreement. + :ivar send_agreement: The EDIFACT one-way send agreement. Required. :vartype send_agreement: ~azure.mgmt.logic.models.EdifactOneWayAgreement """ _validation = { - 'receive_agreement': {'required': True}, - 'send_agreement': {'required': True}, + "receive_agreement": {"required": True}, + "send_agreement": {"required": True}, } _attribute_map = { - 'receive_agreement': {'key': 'receiveAgreement', 'type': 'EdifactOneWayAgreement'}, - 'send_agreement': {'key': 'sendAgreement', 'type': 'EdifactOneWayAgreement'}, + "receive_agreement": {"key": "receiveAgreement", "type": "EdifactOneWayAgreement"}, + "send_agreement": {"key": "sendAgreement", "type": "EdifactOneWayAgreement"}, } def __init__( self, *, - receive_agreement: "EdifactOneWayAgreement", - send_agreement: "EdifactOneWayAgreement", + receive_agreement: "_models.EdifactOneWayAgreement", + send_agreement: "_models.EdifactOneWayAgreement", **kwargs ): """ - :keyword receive_agreement: Required. The EDIFACT one-way receive agreement. + :keyword receive_agreement: The EDIFACT one-way receive agreement. Required. :paramtype receive_agreement: ~azure.mgmt.logic.models.EdifactOneWayAgreement - :keyword send_agreement: Required. The EDIFACT one-way send agreement. + :keyword send_agreement: The EDIFACT one-way send agreement. Required. :paramtype send_agreement: ~azure.mgmt.logic.models.EdifactOneWayAgreement """ - super(EdifactAgreementContent, self).__init__(**kwargs) + super().__init__(**kwargs) self.receive_agreement = receive_agreement self.send_agreement = send_agreement -class EdifactDelimiterOverride(msrest.serialization.Model): +class EdifactDelimiterOverride(_serialization.Model): # pylint: disable=too-many-instance-attributes """The Edifact delimiter override settings. All required parameters must be populated in order to send to Azure. @@ -2522,21 +2452,21 @@ class EdifactDelimiterOverride(msrest.serialization.Model): :vartype message_version: str :ivar message_release: The message release. :vartype message_release: str - :ivar data_element_separator: Required. The data element separator. + :ivar data_element_separator: The data element separator. Required. :vartype data_element_separator: int - :ivar component_separator: Required. The component separator. + :ivar component_separator: The component separator. Required. :vartype component_separator: int - :ivar segment_terminator: Required. The segment terminator. + :ivar segment_terminator: The segment terminator. Required. :vartype segment_terminator: int - :ivar repetition_separator: Required. The repetition separator. + :ivar repetition_separator: The repetition separator. Required. :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: The segment terminator suffix. Required. Known values are: + "NotSpecified", "None", "CR", "LF", and "CRLF". :vartype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix - :ivar decimal_point_indicator: Required. The decimal point indicator. Possible values include: - "NotSpecified", "Comma", "Decimal". + :ivar decimal_point_indicator: The decimal point indicator. Required. Known values are: + "NotSpecified", "Comma", and "Decimal". :vartype decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator - :ivar release_indicator: Required. The release indicator. + :ivar release_indicator: The release indicator. Required. :vartype release_indicator: int :ivar message_association_assigned_code: The message association assigned code. :vartype message_association_assigned_code: str @@ -2546,28 +2476,28 @@ class EdifactDelimiterOverride(msrest.serialization.Model): """ _validation = { - 'data_element_separator': {'required': True}, - 'component_separator': {'required': True}, - 'segment_terminator': {'required': True}, - 'repetition_separator': {'required': True}, - 'segment_terminator_suffix': {'required': True}, - 'decimal_point_indicator': {'required': True}, - 'release_indicator': {'required': True}, + "data_element_separator": {"required": True}, + "component_separator": {"required": True}, + "segment_terminator": {"required": True}, + "repetition_separator": {"required": True}, + "segment_terminator_suffix": {"required": True}, + "decimal_point_indicator": {"required": True}, + "release_indicator": {"required": True}, } _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'message_version': {'key': 'messageVersion', 'type': 'str'}, - 'message_release': {'key': 'messageRelease', 'type': 'str'}, - 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, - 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, - 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, - 'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'}, - 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, - 'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'}, - 'release_indicator': {'key': 'releaseIndicator', 'type': 'int'}, - 'message_association_assigned_code': {'key': 'messageAssociationAssignedCode', 'type': 'str'}, - 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + "message_id": {"key": "messageId", "type": "str"}, + "message_version": {"key": "messageVersion", "type": "str"}, + "message_release": {"key": "messageRelease", "type": "str"}, + "data_element_separator": {"key": "dataElementSeparator", "type": "int"}, + "component_separator": {"key": "componentSeparator", "type": "int"}, + "segment_terminator": {"key": "segmentTerminator", "type": "int"}, + "repetition_separator": {"key": "repetitionSeparator", "type": "int"}, + "segment_terminator_suffix": {"key": "segmentTerminatorSuffix", "type": "str"}, + "decimal_point_indicator": {"key": "decimalPointIndicator", "type": "str"}, + "release_indicator": {"key": "releaseIndicator", "type": "int"}, + "message_association_assigned_code": {"key": "messageAssociationAssignedCode", "type": "str"}, + "target_namespace": {"key": "targetNamespace", "type": "str"}, } def __init__( @@ -2577,8 +2507,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, @@ -2594,21 +2524,21 @@ def __init__( :paramtype message_version: str :keyword message_release: The message release. :paramtype message_release: str - :keyword data_element_separator: Required. The data element separator. + :keyword data_element_separator: The data element separator. Required. :paramtype data_element_separator: int - :keyword component_separator: Required. The component separator. + :keyword component_separator: The component separator. Required. :paramtype component_separator: int - :keyword segment_terminator: Required. The segment terminator. + :keyword segment_terminator: The segment terminator. Required. :paramtype segment_terminator: int - :keyword repetition_separator: Required. The repetition separator. + :keyword repetition_separator: The repetition separator. Required. :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: The segment terminator suffix. Required. Known values are: + "NotSpecified", "None", "CR", "LF", and "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: The decimal point indicator. Required. Known values are: + "NotSpecified", "Comma", and "Decimal". :paramtype decimal_point_indicator: str or ~azure.mgmt.logic.models.EdifactDecimalIndicator - :keyword release_indicator: Required. The release indicator. + :keyword release_indicator: The release indicator. Required. :paramtype release_indicator: int :keyword message_association_assigned_code: The message association assigned code. :paramtype message_association_assigned_code: str @@ -2616,7 +2546,7 @@ def __init__( applied. :paramtype target_namespace: str """ - super(EdifactDelimiterOverride, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_id = message_id self.message_version = message_version self.message_release = message_release @@ -2631,7 +2561,7 @@ def __init__( self.target_namespace = target_namespace -class EdifactEnvelopeOverride(msrest.serialization.Model): +class EdifactEnvelopeOverride(_serialization.Model): # pylint: disable=too-many-instance-attributes """The Edifact envelope override settings. :ivar message_id: The message id on which this envelope settings has to be applied. @@ -2668,21 +2598,21 @@ class EdifactEnvelopeOverride(msrest.serialization.Model): """ _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'message_version': {'key': 'messageVersion', 'type': 'str'}, - 'message_release': {'key': 'messageRelease', 'type': 'str'}, - 'message_association_assigned_code': {'key': 'messageAssociationAssignedCode', 'type': 'str'}, - 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, - 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, - 'sender_application_qualifier': {'key': 'senderApplicationQualifier', 'type': 'str'}, - 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, - 'receiver_application_qualifier': {'key': 'receiverApplicationQualifier', 'type': 'str'}, - 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, - 'controlling_agency_code': {'key': 'controllingAgencyCode', 'type': 'str'}, - 'group_header_message_version': {'key': 'groupHeaderMessageVersion', 'type': 'str'}, - 'group_header_message_release': {'key': 'groupHeaderMessageRelease', 'type': 'str'}, - 'association_assigned_code': {'key': 'associationAssignedCode', 'type': 'str'}, - 'application_password': {'key': 'applicationPassword', 'type': 'str'}, + "message_id": {"key": "messageId", "type": "str"}, + "message_version": {"key": "messageVersion", "type": "str"}, + "message_release": {"key": "messageRelease", "type": "str"}, + "message_association_assigned_code": {"key": "messageAssociationAssignedCode", "type": "str"}, + "target_namespace": {"key": "targetNamespace", "type": "str"}, + "functional_group_id": {"key": "functionalGroupId", "type": "str"}, + "sender_application_qualifier": {"key": "senderApplicationQualifier", "type": "str"}, + "sender_application_id": {"key": "senderApplicationId", "type": "str"}, + "receiver_application_qualifier": {"key": "receiverApplicationQualifier", "type": "str"}, + "receiver_application_id": {"key": "receiverApplicationId", "type": "str"}, + "controlling_agency_code": {"key": "controllingAgencyCode", "type": "str"}, + "group_header_message_version": {"key": "groupHeaderMessageVersion", "type": "str"}, + "group_header_message_release": {"key": "groupHeaderMessageRelease", "type": "str"}, + "association_assigned_code": {"key": "associationAssignedCode", "type": "str"}, + "application_password": {"key": "applicationPassword", "type": "str"}, } def __init__( @@ -2740,7 +2670,7 @@ def __init__( :keyword application_password: The application password. :paramtype application_password: str """ - super(EdifactEnvelopeOverride, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_id = message_id self.message_version = message_version self.message_release = message_release @@ -2758,7 +2688,7 @@ def __init__( self.application_password = application_password -class EdifactEnvelopeSettings(msrest.serialization.Model): +class EdifactEnvelopeSettings(_serialization.Model): # pylint: disable=too-many-instance-attributes """The Edifact agreement envelope settings. All required parameters must be populated in order to send to Azure. @@ -2767,14 +2697,14 @@ class EdifactEnvelopeSettings(msrest.serialization.Model): :vartype group_association_assigned_code: str :ivar communication_agreement_id: The communication agreement id. :vartype communication_agreement_id: str - :ivar apply_delimiter_string_advice: Required. The value indicating whether to apply delimiter - string advice. + :ivar apply_delimiter_string_advice: The value indicating whether to apply delimiter string + advice. Required. :vartype apply_delimiter_string_advice: bool - :ivar create_grouping_segments: Required. The value indicating whether to create grouping - segments. + :ivar create_grouping_segments: The value indicating whether to create grouping segments. + Required. :vartype create_grouping_segments: bool - :ivar enable_default_group_headers: Required. The value indicating whether to enable default - group headers. + :ivar enable_default_group_headers: The value indicating whether to enable default group + headers. Required. :vartype enable_default_group_headers: bool :ivar recipient_reference_password_value: The recipient reference password value. :vartype recipient_reference_password_value: str @@ -2784,14 +2714,14 @@ class EdifactEnvelopeSettings(msrest.serialization.Model): :vartype application_reference_id: str :ivar processing_priority_code: The processing priority code. :vartype processing_priority_code: str - :ivar interchange_control_number_lower_bound: Required. The interchange control number lower - bound. - :vartype interchange_control_number_lower_bound: long - :ivar interchange_control_number_upper_bound: Required. The interchange control number upper - bound. - :vartype interchange_control_number_upper_bound: long - :ivar rollover_interchange_control_number: Required. The value indicating whether to rollover - interchange control number. + :ivar interchange_control_number_lower_bound: The interchange control number lower bound. + Required. + :vartype interchange_control_number_lower_bound: int + :ivar interchange_control_number_upper_bound: The interchange control number upper bound. + Required. + :vartype interchange_control_number_upper_bound: int + :ivar rollover_interchange_control_number: The value indicating whether to rollover interchange + control number. Required. :vartype rollover_interchange_control_number: bool :ivar interchange_control_number_prefix: The interchange control number prefix. :vartype interchange_control_number_prefix: str @@ -2809,12 +2739,12 @@ class EdifactEnvelopeSettings(msrest.serialization.Model): :vartype group_message_version: str :ivar group_message_release: The group message release. :vartype group_message_release: str - :ivar group_control_number_lower_bound: Required. The group control number lower bound. - :vartype group_control_number_lower_bound: long - :ivar group_control_number_upper_bound: Required. The group control number upper bound. - :vartype group_control_number_upper_bound: long - :ivar rollover_group_control_number: Required. The value indicating whether to rollover group - control number. + :ivar group_control_number_lower_bound: The group control number lower bound. Required. + :vartype group_control_number_lower_bound: int + :ivar group_control_number_upper_bound: The group control number upper bound. Required. + :vartype group_control_number_upper_bound: int + :ivar rollover_group_control_number: The value indicating whether to rollover group control + number. Required. :vartype rollover_group_control_number: bool :ivar group_control_number_prefix: The group control number prefix. :vartype group_control_number_prefix: str @@ -2830,24 +2760,24 @@ class EdifactEnvelopeSettings(msrest.serialization.Model): :vartype group_application_sender_id: str :ivar group_application_password: The group application password. :vartype group_application_password: str - :ivar overwrite_existing_transaction_set_control_number: Required. The value indicating whether - to overwrite existing transaction set control number. + :ivar overwrite_existing_transaction_set_control_number: The value indicating whether to + overwrite existing transaction set control number. Required. :vartype overwrite_existing_transaction_set_control_number: bool :ivar transaction_set_control_number_prefix: The transaction set control number prefix. :vartype transaction_set_control_number_prefix: str :ivar transaction_set_control_number_suffix: The transaction set control number suffix. :vartype transaction_set_control_number_suffix: str - :ivar transaction_set_control_number_lower_bound: Required. The transaction set control number - lower bound. - :vartype transaction_set_control_number_lower_bound: long - :ivar transaction_set_control_number_upper_bound: Required. The transaction set control number - upper bound. - :vartype transaction_set_control_number_upper_bound: long - :ivar rollover_transaction_set_control_number: Required. The value indicating whether to - rollover transaction set control number. + :ivar transaction_set_control_number_lower_bound: The transaction set control number lower + bound. Required. + :vartype transaction_set_control_number_lower_bound: int + :ivar transaction_set_control_number_upper_bound: The transaction set control number upper + bound. Required. + :vartype transaction_set_control_number_upper_bound: int + :ivar rollover_transaction_set_control_number: The value indicating whether to rollover + transaction set control number. Required. :vartype rollover_transaction_set_control_number: bool - :ivar is_test_interchange: Required. The value indicating whether the message is a test - interchange. + :ivar is_test_interchange: The value indicating whether the message is a test interchange. + Required. :vartype is_test_interchange: bool :ivar sender_internal_identification: The sender internal identification. :vartype sender_internal_identification: str @@ -2860,67 +2790,70 @@ class EdifactEnvelopeSettings(msrest.serialization.Model): """ _validation = { - 'apply_delimiter_string_advice': {'required': True}, - 'create_grouping_segments': {'required': True}, - 'enable_default_group_headers': {'required': True}, - 'interchange_control_number_lower_bound': {'required': True}, - 'interchange_control_number_upper_bound': {'required': True}, - 'rollover_interchange_control_number': {'required': True}, - 'group_control_number_lower_bound': {'required': True}, - 'group_control_number_upper_bound': {'required': True}, - 'rollover_group_control_number': {'required': True}, - 'overwrite_existing_transaction_set_control_number': {'required': True}, - 'transaction_set_control_number_lower_bound': {'required': True}, - 'transaction_set_control_number_upper_bound': {'required': True}, - 'rollover_transaction_set_control_number': {'required': True}, - 'is_test_interchange': {'required': True}, - } - - _attribute_map = { - 'group_association_assigned_code': {'key': 'groupAssociationAssignedCode', 'type': 'str'}, - 'communication_agreement_id': {'key': 'communicationAgreementId', 'type': 'str'}, - 'apply_delimiter_string_advice': {'key': 'applyDelimiterStringAdvice', 'type': 'bool'}, - 'create_grouping_segments': {'key': 'createGroupingSegments', 'type': 'bool'}, - 'enable_default_group_headers': {'key': 'enableDefaultGroupHeaders', 'type': 'bool'}, - 'recipient_reference_password_value': {'key': 'recipientReferencePasswordValue', 'type': 'str'}, - 'recipient_reference_password_qualifier': {'key': 'recipientReferencePasswordQualifier', 'type': 'str'}, - 'application_reference_id': {'key': 'applicationReferenceId', 'type': 'str'}, - 'processing_priority_code': {'key': 'processingPriorityCode', 'type': 'str'}, - 'interchange_control_number_lower_bound': {'key': 'interchangeControlNumberLowerBound', 'type': 'long'}, - 'interchange_control_number_upper_bound': {'key': 'interchangeControlNumberUpperBound', 'type': 'long'}, - 'rollover_interchange_control_number': {'key': 'rolloverInterchangeControlNumber', 'type': 'bool'}, - 'interchange_control_number_prefix': {'key': 'interchangeControlNumberPrefix', 'type': 'str'}, - 'interchange_control_number_suffix': {'key': 'interchangeControlNumberSuffix', 'type': 'str'}, - 'sender_reverse_routing_address': {'key': 'senderReverseRoutingAddress', 'type': 'str'}, - 'receiver_reverse_routing_address': {'key': 'receiverReverseRoutingAddress', 'type': 'str'}, - 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, - 'group_controlling_agency_code': {'key': 'groupControllingAgencyCode', 'type': 'str'}, - 'group_message_version': {'key': 'groupMessageVersion', 'type': 'str'}, - 'group_message_release': {'key': 'groupMessageRelease', 'type': 'str'}, - 'group_control_number_lower_bound': {'key': 'groupControlNumberLowerBound', 'type': 'long'}, - 'group_control_number_upper_bound': {'key': 'groupControlNumberUpperBound', 'type': 'long'}, - 'rollover_group_control_number': {'key': 'rolloverGroupControlNumber', 'type': 'bool'}, - 'group_control_number_prefix': {'key': 'groupControlNumberPrefix', 'type': 'str'}, - 'group_control_number_suffix': {'key': 'groupControlNumberSuffix', 'type': 'str'}, - 'group_application_receiver_qualifier': {'key': 'groupApplicationReceiverQualifier', 'type': 'str'}, - 'group_application_receiver_id': {'key': 'groupApplicationReceiverId', 'type': 'str'}, - 'group_application_sender_qualifier': {'key': 'groupApplicationSenderQualifier', 'type': 'str'}, - 'group_application_sender_id': {'key': 'groupApplicationSenderId', 'type': 'str'}, - 'group_application_password': {'key': 'groupApplicationPassword', 'type': 'str'}, - 'overwrite_existing_transaction_set_control_number': {'key': 'overwriteExistingTransactionSetControlNumber', 'type': 'bool'}, - 'transaction_set_control_number_prefix': {'key': 'transactionSetControlNumberPrefix', 'type': 'str'}, - 'transaction_set_control_number_suffix': {'key': 'transactionSetControlNumberSuffix', 'type': 'str'}, - 'transaction_set_control_number_lower_bound': {'key': 'transactionSetControlNumberLowerBound', 'type': 'long'}, - 'transaction_set_control_number_upper_bound': {'key': 'transactionSetControlNumberUpperBound', 'type': 'long'}, - 'rollover_transaction_set_control_number': {'key': 'rolloverTransactionSetControlNumber', 'type': 'bool'}, - 'is_test_interchange': {'key': 'isTestInterchange', 'type': 'bool'}, - 'sender_internal_identification': {'key': 'senderInternalIdentification', 'type': 'str'}, - 'sender_internal_sub_identification': {'key': 'senderInternalSubIdentification', 'type': 'str'}, - 'receiver_internal_identification': {'key': 'receiverInternalIdentification', 'type': 'str'}, - 'receiver_internal_sub_identification': {'key': 'receiverInternalSubIdentification', 'type': 'str'}, - } - - def __init__( + "apply_delimiter_string_advice": {"required": True}, + "create_grouping_segments": {"required": True}, + "enable_default_group_headers": {"required": True}, + "interchange_control_number_lower_bound": {"required": True}, + "interchange_control_number_upper_bound": {"required": True}, + "rollover_interchange_control_number": {"required": True}, + "group_control_number_lower_bound": {"required": True}, + "group_control_number_upper_bound": {"required": True}, + "rollover_group_control_number": {"required": True}, + "overwrite_existing_transaction_set_control_number": {"required": True}, + "transaction_set_control_number_lower_bound": {"required": True}, + "transaction_set_control_number_upper_bound": {"required": True}, + "rollover_transaction_set_control_number": {"required": True}, + "is_test_interchange": {"required": True}, + } + + _attribute_map = { + "group_association_assigned_code": {"key": "groupAssociationAssignedCode", "type": "str"}, + "communication_agreement_id": {"key": "communicationAgreementId", "type": "str"}, + "apply_delimiter_string_advice": {"key": "applyDelimiterStringAdvice", "type": "bool"}, + "create_grouping_segments": {"key": "createGroupingSegments", "type": "bool"}, + "enable_default_group_headers": {"key": "enableDefaultGroupHeaders", "type": "bool"}, + "recipient_reference_password_value": {"key": "recipientReferencePasswordValue", "type": "str"}, + "recipient_reference_password_qualifier": {"key": "recipientReferencePasswordQualifier", "type": "str"}, + "application_reference_id": {"key": "applicationReferenceId", "type": "str"}, + "processing_priority_code": {"key": "processingPriorityCode", "type": "str"}, + "interchange_control_number_lower_bound": {"key": "interchangeControlNumberLowerBound", "type": "int"}, + "interchange_control_number_upper_bound": {"key": "interchangeControlNumberUpperBound", "type": "int"}, + "rollover_interchange_control_number": {"key": "rolloverInterchangeControlNumber", "type": "bool"}, + "interchange_control_number_prefix": {"key": "interchangeControlNumberPrefix", "type": "str"}, + "interchange_control_number_suffix": {"key": "interchangeControlNumberSuffix", "type": "str"}, + "sender_reverse_routing_address": {"key": "senderReverseRoutingAddress", "type": "str"}, + "receiver_reverse_routing_address": {"key": "receiverReverseRoutingAddress", "type": "str"}, + "functional_group_id": {"key": "functionalGroupId", "type": "str"}, + "group_controlling_agency_code": {"key": "groupControllingAgencyCode", "type": "str"}, + "group_message_version": {"key": "groupMessageVersion", "type": "str"}, + "group_message_release": {"key": "groupMessageRelease", "type": "str"}, + "group_control_number_lower_bound": {"key": "groupControlNumberLowerBound", "type": "int"}, + "group_control_number_upper_bound": {"key": "groupControlNumberUpperBound", "type": "int"}, + "rollover_group_control_number": {"key": "rolloverGroupControlNumber", "type": "bool"}, + "group_control_number_prefix": {"key": "groupControlNumberPrefix", "type": "str"}, + "group_control_number_suffix": {"key": "groupControlNumberSuffix", "type": "str"}, + "group_application_receiver_qualifier": {"key": "groupApplicationReceiverQualifier", "type": "str"}, + "group_application_receiver_id": {"key": "groupApplicationReceiverId", "type": "str"}, + "group_application_sender_qualifier": {"key": "groupApplicationSenderQualifier", "type": "str"}, + "group_application_sender_id": {"key": "groupApplicationSenderId", "type": "str"}, + "group_application_password": {"key": "groupApplicationPassword", "type": "str"}, + "overwrite_existing_transaction_set_control_number": { + "key": "overwriteExistingTransactionSetControlNumber", + "type": "bool", + }, + "transaction_set_control_number_prefix": {"key": "transactionSetControlNumberPrefix", "type": "str"}, + "transaction_set_control_number_suffix": {"key": "transactionSetControlNumberSuffix", "type": "str"}, + "transaction_set_control_number_lower_bound": {"key": "transactionSetControlNumberLowerBound", "type": "int"}, + "transaction_set_control_number_upper_bound": {"key": "transactionSetControlNumberUpperBound", "type": "int"}, + "rollover_transaction_set_control_number": {"key": "rolloverTransactionSetControlNumber", "type": "bool"}, + "is_test_interchange": {"key": "isTestInterchange", "type": "bool"}, + "sender_internal_identification": {"key": "senderInternalIdentification", "type": "str"}, + "sender_internal_sub_identification": {"key": "senderInternalSubIdentification", "type": "str"}, + "receiver_internal_identification": {"key": "receiverInternalIdentification", "type": "str"}, + "receiver_internal_sub_identification": {"key": "receiverInternalSubIdentification", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals self, *, apply_delimiter_string_advice: bool, @@ -2971,14 +2904,14 @@ def __init__( :paramtype group_association_assigned_code: str :keyword communication_agreement_id: The communication agreement id. :paramtype communication_agreement_id: str - :keyword apply_delimiter_string_advice: Required. The value indicating whether to apply - delimiter string advice. + :keyword apply_delimiter_string_advice: The value indicating whether to apply delimiter string + advice. Required. :paramtype apply_delimiter_string_advice: bool - :keyword create_grouping_segments: Required. The value indicating whether to create grouping - segments. + :keyword create_grouping_segments: The value indicating whether to create grouping segments. + Required. :paramtype create_grouping_segments: bool - :keyword enable_default_group_headers: Required. The value indicating whether to enable default - group headers. + :keyword enable_default_group_headers: The value indicating whether to enable default group + headers. Required. :paramtype enable_default_group_headers: bool :keyword recipient_reference_password_value: The recipient reference password value. :paramtype recipient_reference_password_value: str @@ -2988,14 +2921,14 @@ def __init__( :paramtype application_reference_id: str :keyword processing_priority_code: The processing priority code. :paramtype processing_priority_code: str - :keyword interchange_control_number_lower_bound: Required. The interchange control number lower - bound. - :paramtype interchange_control_number_lower_bound: long - :keyword interchange_control_number_upper_bound: Required. The interchange control number upper - bound. - :paramtype interchange_control_number_upper_bound: long - :keyword rollover_interchange_control_number: Required. The value indicating whether to - rollover interchange control number. + :keyword interchange_control_number_lower_bound: The interchange control number lower bound. + Required. + :paramtype interchange_control_number_lower_bound: int + :keyword interchange_control_number_upper_bound: The interchange control number upper bound. + Required. + :paramtype interchange_control_number_upper_bound: int + :keyword rollover_interchange_control_number: The value indicating whether to rollover + interchange control number. Required. :paramtype rollover_interchange_control_number: bool :keyword interchange_control_number_prefix: The interchange control number prefix. :paramtype interchange_control_number_prefix: str @@ -3013,12 +2946,12 @@ def __init__( :paramtype group_message_version: str :keyword group_message_release: The group message release. :paramtype group_message_release: str - :keyword group_control_number_lower_bound: Required. The group control number lower bound. - :paramtype group_control_number_lower_bound: long - :keyword group_control_number_upper_bound: Required. The group control number upper bound. - :paramtype group_control_number_upper_bound: long - :keyword rollover_group_control_number: Required. The value indicating whether to rollover - group control number. + :keyword group_control_number_lower_bound: The group control number lower bound. Required. + :paramtype group_control_number_lower_bound: int + :keyword group_control_number_upper_bound: The group control number upper bound. Required. + :paramtype group_control_number_upper_bound: int + :keyword rollover_group_control_number: The value indicating whether to rollover group control + number. Required. :paramtype rollover_group_control_number: bool :keyword group_control_number_prefix: The group control number prefix. :paramtype group_control_number_prefix: str @@ -3034,24 +2967,24 @@ def __init__( :paramtype group_application_sender_id: str :keyword group_application_password: The group application password. :paramtype group_application_password: str - :keyword overwrite_existing_transaction_set_control_number: Required. The value indicating - whether to overwrite existing transaction set control number. + :keyword overwrite_existing_transaction_set_control_number: The value indicating whether to + overwrite existing transaction set control number. Required. :paramtype overwrite_existing_transaction_set_control_number: bool :keyword transaction_set_control_number_prefix: The transaction set control number prefix. :paramtype transaction_set_control_number_prefix: str :keyword transaction_set_control_number_suffix: The transaction set control number suffix. :paramtype transaction_set_control_number_suffix: str - :keyword transaction_set_control_number_lower_bound: Required. The transaction set control - number lower bound. - :paramtype transaction_set_control_number_lower_bound: long - :keyword transaction_set_control_number_upper_bound: Required. The transaction set control - number upper bound. - :paramtype transaction_set_control_number_upper_bound: long - :keyword rollover_transaction_set_control_number: Required. The value indicating whether to - rollover transaction set control number. + :keyword transaction_set_control_number_lower_bound: The transaction set control number lower + bound. Required. + :paramtype transaction_set_control_number_lower_bound: int + :keyword transaction_set_control_number_upper_bound: The transaction set control number upper + bound. Required. + :paramtype transaction_set_control_number_upper_bound: int + :keyword rollover_transaction_set_control_number: The value indicating whether to rollover + transaction set control number. Required. :paramtype rollover_transaction_set_control_number: bool - :keyword is_test_interchange: Required. The value indicating whether the message is a test - interchange. + :keyword is_test_interchange: The value indicating whether the message is a test interchange. + Required. :paramtype is_test_interchange: bool :keyword sender_internal_identification: The sender internal identification. :paramtype sender_internal_identification: str @@ -3062,7 +2995,7 @@ def __init__( :keyword receiver_internal_sub_identification: The receiver internal sub identification. :paramtype receiver_internal_sub_identification: str """ - super(EdifactEnvelopeSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.group_association_assigned_code = group_association_assigned_code self.communication_agreement_id = communication_agreement_id self.apply_delimiter_string_advice = apply_delimiter_string_advice @@ -3106,7 +3039,7 @@ def __init__( self.receiver_internal_sub_identification = receiver_internal_sub_identification -class EdifactFramingSettings(msrest.serialization.Model): +class EdifactFramingSettings(_serialization.Model): # pylint: disable=too-many-instance-attributes """The Edifact agreement framing settings. All required parameters must be populated in order to send to Azure. @@ -3115,54 +3048,54 @@ class EdifactFramingSettings(msrest.serialization.Model): :vartype service_code_list_directory_version: str :ivar character_encoding: The character encoding. :vartype character_encoding: str - :ivar protocol_version: Required. The protocol version. + :ivar protocol_version: The protocol version. Required. :vartype protocol_version: int - :ivar data_element_separator: Required. The data element separator. + :ivar data_element_separator: The data element separator. Required. :vartype data_element_separator: int - :ivar component_separator: Required. The component separator. + :ivar component_separator: The component separator. Required. :vartype component_separator: int - :ivar segment_terminator: Required. The segment terminator. + :ivar segment_terminator: The segment terminator. Required. :vartype segment_terminator: int - :ivar release_indicator: Required. The release indicator. + :ivar release_indicator: The release indicator. Required. :vartype release_indicator: int - :ivar repetition_separator: Required. The repetition separator. + :ivar repetition_separator: The repetition separator. Required. :vartype repetition_separator: int - :ivar character_set: Required. The EDIFACT frame setting characterSet. Possible values include: + :ivar character_set: The EDIFACT frame setting characterSet. Required. Known values are: "NotSpecified", "UNOB", "UNOA", "UNOC", "UNOD", "UNOE", "UNOF", "UNOG", "UNOH", "UNOI", "UNOJ", - "UNOK", "UNOX", "UNOY", "KECA". + "UNOK", "UNOX", "UNOY", and "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: The EDIFACT frame setting decimal indicator. Required. Known + values are: "NotSpecified", "Comma", and "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". + :ivar segment_terminator_suffix: The EDIFACT frame setting segment terminator suffix. Required. + Known values are: "NotSpecified", "None", "CR", "LF", and "CRLF". :vartype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix """ _validation = { - 'protocol_version': {'required': True}, - 'data_element_separator': {'required': True}, - 'component_separator': {'required': True}, - 'segment_terminator': {'required': True}, - 'release_indicator': {'required': True}, - 'repetition_separator': {'required': True}, - 'character_set': {'required': True}, - 'decimal_point_indicator': {'required': True}, - 'segment_terminator_suffix': {'required': True}, + "protocol_version": {"required": True}, + "data_element_separator": {"required": True}, + "component_separator": {"required": True}, + "segment_terminator": {"required": True}, + "release_indicator": {"required": True}, + "repetition_separator": {"required": True}, + "character_set": {"required": True}, + "decimal_point_indicator": {"required": True}, + "segment_terminator_suffix": {"required": True}, } _attribute_map = { - 'service_code_list_directory_version': {'key': 'serviceCodeListDirectoryVersion', 'type': 'str'}, - 'character_encoding': {'key': 'characterEncoding', 'type': 'str'}, - 'protocol_version': {'key': 'protocolVersion', 'type': 'int'}, - 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, - 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, - 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, - 'release_indicator': {'key': 'releaseIndicator', 'type': 'int'}, - 'repetition_separator': {'key': 'repetitionSeparator', 'type': 'int'}, - 'character_set': {'key': 'characterSet', 'type': 'str'}, - 'decimal_point_indicator': {'key': 'decimalPointIndicator', 'type': 'str'}, - 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + "service_code_list_directory_version": {"key": "serviceCodeListDirectoryVersion", "type": "str"}, + "character_encoding": {"key": "characterEncoding", "type": "str"}, + "protocol_version": {"key": "protocolVersion", "type": "int"}, + "data_element_separator": {"key": "dataElementSeparator", "type": "int"}, + "component_separator": {"key": "componentSeparator", "type": "int"}, + "segment_terminator": {"key": "segmentTerminator", "type": "int"}, + "release_indicator": {"key": "releaseIndicator", "type": "int"}, + "repetition_separator": {"key": "repetitionSeparator", "type": "int"}, + "character_set": {"key": "characterSet", "type": "str"}, + "decimal_point_indicator": {"key": "decimalPointIndicator", "type": "str"}, + "segment_terminator_suffix": {"key": "segmentTerminatorSuffix", "type": "str"}, } def __init__( @@ -3174,9 +3107,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 @@ -3186,30 +3119,30 @@ def __init__( :paramtype service_code_list_directory_version: str :keyword character_encoding: The character encoding. :paramtype character_encoding: str - :keyword protocol_version: Required. The protocol version. + :keyword protocol_version: The protocol version. Required. :paramtype protocol_version: int - :keyword data_element_separator: Required. The data element separator. + :keyword data_element_separator: The data element separator. Required. :paramtype data_element_separator: int - :keyword component_separator: Required. The component separator. + :keyword component_separator: The component separator. Required. :paramtype component_separator: int - :keyword segment_terminator: Required. The segment terminator. + :keyword segment_terminator: The segment terminator. Required. :paramtype segment_terminator: int - :keyword release_indicator: Required. The release indicator. + :keyword release_indicator: The release indicator. Required. :paramtype release_indicator: int - :keyword repetition_separator: Required. The repetition separator. + :keyword repetition_separator: The repetition separator. Required. :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: The EDIFACT frame setting characterSet. Required. Known values are: + "NotSpecified", "UNOB", "UNOA", "UNOC", "UNOD", "UNOE", "UNOF", "UNOG", "UNOH", "UNOI", "UNOJ", + "UNOK", "UNOX", "UNOY", and "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: The EDIFACT frame setting decimal indicator. Required. Known + values are: "NotSpecified", "Comma", and "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". + :keyword segment_terminator_suffix: The EDIFACT frame setting segment terminator suffix. + Required. Known values are: "NotSpecified", "None", "CR", "LF", and "CRLF". :paramtype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix """ - super(EdifactFramingSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.service_code_list_directory_version = service_code_list_directory_version self.character_encoding = character_encoding self.protocol_version = protocol_version @@ -3223,152 +3156,145 @@ def __init__( self.segment_terminator_suffix = segment_terminator_suffix -class EdifactMessageFilter(msrest.serialization.Model): +class EdifactMessageFilter(_serialization.Model): """The Edifact message filter for odata query. 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: The message filter type. Required. Known values are: "NotSpecified", + "Include", and "Exclude". :vartype message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType """ _validation = { - 'message_filter_type': {'required': True}, + "message_filter_type": {"required": True}, } _attribute_map = { - 'message_filter_type': {'key': 'messageFilterType', 'type': 'str'}, + "message_filter_type": {"key": "messageFilterType", "type": "str"}, } - def __init__( - self, - *, - message_filter_type: Union[str, "MessageFilterType"], - **kwargs - ): + def __init__(self, *, message_filter_type: Union[str, "_models.MessageFilterType"], **kwargs): """ - :keyword message_filter_type: Required. The message filter type. Possible values include: - "NotSpecified", "Include", "Exclude". + :keyword message_filter_type: The message filter type. Required. Known values are: + "NotSpecified", "Include", and "Exclude". :paramtype message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType """ - super(EdifactMessageFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_filter_type = message_filter_type -class EdifactMessageIdentifier(msrest.serialization.Model): +class EdifactMessageIdentifier(_serialization.Model): """The Edifact message identifier. All required parameters must be populated in order to send to Azure. - :ivar message_id: Required. The message id on which this envelope settings has to be applied. + :ivar message_id: The message id on which this envelope settings has to be applied. Required. :vartype message_id: str """ _validation = { - 'message_id': {'required': True}, + "message_id": {"required": True}, } _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, + "message_id": {"key": "messageId", "type": "str"}, } - def __init__( - self, - *, - message_id: str, - **kwargs - ): + def __init__(self, *, message_id: str, **kwargs): """ - :keyword message_id: Required. The message id on which this envelope settings has to be - applied. + :keyword message_id: The message id on which this envelope settings has to be applied. + Required. :paramtype message_id: str """ - super(EdifactMessageIdentifier, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_id = message_id -class EdifactOneWayAgreement(msrest.serialization.Model): +class EdifactOneWayAgreement(_serialization.Model): """The Edifact one way agreement. All required parameters must be populated in order to send to Azure. - :ivar sender_business_identity: Required. The sender business identity. + :ivar sender_business_identity: The sender business identity. Required. :vartype sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :ivar receiver_business_identity: Required. The receiver business identity. + :ivar receiver_business_identity: The receiver business identity. Required. :vartype receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :ivar protocol_settings: Required. The EDIFACT protocol settings. + :ivar protocol_settings: The EDIFACT protocol settings. Required. :vartype protocol_settings: ~azure.mgmt.logic.models.EdifactProtocolSettings """ _validation = { - 'sender_business_identity': {'required': True}, - 'receiver_business_identity': {'required': True}, - 'protocol_settings': {'required': True}, + "sender_business_identity": {"required": True}, + "receiver_business_identity": {"required": True}, + "protocol_settings": {"required": True}, } _attribute_map = { - 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, - 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, - 'protocol_settings': {'key': 'protocolSettings', 'type': 'EdifactProtocolSettings'}, + "sender_business_identity": {"key": "senderBusinessIdentity", "type": "BusinessIdentity"}, + "receiver_business_identity": {"key": "receiverBusinessIdentity", "type": "BusinessIdentity"}, + "protocol_settings": {"key": "protocolSettings", "type": "EdifactProtocolSettings"}, } 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 ): """ - :keyword sender_business_identity: Required. The sender business identity. + :keyword sender_business_identity: The sender business identity. Required. :paramtype sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :keyword receiver_business_identity: Required. The receiver business identity. + :keyword receiver_business_identity: The receiver business identity. Required. :paramtype receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :keyword protocol_settings: Required. The EDIFACT protocol settings. + :keyword protocol_settings: The EDIFACT protocol settings. Required. :paramtype protocol_settings: ~azure.mgmt.logic.models.EdifactProtocolSettings """ - super(EdifactOneWayAgreement, self).__init__(**kwargs) + super().__init__(**kwargs) self.sender_business_identity = sender_business_identity self.receiver_business_identity = receiver_business_identity self.protocol_settings = protocol_settings -class EdifactProcessingSettings(msrest.serialization.Model): +class EdifactProcessingSettings(_serialization.Model): """The Edifact agreement protocol settings. All required parameters must be populated in order to send to Azure. - :ivar mask_security_info: Required. The value indicating whether to mask security information. + :ivar mask_security_info: The value indicating whether to mask security information. Required. :vartype mask_security_info: bool - :ivar preserve_interchange: Required. The value indicating whether to preserve interchange. + :ivar preserve_interchange: The value indicating whether to preserve interchange. Required. :vartype preserve_interchange: bool - :ivar suspend_interchange_on_error: Required. The value indicating whether to suspend - interchange on error. + :ivar suspend_interchange_on_error: The value indicating whether to suspend interchange on + error. Required. :vartype suspend_interchange_on_error: bool - :ivar create_empty_xml_tags_for_trailing_separators: Required. The value indicating whether to - create empty xml tags for trailing separators. + :ivar create_empty_xml_tags_for_trailing_separators: The value indicating whether to create + empty xml tags for trailing separators. Required. :vartype create_empty_xml_tags_for_trailing_separators: bool - :ivar use_dot_as_decimal_separator: Required. The value indicating whether to use dot as - decimal separator. + :ivar use_dot_as_decimal_separator: The value indicating whether to use dot as decimal + separator. Required. :vartype use_dot_as_decimal_separator: bool """ _validation = { - 'mask_security_info': {'required': True}, - 'preserve_interchange': {'required': True}, - 'suspend_interchange_on_error': {'required': True}, - 'create_empty_xml_tags_for_trailing_separators': {'required': True}, - 'use_dot_as_decimal_separator': {'required': True}, + "mask_security_info": {"required": True}, + "preserve_interchange": {"required": True}, + "suspend_interchange_on_error": {"required": True}, + "create_empty_xml_tags_for_trailing_separators": {"required": True}, + "use_dot_as_decimal_separator": {"required": True}, } _attribute_map = { - 'mask_security_info': {'key': 'maskSecurityInfo', 'type': 'bool'}, - 'preserve_interchange': {'key': 'preserveInterchange', 'type': 'bool'}, - 'suspend_interchange_on_error': {'key': 'suspendInterchangeOnError', 'type': 'bool'}, - 'create_empty_xml_tags_for_trailing_separators': {'key': 'createEmptyXmlTagsForTrailingSeparators', 'type': 'bool'}, - 'use_dot_as_decimal_separator': {'key': 'useDotAsDecimalSeparator', 'type': 'bool'}, + "mask_security_info": {"key": "maskSecurityInfo", "type": "bool"}, + "preserve_interchange": {"key": "preserveInterchange", "type": "bool"}, + "suspend_interchange_on_error": {"key": "suspendInterchangeOnError", "type": "bool"}, + "create_empty_xml_tags_for_trailing_separators": { + "key": "createEmptyXmlTagsForTrailingSeparators", + "type": "bool", + }, + "use_dot_as_decimal_separator": {"key": "useDotAsDecimalSeparator", "type": "bool"}, } def __init__( @@ -3382,22 +3308,22 @@ def __init__( **kwargs ): """ - :keyword mask_security_info: Required. The value indicating whether to mask security - information. + :keyword mask_security_info: The value indicating whether to mask security information. + Required. :paramtype mask_security_info: bool - :keyword preserve_interchange: Required. The value indicating whether to preserve interchange. + :keyword preserve_interchange: The value indicating whether to preserve interchange. Required. :paramtype preserve_interchange: bool - :keyword suspend_interchange_on_error: Required. The value indicating whether to suspend - interchange on error. + :keyword suspend_interchange_on_error: The value indicating whether to suspend interchange on + error. Required. :paramtype suspend_interchange_on_error: bool - :keyword create_empty_xml_tags_for_trailing_separators: Required. The value indicating whether - to create empty xml tags for trailing separators. + :keyword create_empty_xml_tags_for_trailing_separators: The value indicating whether to create + empty xml tags for trailing separators. Required. :paramtype create_empty_xml_tags_for_trailing_separators: bool - :keyword use_dot_as_decimal_separator: Required. The value indicating whether to use dot as - decimal separator. + :keyword use_dot_as_decimal_separator: The value indicating whether to use dot as decimal + separator. Required. :paramtype use_dot_as_decimal_separator: bool """ - super(EdifactProcessingSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.mask_security_info = mask_security_info self.preserve_interchange = preserve_interchange self.suspend_interchange_on_error = suspend_interchange_on_error @@ -3405,28 +3331,28 @@ def __init__( self.use_dot_as_decimal_separator = use_dot_as_decimal_separator -class EdifactProtocolSettings(msrest.serialization.Model): +class EdifactProtocolSettings(_serialization.Model): # pylint: disable=too-many-instance-attributes """The Edifact agreement protocol settings. All required parameters must be populated in order to send to Azure. - :ivar validation_settings: Required. The EDIFACT validation settings. + :ivar validation_settings: The EDIFACT validation settings. Required. :vartype validation_settings: ~azure.mgmt.logic.models.EdifactValidationSettings - :ivar framing_settings: Required. The EDIFACT framing settings. + :ivar framing_settings: The EDIFACT framing settings. Required. :vartype framing_settings: ~azure.mgmt.logic.models.EdifactFramingSettings - :ivar envelope_settings: Required. The EDIFACT envelope settings. + :ivar envelope_settings: The EDIFACT envelope settings. Required. :vartype envelope_settings: ~azure.mgmt.logic.models.EdifactEnvelopeSettings - :ivar acknowledgement_settings: Required. The EDIFACT acknowledgement settings. + :ivar acknowledgement_settings: The EDIFACT acknowledgement settings. Required. :vartype acknowledgement_settings: ~azure.mgmt.logic.models.EdifactAcknowledgementSettings - :ivar message_filter: Required. The EDIFACT message filter. + :ivar message_filter: The EDIFACT message filter. Required. :vartype message_filter: ~azure.mgmt.logic.models.EdifactMessageFilter - :ivar processing_settings: Required. The EDIFACT processing Settings. + :ivar processing_settings: The EDIFACT processing Settings. Required. :vartype processing_settings: ~azure.mgmt.logic.models.EdifactProcessingSettings :ivar envelope_overrides: The EDIFACT envelope override settings. :vartype envelope_overrides: list[~azure.mgmt.logic.models.EdifactEnvelopeOverride] :ivar message_filter_list: The EDIFACT message filter list. :vartype message_filter_list: list[~azure.mgmt.logic.models.EdifactMessageIdentifier] - :ivar schema_references: Required. The EDIFACT schema references. + :ivar schema_references: The EDIFACT schema references. Required. :vartype schema_references: list[~azure.mgmt.logic.models.EdifactSchemaReference] :ivar validation_overrides: The EDIFACT validation override settings. :vartype validation_overrides: list[~azure.mgmt.logic.models.EdifactValidationOverride] @@ -3435,70 +3361,70 @@ class EdifactProtocolSettings(msrest.serialization.Model): """ _validation = { - 'validation_settings': {'required': True}, - 'framing_settings': {'required': True}, - 'envelope_settings': {'required': True}, - 'acknowledgement_settings': {'required': True}, - 'message_filter': {'required': True}, - 'processing_settings': {'required': True}, - 'schema_references': {'required': True}, + "validation_settings": {"required": True}, + "framing_settings": {"required": True}, + "envelope_settings": {"required": True}, + "acknowledgement_settings": {"required": True}, + "message_filter": {"required": True}, + "processing_settings": {"required": True}, + "schema_references": {"required": True}, } _attribute_map = { - 'validation_settings': {'key': 'validationSettings', 'type': 'EdifactValidationSettings'}, - 'framing_settings': {'key': 'framingSettings', 'type': 'EdifactFramingSettings'}, - 'envelope_settings': {'key': 'envelopeSettings', 'type': 'EdifactEnvelopeSettings'}, - 'acknowledgement_settings': {'key': 'acknowledgementSettings', 'type': 'EdifactAcknowledgementSettings'}, - 'message_filter': {'key': 'messageFilter', 'type': 'EdifactMessageFilter'}, - 'processing_settings': {'key': 'processingSettings', 'type': 'EdifactProcessingSettings'}, - 'envelope_overrides': {'key': 'envelopeOverrides', 'type': '[EdifactEnvelopeOverride]'}, - 'message_filter_list': {'key': 'messageFilterList', 'type': '[EdifactMessageIdentifier]'}, - 'schema_references': {'key': 'schemaReferences', 'type': '[EdifactSchemaReference]'}, - 'validation_overrides': {'key': 'validationOverrides', 'type': '[EdifactValidationOverride]'}, - 'edifact_delimiter_overrides': {'key': 'edifactDelimiterOverrides', 'type': '[EdifactDelimiterOverride]'}, + "validation_settings": {"key": "validationSettings", "type": "EdifactValidationSettings"}, + "framing_settings": {"key": "framingSettings", "type": "EdifactFramingSettings"}, + "envelope_settings": {"key": "envelopeSettings", "type": "EdifactEnvelopeSettings"}, + "acknowledgement_settings": {"key": "acknowledgementSettings", "type": "EdifactAcknowledgementSettings"}, + "message_filter": {"key": "messageFilter", "type": "EdifactMessageFilter"}, + "processing_settings": {"key": "processingSettings", "type": "EdifactProcessingSettings"}, + "envelope_overrides": {"key": "envelopeOverrides", "type": "[EdifactEnvelopeOverride]"}, + "message_filter_list": {"key": "messageFilterList", "type": "[EdifactMessageIdentifier]"}, + "schema_references": {"key": "schemaReferences", "type": "[EdifactSchemaReference]"}, + "validation_overrides": {"key": "validationOverrides", "type": "[EdifactValidationOverride]"}, + "edifact_delimiter_overrides": {"key": "edifactDelimiterOverrides", "type": "[EdifactDelimiterOverride]"}, } 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 ): """ - :keyword validation_settings: Required. The EDIFACT validation settings. + :keyword validation_settings: The EDIFACT validation settings. Required. :paramtype validation_settings: ~azure.mgmt.logic.models.EdifactValidationSettings - :keyword framing_settings: Required. The EDIFACT framing settings. + :keyword framing_settings: The EDIFACT framing settings. Required. :paramtype framing_settings: ~azure.mgmt.logic.models.EdifactFramingSettings - :keyword envelope_settings: Required. The EDIFACT envelope settings. + :keyword envelope_settings: The EDIFACT envelope settings. Required. :paramtype envelope_settings: ~azure.mgmt.logic.models.EdifactEnvelopeSettings - :keyword acknowledgement_settings: Required. The EDIFACT acknowledgement settings. + :keyword acknowledgement_settings: The EDIFACT acknowledgement settings. Required. :paramtype acknowledgement_settings: ~azure.mgmt.logic.models.EdifactAcknowledgementSettings - :keyword message_filter: Required. The EDIFACT message filter. + :keyword message_filter: The EDIFACT message filter. Required. :paramtype message_filter: ~azure.mgmt.logic.models.EdifactMessageFilter - :keyword processing_settings: Required. The EDIFACT processing Settings. + :keyword processing_settings: The EDIFACT processing Settings. Required. :paramtype processing_settings: ~azure.mgmt.logic.models.EdifactProcessingSettings :keyword envelope_overrides: The EDIFACT envelope override settings. :paramtype envelope_overrides: list[~azure.mgmt.logic.models.EdifactEnvelopeOverride] :keyword message_filter_list: The EDIFACT message filter list. :paramtype message_filter_list: list[~azure.mgmt.logic.models.EdifactMessageIdentifier] - :keyword schema_references: Required. The EDIFACT schema references. + :keyword schema_references: The EDIFACT schema references. Required. :paramtype schema_references: list[~azure.mgmt.logic.models.EdifactSchemaReference] :keyword validation_overrides: The EDIFACT validation override settings. :paramtype validation_overrides: list[~azure.mgmt.logic.models.EdifactValidationOverride] :keyword edifact_delimiter_overrides: The EDIFACT delimiter override settings. :paramtype edifact_delimiter_overrides: list[~azure.mgmt.logic.models.EdifactDelimiterOverride] """ - super(EdifactProtocolSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.validation_settings = validation_settings self.framing_settings = framing_settings self.envelope_settings = envelope_settings @@ -3512,16 +3438,16 @@ def __init__( self.edifact_delimiter_overrides = edifact_delimiter_overrides -class EdifactSchemaReference(msrest.serialization.Model): +class EdifactSchemaReference(_serialization.Model): """The Edifact schema reference. All required parameters must be populated in order to send to Azure. - :ivar message_id: Required. The message id. + :ivar message_id: The message id. Required. :vartype message_id: str - :ivar message_version: Required. The message version. + :ivar message_version: The message version. Required. :vartype message_version: str - :ivar message_release: Required. The message release version. + :ivar message_release: The message release version. Required. :vartype message_release: str :ivar sender_application_id: The sender application id. :vartype sender_application_id: str @@ -3529,25 +3455,25 @@ class EdifactSchemaReference(msrest.serialization.Model): :vartype sender_application_qualifier: str :ivar association_assigned_code: The association assigned code. :vartype association_assigned_code: str - :ivar schema_name: Required. The schema name. + :ivar schema_name: The schema name. Required. :vartype schema_name: str """ _validation = { - 'message_id': {'required': True}, - 'message_version': {'required': True}, - 'message_release': {'required': True}, - 'schema_name': {'required': True}, + "message_id": {"required": True}, + "message_version": {"required": True}, + "message_release": {"required": True}, + "schema_name": {"required": True}, } _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'message_version': {'key': 'messageVersion', 'type': 'str'}, - 'message_release': {'key': 'messageRelease', 'type': 'str'}, - 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, - 'sender_application_qualifier': {'key': 'senderApplicationQualifier', 'type': 'str'}, - 'association_assigned_code': {'key': 'associationAssignedCode', 'type': 'str'}, - 'schema_name': {'key': 'schemaName', 'type': 'str'}, + "message_id": {"key": "messageId", "type": "str"}, + "message_version": {"key": "messageVersion", "type": "str"}, + "message_release": {"key": "messageRelease", "type": "str"}, + "sender_application_id": {"key": "senderApplicationId", "type": "str"}, + "sender_application_qualifier": {"key": "senderApplicationQualifier", "type": "str"}, + "association_assigned_code": {"key": "associationAssignedCode", "type": "str"}, + "schema_name": {"key": "schemaName", "type": "str"}, } def __init__( @@ -3563,11 +3489,11 @@ def __init__( **kwargs ): """ - :keyword message_id: Required. The message id. + :keyword message_id: The message id. Required. :paramtype message_id: str - :keyword message_version: Required. The message version. + :keyword message_version: The message version. Required. :paramtype message_version: str - :keyword message_release: Required. The message release version. + :keyword message_release: The message release version. Required. :paramtype message_release: str :keyword sender_application_id: The sender application id. :paramtype sender_application_id: str @@ -3575,10 +3501,10 @@ def __init__( :paramtype sender_application_qualifier: str :keyword association_assigned_code: The association assigned code. :paramtype association_assigned_code: str - :keyword schema_name: Required. The schema name. + :keyword schema_name: The schema name. Required. :paramtype schema_name: str """ - super(EdifactSchemaReference, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_id = message_id self.message_version = message_version self.message_release = message_release @@ -3588,48 +3514,51 @@ def __init__( self.schema_name = schema_name -class EdifactValidationOverride(msrest.serialization.Model): +class EdifactValidationOverride(_serialization.Model): """The Edifact validation override settings. All required parameters must be populated in order to send to Azure. - :ivar message_id: Required. The message id on which the validation settings has to be applied. + :ivar message_id: The message id on which the validation settings has to be applied. Required. :vartype message_id: str - :ivar enforce_character_set: Required. The value indicating whether to validate character Set. + :ivar enforce_character_set: The value indicating whether to validate character Set. Required. :vartype enforce_character_set: bool - :ivar validate_edi_types: Required. The value indicating whether to validate EDI types. + :ivar validate_edi_types: The value indicating whether to validate EDI types. Required. :vartype validate_edi_types: bool - :ivar validate_xsd_types: Required. The value indicating whether to validate XSD types. + :ivar validate_xsd_types: The value indicating whether to validate XSD types. Required. :vartype validate_xsd_types: bool - :ivar allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - allow leading and trailing spaces and zeroes. + :ivar allow_leading_and_trailing_spaces_and_zeroes: The value indicating whether to allow + leading and trailing spaces and zeroes. Required. :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: The trailing separator policy. Required. Known values are: + "NotSpecified", "NotAllowed", "Optional", and "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. + :ivar trim_leading_and_trailing_spaces_and_zeroes: The value indicating whether to trim leading + and trailing spaces and zeroes. Required. :vartype trim_leading_and_trailing_spaces_and_zeroes: bool """ _validation = { - 'message_id': {'required': True}, - 'enforce_character_set': {'required': True}, - 'validate_edi_types': {'required': True}, - 'validate_xsd_types': {'required': True}, - 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, - 'trailing_separator_policy': {'required': True}, - 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, + "message_id": {"required": True}, + "enforce_character_set": {"required": True}, + "validate_edi_types": {"required": True}, + "validate_xsd_types": {"required": True}, + "allow_leading_and_trailing_spaces_and_zeroes": {"required": True}, + "trailing_separator_policy": {"required": True}, + "trim_leading_and_trailing_spaces_and_zeroes": {"required": True}, } _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'enforce_character_set': {'key': 'enforceCharacterSet', 'type': 'bool'}, - 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, - 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, - 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, - 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, - 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, + "message_id": {"key": "messageId", "type": "str"}, + "enforce_character_set": {"key": "enforceCharacterSet", "type": "bool"}, + "validate_edi_types": {"key": "validateEDITypes", "type": "bool"}, + "validate_xsd_types": {"key": "validateXSDTypes", "type": "bool"}, + "allow_leading_and_trailing_spaces_and_zeroes": { + "key": "allowLeadingAndTrailingSpacesAndZeroes", + "type": "bool", + }, + "trailing_separator_policy": {"key": "trailingSeparatorPolicy", "type": "str"}, + "trim_leading_and_trailing_spaces_and_zeroes": {"key": "trimLeadingAndTrailingSpacesAndZeroes", "type": "bool"}, } def __init__( @@ -3640,32 +3569,32 @@ 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 ): """ - :keyword message_id: Required. The message id on which the validation settings has to be - applied. + :keyword message_id: The message id on which the validation settings has to be applied. + Required. :paramtype message_id: str - :keyword enforce_character_set: Required. The value indicating whether to validate character - Set. + :keyword enforce_character_set: The value indicating whether to validate character Set. + Required. :paramtype enforce_character_set: bool - :keyword validate_edi_types: Required. The value indicating whether to validate EDI types. + :keyword validate_edi_types: The value indicating whether to validate EDI types. Required. :paramtype validate_edi_types: bool - :keyword validate_xsd_types: Required. The value indicating whether to validate XSD types. + :keyword validate_xsd_types: The value indicating whether to validate XSD types. Required. :paramtype validate_xsd_types: bool - :keyword allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether - to allow leading and trailing spaces and zeroes. + :keyword allow_leading_and_trailing_spaces_and_zeroes: The value indicating whether to allow + leading and trailing spaces and zeroes. Required. :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: The trailing separator policy. Required. Known values are: + "NotSpecified", "NotAllowed", "Optional", and "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. + :keyword trim_leading_and_trailing_spaces_and_zeroes: The value indicating whether to trim + leading and trailing spaces and zeroes. Required. :paramtype trim_leading_and_trailing_spaces_and_zeroes: bool """ - super(EdifactValidationOverride, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_id = message_id self.enforce_character_set = enforce_character_set self.validate_edi_types = validate_edi_types @@ -3675,67 +3604,73 @@ def __init__( self.trim_leading_and_trailing_spaces_and_zeroes = trim_leading_and_trailing_spaces_and_zeroes -class EdifactValidationSettings(msrest.serialization.Model): +class EdifactValidationSettings(_serialization.Model): """The Edifact agreement validation settings. All required parameters must be populated in order to send to Azure. - :ivar validate_character_set: Required. The value indicating whether to validate character set - in the message. + :ivar validate_character_set: The value indicating whether to validate character set in the + message. Required. :vartype validate_character_set: bool - :ivar check_duplicate_interchange_control_number: Required. The value indicating whether to - check for duplicate interchange control number. + :ivar check_duplicate_interchange_control_number: The value indicating whether to check for + duplicate interchange control number. Required. :vartype check_duplicate_interchange_control_number: bool - :ivar interchange_control_number_validity_days: Required. The validity period of interchange - control number. + :ivar interchange_control_number_validity_days: The validity period of interchange control + number. Required. :vartype interchange_control_number_validity_days: int - :ivar check_duplicate_group_control_number: Required. The value indicating whether to check for - duplicate group control number. + :ivar check_duplicate_group_control_number: The value indicating whether to check for duplicate + group control number. Required. :vartype check_duplicate_group_control_number: bool - :ivar check_duplicate_transaction_set_control_number: Required. The value indicating whether to - check for duplicate transaction set control number. + :ivar check_duplicate_transaction_set_control_number: The value indicating whether to check for + duplicate transaction set control number. Required. :vartype check_duplicate_transaction_set_control_number: bool - :ivar validate_edi_types: Required. The value indicating whether to Whether to validate EDI - types. + :ivar validate_edi_types: The value indicating whether to Whether to validate EDI types. + Required. :vartype validate_edi_types: bool - :ivar validate_xsd_types: Required. The value indicating whether to Whether to validate XSD - types. + :ivar validate_xsd_types: The value indicating whether to Whether to validate XSD types. + Required. :vartype validate_xsd_types: bool - :ivar allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - allow leading and trailing spaces and zeroes. + :ivar allow_leading_and_trailing_spaces_and_zeroes: The value indicating whether to allow + leading and trailing spaces and zeroes. Required. :vartype allow_leading_and_trailing_spaces_and_zeroes: bool - :ivar trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - trim leading and trailing spaces and zeroes. + :ivar trim_leading_and_trailing_spaces_and_zeroes: The value indicating whether to trim leading + and trailing spaces and zeroes. Required. :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: The trailing separator policy. Required. Known values are: + "NotSpecified", "NotAllowed", "Optional", and "Mandatory". :vartype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ _validation = { - 'validate_character_set': {'required': True}, - 'check_duplicate_interchange_control_number': {'required': True}, - 'interchange_control_number_validity_days': {'required': True}, - 'check_duplicate_group_control_number': {'required': True}, - 'check_duplicate_transaction_set_control_number': {'required': True}, - 'validate_edi_types': {'required': True}, - 'validate_xsd_types': {'required': True}, - 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, - 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, - 'trailing_separator_policy': {'required': True}, + "validate_character_set": {"required": True}, + "check_duplicate_interchange_control_number": {"required": True}, + "interchange_control_number_validity_days": {"required": True}, + "check_duplicate_group_control_number": {"required": True}, + "check_duplicate_transaction_set_control_number": {"required": True}, + "validate_edi_types": {"required": True}, + "validate_xsd_types": {"required": True}, + "allow_leading_and_trailing_spaces_and_zeroes": {"required": True}, + "trim_leading_and_trailing_spaces_and_zeroes": {"required": True}, + "trailing_separator_policy": {"required": True}, } _attribute_map = { - 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, - 'check_duplicate_interchange_control_number': {'key': 'checkDuplicateInterchangeControlNumber', 'type': 'bool'}, - 'interchange_control_number_validity_days': {'key': 'interchangeControlNumberValidityDays', 'type': 'int'}, - 'check_duplicate_group_control_number': {'key': 'checkDuplicateGroupControlNumber', 'type': 'bool'}, - 'check_duplicate_transaction_set_control_number': {'key': 'checkDuplicateTransactionSetControlNumber', 'type': 'bool'}, - 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, - 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, - 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, - 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, - 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + "validate_character_set": {"key": "validateCharacterSet", "type": "bool"}, + "check_duplicate_interchange_control_number": {"key": "checkDuplicateInterchangeControlNumber", "type": "bool"}, + "interchange_control_number_validity_days": {"key": "interchangeControlNumberValidityDays", "type": "int"}, + "check_duplicate_group_control_number": {"key": "checkDuplicateGroupControlNumber", "type": "bool"}, + "check_duplicate_transaction_set_control_number": { + "key": "checkDuplicateTransactionSetControlNumber", + "type": "bool", + }, + "validate_edi_types": {"key": "validateEDITypes", "type": "bool"}, + "validate_xsd_types": {"key": "validateXSDTypes", "type": "bool"}, + "allow_leading_and_trailing_spaces_and_zeroes": { + "key": "allowLeadingAndTrailingSpacesAndZeroes", + "type": "bool", + }, + "trim_leading_and_trailing_spaces_and_zeroes": {"key": "trimLeadingAndTrailingSpacesAndZeroes", "type": "bool"}, + "trailing_separator_policy": {"key": "trailingSeparatorPolicy", "type": "str"}, } def __init__( @@ -3750,42 +3685,42 @@ 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 ): """ - :keyword validate_character_set: Required. The value indicating whether to validate character - set in the message. + :keyword validate_character_set: The value indicating whether to validate character set in the + message. Required. :paramtype validate_character_set: bool - :keyword check_duplicate_interchange_control_number: Required. The value indicating whether to - check for duplicate interchange control number. + :keyword check_duplicate_interchange_control_number: The value indicating whether to check for + duplicate interchange control number. Required. :paramtype check_duplicate_interchange_control_number: bool - :keyword interchange_control_number_validity_days: Required. The validity period of interchange - control number. + :keyword interchange_control_number_validity_days: The validity period of interchange control + number. Required. :paramtype interchange_control_number_validity_days: int - :keyword check_duplicate_group_control_number: Required. The value indicating whether to check - for duplicate group control number. + :keyword check_duplicate_group_control_number: The value indicating whether to check for + duplicate group control number. Required. :paramtype check_duplicate_group_control_number: bool - :keyword check_duplicate_transaction_set_control_number: Required. The value indicating whether - to check for duplicate transaction set control number. + :keyword check_duplicate_transaction_set_control_number: The value indicating whether to check + for duplicate transaction set control number. Required. :paramtype check_duplicate_transaction_set_control_number: bool - :keyword validate_edi_types: Required. The value indicating whether to Whether to validate EDI - types. + :keyword validate_edi_types: The value indicating whether to Whether to validate EDI types. + Required. :paramtype validate_edi_types: bool - :keyword validate_xsd_types: Required. The value indicating whether to Whether to validate XSD - types. + :keyword validate_xsd_types: The value indicating whether to Whether to validate XSD types. + Required. :paramtype validate_xsd_types: bool - :keyword allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether - to allow leading and trailing spaces and zeroes. + :keyword allow_leading_and_trailing_spaces_and_zeroes: The value indicating whether to allow + leading and trailing spaces and zeroes. Required. :paramtype allow_leading_and_trailing_spaces_and_zeroes: bool - :keyword trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - trim leading and trailing spaces and zeroes. + :keyword trim_leading_and_trailing_spaces_and_zeroes: The value indicating whether to trim + leading and trailing spaces and zeroes. Required. :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: The trailing separator policy. Required. Known values are: + "NotSpecified", "NotAllowed", "Optional", and "Mandatory". :paramtype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ - super(EdifactValidationSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.validate_character_set = validate_character_set self.check_duplicate_interchange_control_number = check_duplicate_interchange_control_number self.interchange_control_number_validity_days = interchange_control_number_validity_days @@ -3798,7 +3733,7 @@ def __init__( self.trailing_separator_policy = trailing_separator_policy -class ErrorProperties(msrest.serialization.Model): +class ErrorProperties(_serialization.Model): """Error properties indicate why the Logic service was not able to process the incoming request. The reason is provided in the error message. :ivar code: Error code. @@ -3808,29 +3743,23 @@ class ErrorProperties(msrest.serialization.Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, } - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - **kwargs - ): + def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None, **kwargs): """ :keyword code: Error code. :paramtype code: str :keyword message: Error message indicating why the operation failed. :paramtype message: str """ - super(ErrorProperties, self).__init__(**kwargs) + super().__init__(**kwargs) self.code = code self.message = message -class ErrorResponse(msrest.serialization.Model): +class ErrorResponse(_serialization.Model): """Error response indicates Logic service is not able to process the incoming request. The error property contains the error details. :ivar error: The error properties. @@ -3838,24 +3767,19 @@ class ErrorResponse(msrest.serialization.Model): """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorProperties'}, + "error": {"key": "error", "type": "ErrorProperties"}, } - def __init__( - self, - *, - error: Optional["ErrorProperties"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["_models.ErrorProperties"] = None, **kwargs): """ :keyword error: The error properties. :paramtype error: ~azure.mgmt.logic.models.ErrorProperties """ - super(ErrorResponse, self).__init__(**kwargs) + super().__init__(**kwargs) self.error = error -class Expression(msrest.serialization.Model): +class Expression(_serialization.Model): """The expression. :ivar text: The text. @@ -3869,10 +3793,10 @@ class Expression(msrest.serialization.Model): """ _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'subexpressions': {'key': 'subexpressions', 'type': '[Expression]'}, - 'error': {'key': 'error', 'type': 'AzureResourceErrorInfo'}, + "text": {"key": "text", "type": "str"}, + "value": {"key": "value", "type": "object"}, + "subexpressions": {"key": "subexpressions", "type": "[Expression]"}, + "error": {"key": "error", "type": "AzureResourceErrorInfo"}, } def __init__( @@ -3880,8 +3804,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 ): """ @@ -3894,7 +3818,7 @@ def __init__( :keyword error: The azure resource error info. :paramtype error: ~azure.mgmt.logic.models.AzureResourceErrorInfo """ - super(Expression, self).__init__(**kwargs) + super().__init__(**kwargs) self.text = text self.value = value self.subexpressions = subexpressions @@ -3917,11 +3841,11 @@ class ExpressionRoot(Expression): """ _attribute_map = { - 'text': {'key': 'text', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'subexpressions': {'key': 'subexpressions', 'type': '[Expression]'}, - 'error': {'key': 'error', 'type': 'AzureResourceErrorInfo'}, - 'path': {'key': 'path', 'type': 'str'}, + "text": {"key": "text", "type": "str"}, + "value": {"key": "value", "type": "object"}, + "subexpressions": {"key": "subexpressions", "type": "[Expression]"}, + "error": {"key": "error", "type": "AzureResourceErrorInfo"}, + "path": {"key": "path", "type": "str"}, } def __init__( @@ -3929,8 +3853,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 ): @@ -3946,11 +3870,11 @@ def __init__( :keyword path: The path. :paramtype path: str """ - super(ExpressionRoot, self).__init__(text=text, value=value, subexpressions=subexpressions, error=error, **kwargs) + super().__init__(text=text, value=value, subexpressions=subexpressions, error=error, **kwargs) self.path = path -class ExpressionTraces(msrest.serialization.Model): +class ExpressionTraces(_serialization.Model): """The expression traces. :ivar inputs: @@ -3958,79 +3882,74 @@ class ExpressionTraces(msrest.serialization.Model): """ _attribute_map = { - 'inputs': {'key': 'inputs', 'type': '[ExpressionRoot]'}, + "inputs": {"key": "inputs", "type": "[ExpressionRoot]"}, } - def __init__( - self, - *, - inputs: Optional[List["ExpressionRoot"]] = None, - **kwargs - ): + def __init__(self, *, inputs: Optional[List["_models.ExpressionRoot"]] = None, **kwargs): """ :keyword inputs: :paramtype inputs: list[~azure.mgmt.logic.models.ExpressionRoot] """ - super(ExpressionTraces, self).__init__(**kwargs) + super().__init__(**kwargs) self.inputs = inputs -class ExtendedErrorInfo(msrest.serialization.Model): +class ExtendedErrorInfo(_serialization.Model): """The extended error info. All required parameters must be populated in order to send to Azure. - :ivar code: Required. The error code. Possible values include: "NotSpecified", - "IntegrationServiceEnvironmentNotFound", "InternalServerError", "InvalidOperationId". + :ivar code: The error code. Required. Known values are: "NotSpecified", + "IntegrationServiceEnvironmentNotFound", "InternalServerError", and "InvalidOperationId". :vartype code: str or ~azure.mgmt.logic.models.ErrorResponseCode - :ivar message: Required. The error message. + :ivar message: The error message. Required. :vartype message: str :ivar details: The error message details. :vartype details: list[~azure.mgmt.logic.models.ExtendedErrorInfo] :ivar inner_error: The inner error. - :vartype inner_error: any + :vartype inner_error: JSON """ _validation = { - 'code': {'required': True}, - 'message': {'required': True}, + "code": {"required": True}, + "message": {"required": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ExtendedErrorInfo]'}, - 'inner_error': {'key': 'innerError', 'type': 'object'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "details": {"key": "details", "type": "[ExtendedErrorInfo]"}, + "inner_error": {"key": "innerError", "type": "object"}, } def __init__( self, *, - code: Union[str, "ErrorResponseCode"], + code: Union[str, "_models.ErrorResponseCode"], message: str, - details: Optional[List["ExtendedErrorInfo"]] = None, - inner_error: Optional[Any] = None, + details: Optional[List["_models.ExtendedErrorInfo"]] = None, + inner_error: Optional[JSON] = None, **kwargs ): """ - :keyword code: Required. The error code. Possible values include: "NotSpecified", - "IntegrationServiceEnvironmentNotFound", "InternalServerError", "InvalidOperationId". + :keyword code: The error code. Required. Known values are: "NotSpecified", + "IntegrationServiceEnvironmentNotFound", "InternalServerError", and "InvalidOperationId". :paramtype code: str or ~azure.mgmt.logic.models.ErrorResponseCode - :keyword message: Required. The error message. + :keyword message: The error message. Required. :paramtype message: str :keyword details: The error message details. :paramtype details: list[~azure.mgmt.logic.models.ExtendedErrorInfo] :keyword inner_error: The inner error. - :paramtype inner_error: any + :paramtype inner_error: JSON """ - super(ExtendedErrorInfo, self).__init__(**kwargs) + super().__init__(**kwargs) self.code = code self.message = message self.details = details self.inner_error = inner_error -class FlowAccessControlConfiguration(msrest.serialization.Model): +class FlowAccessControlConfiguration(_serialization.Model): """The access control configuration. :ivar triggers: The access control configuration for invoking workflow triggers. @@ -4044,19 +3963,19 @@ class FlowAccessControlConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'triggers': {'key': 'triggers', 'type': 'FlowAccessControlConfigurationPolicy'}, - 'contents': {'key': 'contents', 'type': 'FlowAccessControlConfigurationPolicy'}, - 'actions': {'key': 'actions', 'type': 'FlowAccessControlConfigurationPolicy'}, - 'workflow_management': {'key': 'workflowManagement', 'type': 'FlowAccessControlConfigurationPolicy'}, + "triggers": {"key": "triggers", "type": "FlowAccessControlConfigurationPolicy"}, + "contents": {"key": "contents", "type": "FlowAccessControlConfigurationPolicy"}, + "actions": {"key": "actions", "type": "FlowAccessControlConfigurationPolicy"}, + "workflow_management": {"key": "workflowManagement", "type": "FlowAccessControlConfigurationPolicy"}, } 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 ): """ @@ -4069,14 +3988,14 @@ def __init__( :keyword workflow_management: The access control configuration for workflow management. :paramtype workflow_management: ~azure.mgmt.logic.models.FlowAccessControlConfigurationPolicy """ - super(FlowAccessControlConfiguration, self).__init__(**kwargs) + super().__init__(**kwargs) self.triggers = triggers self.contents = contents self.actions = actions self.workflow_management = workflow_management -class FlowAccessControlConfigurationPolicy(msrest.serialization.Model): +class FlowAccessControlConfigurationPolicy(_serialization.Model): """The access control configuration policy. :ivar allowed_caller_ip_addresses: The allowed caller IP address ranges. @@ -4087,15 +4006,18 @@ class FlowAccessControlConfigurationPolicy(msrest.serialization.Model): """ _attribute_map = { - 'allowed_caller_ip_addresses': {'key': 'allowedCallerIpAddresses', 'type': '[IpAddressRange]'}, - 'open_authentication_policies': {'key': 'openAuthenticationPolicies', 'type': 'OpenAuthenticationAccessPolicies'}, + "allowed_caller_ip_addresses": {"key": "allowedCallerIpAddresses", "type": "[IpAddressRange]"}, + "open_authentication_policies": { + "key": "openAuthenticationPolicies", + "type": "OpenAuthenticationAccessPolicies", + }, } 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 ): """ @@ -4105,12 +4027,12 @@ def __init__( :paramtype open_authentication_policies: ~azure.mgmt.logic.models.OpenAuthenticationAccessPolicies """ - super(FlowAccessControlConfigurationPolicy, self).__init__(**kwargs) + super().__init__(**kwargs) self.allowed_caller_ip_addresses = allowed_caller_ip_addresses self.open_authentication_policies = open_authentication_policies -class FlowEndpoints(msrest.serialization.Model): +class FlowEndpoints(_serialization.Model): """The flow endpoints configuration. :ivar outgoing_ip_addresses: The outgoing ip address. @@ -4120,15 +4042,15 @@ class FlowEndpoints(msrest.serialization.Model): """ _attribute_map = { - 'outgoing_ip_addresses': {'key': 'outgoingIpAddresses', 'type': '[IpAddress]'}, - 'access_endpoint_ip_addresses': {'key': 'accessEndpointIpAddresses', 'type': '[IpAddress]'}, + "outgoing_ip_addresses": {"key": "outgoingIpAddresses", "type": "[IpAddress]"}, + "access_endpoint_ip_addresses": {"key": "accessEndpointIpAddresses", "type": "[IpAddress]"}, } 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 ): """ @@ -4137,12 +4059,12 @@ def __init__( :keyword access_endpoint_ip_addresses: The access endpoint ip address. :paramtype access_endpoint_ip_addresses: list[~azure.mgmt.logic.models.IpAddress] """ - super(FlowEndpoints, self).__init__(**kwargs) + super().__init__(**kwargs) self.outgoing_ip_addresses = outgoing_ip_addresses self.access_endpoint_ip_addresses = access_endpoint_ip_addresses -class FlowEndpointsConfiguration(msrest.serialization.Model): +class FlowEndpointsConfiguration(_serialization.Model): """The endpoints configuration. :ivar workflow: The workflow endpoints. @@ -4152,15 +4074,15 @@ class FlowEndpointsConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'workflow': {'key': 'workflow', 'type': 'FlowEndpoints'}, - 'connector': {'key': 'connector', 'type': 'FlowEndpoints'}, + "workflow": {"key": "workflow", "type": "FlowEndpoints"}, + "connector": {"key": "connector", "type": "FlowEndpoints"}, } def __init__( self, *, - workflow: Optional["FlowEndpoints"] = None, - connector: Optional["FlowEndpoints"] = None, + workflow: Optional["_models.FlowEndpoints"] = None, + connector: Optional["_models.FlowEndpoints"] = None, **kwargs ): """ @@ -4169,12 +4091,12 @@ def __init__( :keyword connector: The connector endpoints. :paramtype connector: ~azure.mgmt.logic.models.FlowEndpoints """ - super(FlowEndpointsConfiguration, self).__init__(**kwargs) + super().__init__(**kwargs) self.workflow = workflow self.connector = connector -class GenerateUpgradedDefinitionParameters(msrest.serialization.Model): +class GenerateUpgradedDefinitionParameters(_serialization.Model): """The parameters to generate upgraded definition. :ivar target_schema_version: The target schema version. @@ -4182,52 +4104,46 @@ class GenerateUpgradedDefinitionParameters(msrest.serialization.Model): """ _attribute_map = { - 'target_schema_version': {'key': 'targetSchemaVersion', 'type': 'str'}, + "target_schema_version": {"key": "targetSchemaVersion", "type": "str"}, } - def __init__( - self, - *, - target_schema_version: Optional[str] = None, - **kwargs - ): + def __init__(self, *, target_schema_version: Optional[str] = None, **kwargs): """ :keyword target_schema_version: The target schema version. :paramtype target_schema_version: str """ - super(GenerateUpgradedDefinitionParameters, self).__init__(**kwargs) + super().__init__(**kwargs) self.target_schema_version = target_schema_version -class GetCallbackUrlParameters(msrest.serialization.Model): +class GetCallbackUrlParameters(_serialization.Model): """The callback url parameters. :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", and "Secondary". :vartype key_type: str or ~azure.mgmt.logic.models.KeyType """ _attribute_map = { - 'not_after': {'key': 'notAfter', 'type': 'iso-8601'}, - 'key_type': {'key': 'keyType', 'type': 'str'}, + "not_after": {"key": "notAfter", "type": "iso-8601"}, + "key_type": {"key": "keyType", "type": "str"}, } 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", and "Secondary". :paramtype key_type: str or ~azure.mgmt.logic.models.KeyType """ - super(GetCallbackUrlParameters, self).__init__(**kwargs) + super().__init__(**kwargs) self.not_after = not_after self.key_type = key_type @@ -4245,32 +4161,35 @@ class IntegrationAccount(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar sku: The sku. :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", and "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'sku': {'key': 'sku', 'type': 'IntegrationAccountSku'}, - 'integration_service_environment': {'key': 'properties.integrationServiceEnvironment', 'type': 'ResourceReference'}, - 'state': {'key': 'properties.state', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "sku": {"key": "sku", "type": "IntegrationAccountSku"}, + "integration_service_environment": { + "key": "properties.integrationServiceEnvironment", + "type": "ResourceReference", + }, + "state": {"key": "properties.state", "type": "str"}, } def __init__( @@ -4278,31 +4197,31 @@ 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 ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword sku: The sku. :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", and "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState """ - super(IntegrationAccount, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.sku = sku self.integration_service_environment = integration_service_environment self.state = state -class IntegrationAccountAgreement(Resource): +class IntegrationAccountAgreement(Resource): # pylint: disable=too-many-instance-attributes """The integration account agreement. Variables are only populated by the server, and will be ignored when sending a request. @@ -4317,100 +4236,100 @@ class IntegrationAccountAgreement(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar created_time: The created time. :vartype created_time: ~datetime.datetime :ivar changed_time: The changed time. :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". + :vartype metadata: JSON + :ivar agreement_type: The agreement type. Required. Known values are: "NotSpecified", "AS2", + "X12", and "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. + :ivar host_partner: The integration account partner that is set as host partner for this + agreement. Required. :vartype host_partner: str - :ivar guest_partner: Required. The integration account partner that is set as guest partner for - this agreement. + :ivar guest_partner: The integration account partner that is set as guest partner for this + agreement. Required. :vartype guest_partner: str - :ivar host_identity: Required. The business identity of the host partner. + :ivar host_identity: The business identity of the host partner. Required. :vartype host_identity: ~azure.mgmt.logic.models.BusinessIdentity - :ivar guest_identity: Required. The business identity of the guest partner. + :ivar guest_identity: The business identity of the guest partner. Required. :vartype guest_identity: ~azure.mgmt.logic.models.BusinessIdentity - :ivar content: Required. The agreement content. + :ivar content: The agreement content. Required. :vartype content: ~azure.mgmt.logic.models.AgreementContent """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, - 'agreement_type': {'required': True}, - 'host_partner': {'required': True}, - 'guest_partner': {'required': True}, - 'host_identity': {'required': True}, - 'guest_identity': {'required': True}, - 'content': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'properties.metadata', 'type': 'object'}, - 'agreement_type': {'key': 'properties.agreementType', 'type': 'str'}, - 'host_partner': {'key': 'properties.hostPartner', 'type': 'str'}, - 'guest_partner': {'key': 'properties.guestPartner', 'type': 'str'}, - 'host_identity': {'key': 'properties.hostIdentity', 'type': 'BusinessIdentity'}, - 'guest_identity': {'key': 'properties.guestIdentity', 'type': 'BusinessIdentity'}, - 'content': {'key': 'properties.content', 'type': 'AgreementContent'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, + "agreement_type": {"required": True}, + "host_partner": {"required": True}, + "guest_partner": {"required": True}, + "host_identity": {"required": True}, + "guest_identity": {"required": True}, + "content": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "metadata": {"key": "properties.metadata", "type": "object"}, + "agreement_type": {"key": "properties.agreementType", "type": "str"}, + "host_partner": {"key": "properties.hostPartner", "type": "str"}, + "guest_partner": {"key": "properties.guestPartner", "type": "str"}, + "host_identity": {"key": "properties.hostIdentity", "type": "BusinessIdentity"}, + "guest_identity": {"key": "properties.guestIdentity", "type": "BusinessIdentity"}, + "content": {"key": "properties.content", "type": "AgreementContent"}, } 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, + metadata: Optional[JSON] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :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". + :paramtype metadata: JSON + :keyword agreement_type: The agreement type. Required. Known values are: "NotSpecified", "AS2", + "X12", and "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. + :keyword host_partner: The integration account partner that is set as host partner for this + agreement. Required. :paramtype host_partner: str - :keyword guest_partner: Required. The integration account partner that is set as guest partner - for this agreement. + :keyword guest_partner: The integration account partner that is set as guest partner for this + agreement. Required. :paramtype guest_partner: str - :keyword host_identity: Required. The business identity of the host partner. + :keyword host_identity: The business identity of the host partner. Required. :paramtype host_identity: ~azure.mgmt.logic.models.BusinessIdentity - :keyword guest_identity: Required. The business identity of the guest partner. + :keyword guest_identity: The business identity of the guest partner. Required. :paramtype guest_identity: ~azure.mgmt.logic.models.BusinessIdentity - :keyword content: Required. The agreement content. + :keyword content: The agreement content. Required. :paramtype content: ~azure.mgmt.logic.models.AgreementContent """ - super(IntegrationAccountAgreement, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.created_time = None self.changed_time = None self.metadata = metadata @@ -4422,40 +4341,35 @@ def __init__( self.content = content -class IntegrationAccountAgreementFilter(msrest.serialization.Model): +class IntegrationAccountAgreementFilter(_serialization.Model): """The integration account agreement filter for odata query. 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: The agreement type of integration account agreement. Required. Known + values are: "NotSpecified", "AS2", "X12", and "Edifact". :vartype agreement_type: str or ~azure.mgmt.logic.models.AgreementType """ _validation = { - 'agreement_type': {'required': True}, + "agreement_type": {"required": True}, } _attribute_map = { - 'agreement_type': {'key': 'agreementType', 'type': 'str'}, + "agreement_type": {"key": "agreementType", "type": "str"}, } - def __init__( - self, - *, - agreement_type: Union[str, "AgreementType"], - **kwargs - ): + def __init__(self, *, 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: The agreement type of integration account agreement. Required. Known + values are: "NotSpecified", "AS2", "X12", and "Edifact". :paramtype agreement_type: str or ~azure.mgmt.logic.models.AgreementType """ - super(IntegrationAccountAgreementFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.agreement_type = agreement_type -class IntegrationAccountAgreementListResult(msrest.serialization.Model): +class IntegrationAccountAgreementListResult(_serialization.Model): """The list of integration account agreements. :ivar value: The list of integration account agreements. @@ -4465,14 +4379,14 @@ class IntegrationAccountAgreementListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationAccountAgreement]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationAccountAgreement]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationAccountAgreement"]] = None, + value: Optional[List["_models.IntegrationAccountAgreement"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4482,7 +4396,7 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationAccountAgreementListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link @@ -4500,14 +4414,14 @@ class IntegrationAccountCertificate(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar created_time: The created time. :vartype created_time: ~datetime.datetime :ivar changed_time: The changed time. :vartype changed_time: ~datetime.datetime :ivar metadata: The metadata. - :vartype metadata: any + :vartype metadata: JSON :ivar key: The key details in the key vault. :vartype key: ~azure.mgmt.logic.models.KeyVaultKeyReference :ivar public_certificate: The public certificate. @@ -4515,24 +4429,24 @@ class IntegrationAccountCertificate(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'properties.metadata', 'type': 'object'}, - 'key': {'key': 'properties.key', 'type': 'KeyVaultKeyReference'}, - 'public_certificate': {'key': 'properties.publicCertificate', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "metadata": {"key": "properties.metadata", "type": "object"}, + "key": {"key": "properties.key", "type": "KeyVaultKeyReference"}, + "public_certificate": {"key": "properties.publicCertificate", "type": "str"}, } def __init__( @@ -4540,24 +4454,24 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - metadata: Optional[Any] = None, - key: Optional["KeyVaultKeyReference"] = None, + metadata: Optional[JSON] = None, + key: Optional["_models.KeyVaultKeyReference"] = None, public_certificate: Optional[str] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword metadata: The metadata. - :paramtype metadata: any + :paramtype metadata: JSON :keyword key: The key details in the key vault. :paramtype key: ~azure.mgmt.logic.models.KeyVaultKeyReference :keyword public_certificate: The public certificate. :paramtype public_certificate: str """ - super(IntegrationAccountCertificate, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.created_time = None self.changed_time = None self.metadata = metadata @@ -4565,7 +4479,7 @@ def __init__( self.public_certificate = public_certificate -class IntegrationAccountCertificateListResult(msrest.serialization.Model): +class IntegrationAccountCertificateListResult(_serialization.Model): """The list of integration account certificates. :ivar value: The list of integration account certificates. @@ -4575,14 +4489,14 @@ class IntegrationAccountCertificateListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationAccountCertificate]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationAccountCertificate]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationAccountCertificate"]] = None, + value: Optional[List["_models.IntegrationAccountCertificate"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4592,12 +4506,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationAccountCertificateListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class IntegrationAccountListResult(msrest.serialization.Model): +class IntegrationAccountListResult(_serialization.Model): """The list of integration accounts. :ivar value: The list of integration accounts. @@ -4607,16 +4521,12 @@ class IntegrationAccountListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationAccount]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationAccount]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["IntegrationAccount"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.IntegrationAccount"]] = None, next_link: Optional[str] = None, **kwargs ): """ :keyword value: The list of integration accounts. @@ -4624,12 +4534,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationAccountListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class IntegrationAccountMap(Resource): +class IntegrationAccountMap(Resource): # pylint: disable=too-many-instance-attributes """The integration account map. Variables are only populated by the server, and will be ignored when sending a request. @@ -4644,10 +4554,10 @@ class IntegrationAccountMap(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar 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: The map type. Required. Known values are: "NotSpecified", "Xslt", "Xslt20", + "Xslt30", and "Liquid". :vartype map_type: str or ~azure.mgmt.logic.models.MapType :ivar parameters_schema: The parameters schema of integration account map. :vartype parameters_schema: @@ -4663,54 +4573,57 @@ class IntegrationAccountMap(Resource): :ivar content_link: The content link. :vartype content_link: ~azure.mgmt.logic.models.ContentLink :ivar metadata: The metadata. - :vartype metadata: any + :vartype metadata: JSON """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'map_type': {'required': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, - 'content_link': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "map_type": {"required": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, + "content_link": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'map_type': {'key': 'properties.mapType', 'type': 'str'}, - 'parameters_schema': {'key': 'properties.parametersSchema', 'type': 'IntegrationAccountMapPropertiesParametersSchema'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'content': {'key': 'properties.content', 'type': 'str'}, - 'content_type': {'key': 'properties.contentType', 'type': 'str'}, - 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, - 'metadata': {'key': 'properties.metadata', 'type': 'object'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "map_type": {"key": "properties.mapType", "type": "str"}, + "parameters_schema": { + "key": "properties.parametersSchema", + "type": "IntegrationAccountMapPropertiesParametersSchema", + }, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "content": {"key": "properties.content", "type": "str"}, + "content_type": {"key": "properties.contentType", "type": "str"}, + "content_link": {"key": "properties.contentLink", "type": "ContentLink"}, + "metadata": {"key": "properties.metadata", "type": "object"}, } 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, + metadata: Optional[JSON] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword 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: The map type. Required. Known values are: "NotSpecified", "Xslt", "Xslt20", + "Xslt30", and "Liquid". :paramtype map_type: str or ~azure.mgmt.logic.models.MapType :keyword parameters_schema: The parameters schema of integration account map. :paramtype parameters_schema: @@ -4720,9 +4633,9 @@ def __init__( :keyword content_type: The content type. :paramtype content_type: str :keyword metadata: The metadata. - :paramtype metadata: any + :paramtype metadata: JSON """ - super(IntegrationAccountMap, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.map_type = map_type self.parameters_schema = parameters_schema self.created_time = None @@ -4733,40 +4646,35 @@ def __init__( self.metadata = metadata -class IntegrationAccountMapFilter(msrest.serialization.Model): +class IntegrationAccountMapFilter(_serialization.Model): """The integration account map filter for odata query. 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: - "NotSpecified", "Xslt", "Xslt20", "Xslt30", "Liquid". + :ivar map_type: The map type of integration account map. Required. Known values are: + "NotSpecified", "Xslt", "Xslt20", "Xslt30", and "Liquid". :vartype map_type: str or ~azure.mgmt.logic.models.MapType """ _validation = { - 'map_type': {'required': True}, + "map_type": {"required": True}, } _attribute_map = { - 'map_type': {'key': 'mapType', 'type': 'str'}, + "map_type": {"key": "mapType", "type": "str"}, } - def __init__( - self, - *, - map_type: Union[str, "MapType"], - **kwargs - ): + def __init__(self, *, map_type: Union[str, "_models.MapType"], **kwargs): """ - :keyword map_type: Required. The map type of integration account map. Possible values include: - "NotSpecified", "Xslt", "Xslt20", "Xslt30", "Liquid". + :keyword map_type: The map type of integration account map. Required. Known values are: + "NotSpecified", "Xslt", "Xslt20", "Xslt30", and "Liquid". :paramtype map_type: str or ~azure.mgmt.logic.models.MapType """ - super(IntegrationAccountMapFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.map_type = map_type -class IntegrationAccountMapListResult(msrest.serialization.Model): +class IntegrationAccountMapListResult(_serialization.Model): """The list of integration account maps. :ivar value: The list of integration account maps. @@ -4776,14 +4684,14 @@ class IntegrationAccountMapListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationAccountMap]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationAccountMap]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationAccountMap"]] = None, + value: Optional[List["_models.IntegrationAccountMap"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4793,12 +4701,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationAccountMapListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class IntegrationAccountMapPropertiesParametersSchema(msrest.serialization.Model): +class IntegrationAccountMapPropertiesParametersSchema(_serialization.Model): """The parameters schema of integration account map. :ivar ref: The reference name. @@ -4806,20 +4714,15 @@ class IntegrationAccountMapPropertiesParametersSchema(msrest.serialization.Model """ _attribute_map = { - 'ref': {'key': 'ref', 'type': 'str'}, + "ref": {"key": "ref", "type": "str"}, } - def __init__( - self, - *, - ref: Optional[str] = None, - **kwargs - ): + def __init__(self, *, ref: Optional[str] = None, **kwargs): """ :keyword ref: The reference name. :paramtype ref: str """ - super(IntegrationAccountMapPropertiesParametersSchema, self).__init__(**kwargs) + super().__init__(**kwargs) self.ref = ref @@ -4838,67 +4741,66 @@ class IntegrationAccountPartner(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] - :ivar partner_type: Required. The partner type. Possible values include: "NotSpecified", "B2B". + :ivar partner_type: The partner type. Required. Known values are: "NotSpecified" and "B2B". :vartype partner_type: str or ~azure.mgmt.logic.models.PartnerType :ivar created_time: The created time. :vartype created_time: ~datetime.datetime :ivar changed_time: The changed time. :vartype changed_time: ~datetime.datetime :ivar metadata: The metadata. - :vartype metadata: any - :ivar content: Required. The partner content. + :vartype metadata: JSON + :ivar content: The partner content. Required. :vartype content: ~azure.mgmt.logic.models.PartnerContent """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'partner_type': {'required': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, - 'content': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "partner_type": {"required": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, + "content": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'partner_type': {'key': 'properties.partnerType', 'type': 'str'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'properties.metadata', 'type': 'object'}, - 'content': {'key': 'properties.content', 'type': 'PartnerContent'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "partner_type": {"key": "properties.partnerType", "type": "str"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "metadata": {"key": "properties.metadata", "type": "object"}, + "content": {"key": "properties.content", "type": "PartnerContent"}, } 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, + metadata: Optional[JSON] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] - :keyword partner_type: Required. The partner type. Possible values include: "NotSpecified", - "B2B". + :keyword partner_type: The partner type. Required. Known values are: "NotSpecified" and "B2B". :paramtype partner_type: str or ~azure.mgmt.logic.models.PartnerType :keyword metadata: The metadata. - :paramtype metadata: any - :keyword content: Required. The partner content. + :paramtype metadata: JSON + :keyword content: The partner content. Required. :paramtype content: ~azure.mgmt.logic.models.PartnerContent """ - super(IntegrationAccountPartner, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.partner_type = partner_type self.created_time = None self.changed_time = None @@ -4906,40 +4808,35 @@ def __init__( self.content = content -class IntegrationAccountPartnerFilter(msrest.serialization.Model): +class IntegrationAccountPartnerFilter(_serialization.Model): """The integration account partner filter for odata query. 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: The partner type of integration account partner. Required. Known values + are: "NotSpecified" and "B2B". :vartype partner_type: str or ~azure.mgmt.logic.models.PartnerType """ _validation = { - 'partner_type': {'required': True}, + "partner_type": {"required": True}, } _attribute_map = { - 'partner_type': {'key': 'partnerType', 'type': 'str'}, + "partner_type": {"key": "partnerType", "type": "str"}, } - def __init__( - self, - *, - partner_type: Union[str, "PartnerType"], - **kwargs - ): + def __init__(self, *, 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: The partner type of integration account partner. Required. Known values + are: "NotSpecified" and "B2B". :paramtype partner_type: str or ~azure.mgmt.logic.models.PartnerType """ - super(IntegrationAccountPartnerFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.partner_type = partner_type -class IntegrationAccountPartnerListResult(msrest.serialization.Model): +class IntegrationAccountPartnerListResult(_serialization.Model): """The list of integration account partners. :ivar value: The list of integration account partners. @@ -4949,14 +4846,14 @@ class IntegrationAccountPartnerListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationAccountPartner]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationAccountPartner]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationAccountPartner"]] = None, + value: Optional[List["_models.IntegrationAccountPartner"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -4966,12 +4863,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationAccountPartnerListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class IntegrationAccountSchema(Resource): +class IntegrationAccountSchema(Resource): # pylint: disable=too-many-instance-attributes """The integration account schema. Variables are only populated by the server, and will be ignored when sending a request. @@ -4986,9 +4883,9 @@ class IntegrationAccountSchema(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] - :ivar schema_type: Required. The schema type. Possible values include: "NotSpecified", "Xml". + :ivar schema_type: The schema type. Required. Known values are: "NotSpecified" and "Xml". :vartype schema_type: str or ~azure.mgmt.logic.models.SchemaType :ivar target_namespace: The target namespace of the schema. :vartype target_namespace: str @@ -5001,7 +4898,7 @@ class IntegrationAccountSchema(Resource): :ivar changed_time: The changed time. :vartype changed_time: ~datetime.datetime :ivar metadata: The metadata. - :vartype metadata: any + :vartype metadata: JSON :ivar content: The content. :vartype content: str :ivar content_type: The content type. @@ -5011,43 +4908,43 @@ class IntegrationAccountSchema(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'schema_type': {'required': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, - 'content_link': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'schema_type': {'key': 'properties.schemaType', 'type': 'str'}, - 'target_namespace': {'key': 'properties.targetNamespace', 'type': 'str'}, - 'document_name': {'key': 'properties.documentName', 'type': 'str'}, - 'file_name': {'key': 'properties.fileName', 'type': 'str'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'metadata': {'key': 'properties.metadata', 'type': 'object'}, - 'content': {'key': 'properties.content', 'type': 'str'}, - 'content_type': {'key': 'properties.contentType', 'type': 'str'}, - 'content_link': {'key': 'properties.contentLink', 'type': 'ContentLink'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "schema_type": {"required": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, + "content_link": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "schema_type": {"key": "properties.schemaType", "type": "str"}, + "target_namespace": {"key": "properties.targetNamespace", "type": "str"}, + "document_name": {"key": "properties.documentName", "type": "str"}, + "file_name": {"key": "properties.fileName", "type": "str"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "metadata": {"key": "properties.metadata", "type": "object"}, + "content": {"key": "properties.content", "type": "str"}, + "content_type": {"key": "properties.contentType", "type": "str"}, + "content_link": {"key": "properties.contentLink", "type": "ContentLink"}, } 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, document_name: Optional[str] = None, file_name: Optional[str] = None, - metadata: Optional[Any] = None, + metadata: Optional[JSON] = None, content: Optional[str] = None, content_type: Optional[str] = None, **kwargs @@ -5055,10 +4952,9 @@ def __init__( """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] - :keyword schema_type: Required. The schema type. Possible values include: "NotSpecified", - "Xml". + :keyword schema_type: The schema type. Required. Known values are: "NotSpecified" and "Xml". :paramtype schema_type: str or ~azure.mgmt.logic.models.SchemaType :keyword target_namespace: The target namespace of the schema. :paramtype target_namespace: str @@ -5067,13 +4963,13 @@ def __init__( :keyword file_name: The file name. :paramtype file_name: str :keyword metadata: The metadata. - :paramtype metadata: any + :paramtype metadata: JSON :keyword content: The content. :paramtype content: str :keyword content_type: The content type. :paramtype content_type: str """ - super(IntegrationAccountSchema, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.schema_type = schema_type self.target_namespace = target_namespace self.document_name = document_name @@ -5086,40 +4982,35 @@ def __init__( self.content_link = None -class IntegrationAccountSchemaFilter(msrest.serialization.Model): +class IntegrationAccountSchemaFilter(_serialization.Model): """The integration account schema filter for odata query. 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: The schema type of integration account schema. Required. Known values are: + "NotSpecified" and "Xml". :vartype schema_type: str or ~azure.mgmt.logic.models.SchemaType """ _validation = { - 'schema_type': {'required': True}, + "schema_type": {"required": True}, } _attribute_map = { - 'schema_type': {'key': 'schemaType', 'type': 'str'}, + "schema_type": {"key": "schemaType", "type": "str"}, } - def __init__( - self, - *, - schema_type: Union[str, "SchemaType"], - **kwargs - ): + def __init__(self, *, 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: The schema type of integration account schema. Required. Known values + are: "NotSpecified" and "Xml". :paramtype schema_type: str or ~azure.mgmt.logic.models.SchemaType """ - super(IntegrationAccountSchemaFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.schema_type = schema_type -class IntegrationAccountSchemaListResult(msrest.serialization.Model): +class IntegrationAccountSchemaListResult(_serialization.Model): """The list of integration account schemas. :ivar value: The list of integration account schemas. @@ -5129,14 +5020,14 @@ class IntegrationAccountSchemaListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationAccountSchema]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationAccountSchema]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationAccountSchema"]] = None, + value: Optional[List["_models.IntegrationAccountSchema"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -5146,7 +5037,7 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationAccountSchemaListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link @@ -5164,33 +5055,33 @@ class IntegrationAccountSession(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar created_time: The created time. :vartype created_time: ~datetime.datetime :ivar changed_time: The changed time. :vartype changed_time: ~datetime.datetime :ivar content: The session content. - :vartype content: any + :vartype content: JSON """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'content': {'key': 'properties.content', 'type': 'object'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "content": {"key": "properties.content", "type": "object"}, } def __init__( @@ -5198,55 +5089,50 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - content: Optional[Any] = None, + content: Optional[JSON] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword content: The session content. - :paramtype content: any + :paramtype content: JSON """ - super(IntegrationAccountSession, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.created_time = None self.changed_time = None self.content = content -class IntegrationAccountSessionFilter(msrest.serialization.Model): +class IntegrationAccountSessionFilter(_serialization.Model): """The integration account session filter. All required parameters must be populated in order to send to Azure. - :ivar changed_time: Required. The changed time of integration account sessions. + :ivar changed_time: The changed time of integration account sessions. Required. :vartype changed_time: ~datetime.datetime """ _validation = { - 'changed_time': {'required': True}, + "changed_time": {"required": True}, } _attribute_map = { - 'changed_time': {'key': 'changedTime', 'type': 'iso-8601'}, + "changed_time": {"key": "changedTime", "type": "iso-8601"}, } - def __init__( - self, - *, - changed_time: datetime.datetime, - **kwargs - ): + def __init__(self, *, changed_time: datetime.datetime, **kwargs): """ - :keyword changed_time: Required. The changed time of integration account sessions. + :keyword changed_time: The changed time of integration account sessions. Required. :paramtype changed_time: ~datetime.datetime """ - super(IntegrationAccountSessionFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.changed_time = changed_time -class IntegrationAccountSessionListResult(msrest.serialization.Model): +class IntegrationAccountSessionListResult(_serialization.Model): """The list of integration account sessions. :ivar value: The list of integration account sessions. @@ -5256,14 +5142,14 @@ class IntegrationAccountSessionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationAccountSession]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationAccountSession]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationAccountSession"]] = None, + value: Optional[List["_models.IntegrationAccountSession"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -5273,45 +5159,40 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationAccountSessionListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class IntegrationAccountSku(msrest.serialization.Model): +class IntegrationAccountSku(_serialization.Model): """The integration account sku. 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: The sku name. Required. Known values are: "NotSpecified", "Free", "Basic", and "Standard". :vartype name: str or ~azure.mgmt.logic.models.IntegrationAccountSkuName """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, } - def __init__( - self, - *, - name: Union[str, "IntegrationAccountSkuName"], - **kwargs - ): + def __init__(self, *, name: Union[str, "_models.IntegrationAccountSkuName"], **kwargs): """ - :keyword name: Required. The sku name. Possible values include: "NotSpecified", "Free", - "Basic", "Standard". + :keyword name: The sku name. Required. Known values are: "NotSpecified", "Free", "Basic", and + "Standard". :paramtype name: str or ~azure.mgmt.logic.models.IntegrationAccountSkuName """ - super(IntegrationAccountSku, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = name -class IntegrationServiceEnvironmenEncryptionConfiguration(msrest.serialization.Model): +class IntegrationServiceEnvironmenEncryptionConfiguration(_serialization.Model): """The encryption configuration for the integration service environment. :ivar encryption_key_reference: The encryption key reference. @@ -5320,13 +5201,16 @@ class IntegrationServiceEnvironmenEncryptionConfiguration(msrest.serialization.M """ _attribute_map = { - 'encryption_key_reference': {'key': 'encryptionKeyReference', 'type': 'IntegrationServiceEnvironmenEncryptionKeyReference'}, + "encryption_key_reference": { + "key": "encryptionKeyReference", + "type": "IntegrationServiceEnvironmenEncryptionKeyReference", + }, } def __init__( self, *, - encryption_key_reference: Optional["IntegrationServiceEnvironmenEncryptionKeyReference"] = None, + encryption_key_reference: Optional["_models.IntegrationServiceEnvironmenEncryptionKeyReference"] = None, **kwargs ): """ @@ -5334,11 +5218,11 @@ def __init__( :paramtype encryption_key_reference: ~azure.mgmt.logic.models.IntegrationServiceEnvironmenEncryptionKeyReference """ - super(IntegrationServiceEnvironmenEncryptionConfiguration, self).__init__(**kwargs) + super().__init__(**kwargs) self.encryption_key_reference = encryption_key_reference -class IntegrationServiceEnvironmenEncryptionKeyReference(msrest.serialization.Model): +class IntegrationServiceEnvironmenEncryptionKeyReference(_serialization.Model): """The encryption key details for the integration service environment. :ivar key_vault: The key vault reference. @@ -5350,15 +5234,15 @@ class IntegrationServiceEnvironmenEncryptionKeyReference(msrest.serialization.Mo """ _attribute_map = { - 'key_vault': {'key': 'keyVault', 'type': 'ResourceReference'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'key_version': {'key': 'keyVersion', 'type': 'str'}, + "key_vault": {"key": "keyVault", "type": "ResourceReference"}, + "key_name": {"key": "keyName", "type": "str"}, + "key_version": {"key": "keyVersion", "type": "str"}, } 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 @@ -5371,7 +5255,7 @@ def __init__( :keyword key_version: Gets the version of the key specified in the keyName property. :paramtype key_version: str """ - super(IntegrationServiceEnvironmenEncryptionKeyReference, self).__init__(**kwargs) + super().__init__(**kwargs) self.key_vault = key_vault self.key_name = key_name self.key_version = key_version @@ -5390,7 +5274,7 @@ class IntegrationServiceEnvironment(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar properties: The integration service environment properties. :vartype properties: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentProperties @@ -5401,20 +5285,20 @@ class IntegrationServiceEnvironment(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'IntegrationServiceEnvironmentProperties'}, - 'sku': {'key': 'sku', 'type': 'IntegrationServiceEnvironmentSku'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "IntegrationServiceEnvironmentProperties"}, + "sku": {"key": "sku", "type": "IntegrationServiceEnvironmentSku"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, } def __init__( @@ -5422,15 +5306,15 @@ 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 ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword properties: The integration service environment properties. :paramtype properties: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentProperties @@ -5439,41 +5323,38 @@ def __init__( :keyword identity: Managed service identity properties. :paramtype identity: ~azure.mgmt.logic.models.ManagedServiceIdentity """ - super(IntegrationServiceEnvironment, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.properties = properties self.sku = sku self.identity = identity -class IntegrationServiceEnvironmentAccessEndpoint(msrest.serialization.Model): +class IntegrationServiceEnvironmentAccessEndpoint(_serialization.Model): """The integration service environment access endpoint. - :ivar type: The access endpoint type. Possible values include: "NotSpecified", "External", + :ivar type: The access endpoint type. Known values are: "NotSpecified", "External", and "Internal". :vartype type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentAccessEndpointType """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, } def __init__( - self, - *, - type: Optional[Union[str, "IntegrationServiceEnvironmentAccessEndpointType"]] = None, - **kwargs + self, *, 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", and "Internal". :paramtype type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentAccessEndpointType """ - super(IntegrationServiceEnvironmentAccessEndpoint, self).__init__(**kwargs) + super().__init__(**kwargs) self.type = type -class IntegrationServiceEnvironmentListResult(msrest.serialization.Model): +class IntegrationServiceEnvironmentListResult(_serialization.Model): """The list of integration service environments. :ivar value: @@ -5483,14 +5364,14 @@ class IntegrationServiceEnvironmentListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationServiceEnvironment]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationServiceEnvironment]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationServiceEnvironment"]] = None, + value: Optional[List["_models.IntegrationServiceEnvironment"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -5500,12 +5381,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationServiceEnvironmentListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class IntegrationServiceEnvironmentManagedApi(Resource): +class IntegrationServiceEnvironmentManagedApi(Resource): # pylint: disable=too-many-instance-attributes """The integration service environment managed api. Variables are only populated by the server, and will be ignored when sending a request. @@ -5518,12 +5399,12 @@ class IntegrationServiceEnvironmentManagedApi(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar name_properties_name: The name. :vartype name_properties_name: str :ivar connection_parameters: The connection parameters. - :vartype connection_parameters: dict[str, any] + :vartype connection_parameters: dict[str, JSON] :ivar metadata: The metadata. :vartype metadata: ~azure.mgmt.logic.models.ApiResourceMetadata :ivar runtime_urls: The runtime urls. @@ -5542,13 +5423,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", - "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :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", and "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", and + "Premium". :vartype category: str or ~azure.mgmt.logic.models.ApiTier :ivar deployment_parameters: The integration service environment managed api deployment parameters. @@ -5557,43 +5438,49 @@ class IntegrationServiceEnvironmentManagedApi(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'name_properties_name': {'readonly': True}, - 'connection_parameters': {'readonly': True}, - 'metadata': {'readonly': True}, - 'runtime_urls': {'readonly': True}, - 'general_information': {'readonly': True}, - 'capabilities': {'readonly': True}, - 'backend_service': {'readonly': True}, - 'policies': {'readonly': True}, - 'api_definition_url': {'readonly': True}, - 'api_definitions': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'category': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, - 'connection_parameters': {'key': 'properties.connectionParameters', 'type': '{object}'}, - 'metadata': {'key': 'properties.metadata', 'type': 'ApiResourceMetadata'}, - 'runtime_urls': {'key': 'properties.runtimeUrls', 'type': '[str]'}, - 'general_information': {'key': 'properties.generalInformation', 'type': 'ApiResourceGeneralInformation'}, - 'capabilities': {'key': 'properties.capabilities', 'type': '[str]'}, - 'backend_service': {'key': 'properties.backendService', 'type': 'ApiResourceBackendService'}, - 'policies': {'key': 'properties.policies', 'type': 'ApiResourcePolicies'}, - 'api_definition_url': {'key': 'properties.apiDefinitionUrl', 'type': 'str'}, - 'api_definitions': {'key': 'properties.apiDefinitions', 'type': 'ApiResourceDefinitions'}, - 'integration_service_environment': {'key': 'properties.integrationServiceEnvironment', 'type': 'ResourceReference'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - 'deployment_parameters': {'key': 'properties.deploymentParameters', 'type': 'IntegrationServiceEnvironmentManagedApiDeploymentParameters'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "name_properties_name": {"readonly": True}, + "connection_parameters": {"readonly": True}, + "metadata": {"readonly": True}, + "runtime_urls": {"readonly": True}, + "general_information": {"readonly": True}, + "capabilities": {"readonly": True}, + "backend_service": {"readonly": True}, + "policies": {"readonly": True}, + "api_definition_url": {"readonly": True}, + "api_definitions": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "category": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "name_properties_name": {"key": "properties.name", "type": "str"}, + "connection_parameters": {"key": "properties.connectionParameters", "type": "{object}"}, + "metadata": {"key": "properties.metadata", "type": "ApiResourceMetadata"}, + "runtime_urls": {"key": "properties.runtimeUrls", "type": "[str]"}, + "general_information": {"key": "properties.generalInformation", "type": "ApiResourceGeneralInformation"}, + "capabilities": {"key": "properties.capabilities", "type": "[str]"}, + "backend_service": {"key": "properties.backendService", "type": "ApiResourceBackendService"}, + "policies": {"key": "properties.policies", "type": "ApiResourcePolicies"}, + "api_definition_url": {"key": "properties.apiDefinitionUrl", "type": "str"}, + "api_definitions": {"key": "properties.apiDefinitions", "type": "ApiResourceDefinitions"}, + "integration_service_environment": { + "key": "properties.integrationServiceEnvironment", + "type": "ResourceReference", + }, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "category": {"key": "properties.category", "type": "str"}, + "deployment_parameters": { + "key": "properties.deploymentParameters", + "type": "IntegrationServiceEnvironmentManagedApiDeploymentParameters", + }, } def __init__( @@ -5601,14 +5488,14 @@ 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 ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword integration_service_environment: The integration service environment reference. :paramtype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference @@ -5617,7 +5504,7 @@ def __init__( :paramtype deployment_parameters: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApiDeploymentParameters """ - super(IntegrationServiceEnvironmentManagedApi, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.name_properties_name = None self.connection_parameters = None self.metadata = None @@ -5634,7 +5521,7 @@ def __init__( self.deployment_parameters = deployment_parameters -class IntegrationServiceEnvironmentManagedApiDeploymentParameters(msrest.serialization.Model): +class IntegrationServiceEnvironmentManagedApiDeploymentParameters(_serialization.Model): """The integration service environment managed api deployment parameters. :ivar content_link_definition: The integration service environment managed api content link for @@ -5643,25 +5530,20 @@ class IntegrationServiceEnvironmentManagedApiDeploymentParameters(msrest.seriali """ _attribute_map = { - 'content_link_definition': {'key': 'contentLinkDefinition', 'type': 'ContentLink'}, + "content_link_definition": {"key": "contentLinkDefinition", "type": "ContentLink"}, } - def __init__( - self, - *, - content_link_definition: Optional["ContentLink"] = None, - **kwargs - ): + def __init__(self, *, content_link_definition: Optional["_models.ContentLink"] = None, **kwargs): """ :keyword content_link_definition: The integration service environment managed api content link for deployment. :paramtype content_link_definition: ~azure.mgmt.logic.models.ContentLink """ - super(IntegrationServiceEnvironmentManagedApiDeploymentParameters, self).__init__(**kwargs) + super().__init__(**kwargs) self.content_link_definition = content_link_definition -class IntegrationServiceEnvironmentManagedApiListResult(msrest.serialization.Model): +class IntegrationServiceEnvironmentManagedApiListResult(_serialization.Model): """The list of integration service environment managed APIs. :ivar value: The integration service environment managed APIs. @@ -5671,14 +5553,14 @@ class IntegrationServiceEnvironmentManagedApiListResult(msrest.serialization.Mod """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationServiceEnvironmentManagedApi]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationServiceEnvironmentManagedApi]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationServiceEnvironmentManagedApi"]] = None, + value: Optional[List["_models.IntegrationServiceEnvironmentManagedApi"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -5688,12 +5570,14 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationServiceEnvironmentManagedApiListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class IntegrationServiceEnvironmentManagedApiProperties(ApiResourceProperties): +class IntegrationServiceEnvironmentManagedApiProperties( + ApiResourceProperties +): # pylint: disable=too-many-instance-attributes """The integration service environment managed api properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -5701,7 +5585,7 @@ class IntegrationServiceEnvironmentManagedApiProperties(ApiResourceProperties): :ivar name: The name. :vartype name: str :ivar connection_parameters: The connection parameters. - :vartype connection_parameters: dict[str, any] + :vartype connection_parameters: dict[str, JSON] :ivar metadata: The metadata. :vartype metadata: ~azure.mgmt.logic.models.ApiResourceMetadata :ivar runtime_urls: The runtime urls. @@ -5720,13 +5604,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", - "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :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", and "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", and + "Premium". :vartype category: str or ~azure.mgmt.logic.models.ApiTier :ivar deployment_parameters: The integration service environment managed api deployment parameters. @@ -5735,42 +5619,45 @@ class IntegrationServiceEnvironmentManagedApiProperties(ApiResourceProperties): """ _validation = { - 'name': {'readonly': True}, - 'connection_parameters': {'readonly': True}, - 'metadata': {'readonly': True}, - 'runtime_urls': {'readonly': True}, - 'general_information': {'readonly': True}, - 'capabilities': {'readonly': True}, - 'backend_service': {'readonly': True}, - 'policies': {'readonly': True}, - 'api_definition_url': {'readonly': True}, - 'api_definitions': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'category': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'connection_parameters': {'key': 'connectionParameters', 'type': '{object}'}, - 'metadata': {'key': 'metadata', 'type': 'ApiResourceMetadata'}, - 'runtime_urls': {'key': 'runtimeUrls', 'type': '[str]'}, - 'general_information': {'key': 'generalInformation', 'type': 'ApiResourceGeneralInformation'}, - 'capabilities': {'key': 'capabilities', 'type': '[str]'}, - 'backend_service': {'key': 'backendService', 'type': 'ApiResourceBackendService'}, - 'policies': {'key': 'policies', 'type': 'ApiResourcePolicies'}, - 'api_definition_url': {'key': 'apiDefinitionUrl', 'type': 'str'}, - 'api_definitions': {'key': 'apiDefinitions', 'type': 'ApiResourceDefinitions'}, - 'integration_service_environment': {'key': 'integrationServiceEnvironment', 'type': 'ResourceReference'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'deployment_parameters': {'key': 'deploymentParameters', 'type': 'IntegrationServiceEnvironmentManagedApiDeploymentParameters'}, + "name": {"readonly": True}, + "connection_parameters": {"readonly": True}, + "metadata": {"readonly": True}, + "runtime_urls": {"readonly": True}, + "general_information": {"readonly": True}, + "capabilities": {"readonly": True}, + "backend_service": {"readonly": True}, + "policies": {"readonly": True}, + "api_definition_url": {"readonly": True}, + "api_definitions": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "category": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "connection_parameters": {"key": "connectionParameters", "type": "{object}"}, + "metadata": {"key": "metadata", "type": "ApiResourceMetadata"}, + "runtime_urls": {"key": "runtimeUrls", "type": "[str]"}, + "general_information": {"key": "generalInformation", "type": "ApiResourceGeneralInformation"}, + "capabilities": {"key": "capabilities", "type": "[str]"}, + "backend_service": {"key": "backendService", "type": "ApiResourceBackendService"}, + "policies": {"key": "policies", "type": "ApiResourcePolicies"}, + "api_definition_url": {"key": "apiDefinitionUrl", "type": "str"}, + "api_definitions": {"key": "apiDefinitions", "type": "ApiResourceDefinitions"}, + "integration_service_environment": {"key": "integrationServiceEnvironment", "type": "ResourceReference"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "category": {"key": "category", "type": "str"}, + "deployment_parameters": { + "key": "deploymentParameters", + "type": "IntegrationServiceEnvironmentManagedApiDeploymentParameters", + }, } 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 ): """ @@ -5781,17 +5668,17 @@ def __init__( :paramtype deployment_parameters: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApiDeploymentParameters """ - super(IntegrationServiceEnvironmentManagedApiProperties, self).__init__(integration_service_environment=integration_service_environment, **kwargs) + super().__init__(integration_service_environment=integration_service_environment, **kwargs) self.deployment_parameters = deployment_parameters -class IntegrationServiceEnvironmentNetworkDependency(msrest.serialization.Model): +class IntegrationServiceEnvironmentNetworkDependency(_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". + "AccessEndpoints", "RecoveryService", "SQL", and "RegionalService". :vartype category: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyCategoryType :ivar display_name: The display name. @@ -5801,25 +5688,24 @@ class IntegrationServiceEnvironmentNetworkDependency(msrest.serialization.Model) """ _attribute_map = { - 'category': {'key': 'category', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'endpoints': {'key': 'endpoints', 'type': '[IntegrationServiceEnvironmentNetworkEndpoint]'}, + "category": {"key": "category", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + "endpoints": {"key": "endpoints", "type": "[IntegrationServiceEnvironmentNetworkEndpoint]"}, } 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", and "RegionalService". :paramtype category: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyCategoryType :keyword display_name: The display name. @@ -5828,53 +5714,53 @@ def __init__( :paramtype endpoints: list[~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndpoint] """ - super(IntegrationServiceEnvironmentNetworkDependency, self).__init__(**kwargs) + super().__init__(**kwargs) self.category = category self.display_name = display_name self.endpoints = endpoints -class IntegrationServiceEnvironmentNetworkDependencyHealth(msrest.serialization.Model): +class IntegrationServiceEnvironmentNetworkDependencyHealth(_serialization.Model): """The integration service environment subnet network health. :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", and "Unknown". :vartype state: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealthState """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ExtendedErrorInfo'}, - 'state': {'key': 'state', 'type': 'str'}, + "error": {"key": "error", "type": "ExtendedErrorInfo"}, + "state": {"key": "state", "type": "str"}, } 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", - "Healthy", "Unhealthy", "Unknown". + :keyword state: The network dependency health state. Known values are: "NotSpecified", + "Healthy", "Unhealthy", and "Unknown". :paramtype state: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkDependencyHealthState """ - super(IntegrationServiceEnvironmentNetworkDependencyHealth, self).__init__(**kwargs) + super().__init__(**kwargs) self.error = error self.state = state -class IntegrationServiceEnvironmentNetworkEndpoint(msrest.serialization.Model): +class IntegrationServiceEnvironmentNetworkEndpoint(_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", and "NotAvailable". :vartype accessibility: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState :ivar domain_name: The domain name. @@ -5884,22 +5770,24 @@ class IntegrationServiceEnvironmentNetworkEndpoint(msrest.serialization.Model): """ _attribute_map = { - 'accessibility': {'key': 'accessibility', 'type': 'str'}, - 'domain_name': {'key': 'domainName', 'type': 'str'}, - 'ports': {'key': 'ports', 'type': '[str]'}, + "accessibility": {"key": "accessibility", "type": "str"}, + "domain_name": {"key": "domainName", "type": "str"}, + "ports": {"key": "ports", "type": "[str]"}, } 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", and "NotAvailable". :paramtype accessibility: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState :keyword domain_name: The domain name. @@ -5907,22 +5795,22 @@ def __init__( :keyword ports: The ports. :paramtype ports: list[str] """ - super(IntegrationServiceEnvironmentNetworkEndpoint, self).__init__(**kwargs) + super().__init__(**kwargs) self.accessibility = accessibility self.domain_name = domain_name self.ports = ports -class IntegrationServiceEnvironmentProperties(msrest.serialization.Model): +class IntegrationServiceEnvironmentProperties(_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", - "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :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", and "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", and "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 @@ -5936,33 +5824,36 @@ class IntegrationServiceEnvironmentProperties(msrest.serialization.Model): """ _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, - 'integration_service_environment_id': {'key': 'integrationServiceEnvironmentId', 'type': 'str'}, - 'endpoints_configuration': {'key': 'endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, - 'network_configuration': {'key': 'networkConfiguration', 'type': 'NetworkConfiguration'}, - 'encryption_configuration': {'key': 'encryptionConfiguration', 'type': 'IntegrationServiceEnvironmenEncryptionConfiguration'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "state": {"key": "state", "type": "str"}, + "integration_service_environment_id": {"key": "integrationServiceEnvironmentId", "type": "str"}, + "endpoints_configuration": {"key": "endpointsConfiguration", "type": "FlowEndpointsConfiguration"}, + "network_configuration": {"key": "networkConfiguration", "type": "NetworkConfiguration"}, + "encryption_configuration": { + "key": "encryptionConfiguration", + "type": "IntegrationServiceEnvironmenEncryptionConfiguration", + }, } 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". + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", and "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", and "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 @@ -5974,7 +5865,7 @@ def __init__( :paramtype encryption_configuration: ~azure.mgmt.logic.models.IntegrationServiceEnvironmenEncryptionConfiguration """ - super(IntegrationServiceEnvironmentProperties, self).__init__(**kwargs) + super().__init__(**kwargs) self.provisioning_state = provisioning_state self.state = state self.integration_service_environment_id = integration_service_environment_id @@ -5983,39 +5874,39 @@ def __init__( self.encryption_configuration = encryption_configuration -class IntegrationServiceEnvironmentSku(msrest.serialization.Model): +class IntegrationServiceEnvironmentSku(_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", and "Developer". :vartype name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName :ivar capacity: The sku capacity. :vartype capacity: int """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'capacity': {'key': 'capacity', 'type': 'int'}, + "name": {"key": "name", "type": "str"}, + "capacity": {"key": "capacity", "type": "int"}, } 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", and "Developer". :paramtype name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName :keyword capacity: The sku capacity. :paramtype capacity: int """ - super(IntegrationServiceEnvironmentSku, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = name self.capacity = capacity -class IntegrationServiceEnvironmentSkuCapacity(msrest.serialization.Model): +class IntegrationServiceEnvironmentSkuCapacity(_serialization.Model): """The integration service environment sku capacity. :ivar minimum: The minimum capacity. @@ -6024,15 +5915,15 @@ 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", and "None". :vartype scale_type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuScaleType """ _attribute_map = { - 'minimum': {'key': 'minimum', 'type': 'int'}, - 'maximum': {'key': 'maximum', 'type': 'int'}, - 'default': {'key': 'default', 'type': 'int'}, - 'scale_type': {'key': 'scaleType', 'type': 'str'}, + "minimum": {"key": "minimum", "type": "int"}, + "maximum": {"key": "maximum", "type": "int"}, + "default": {"key": "default", "type": "int"}, + "scale_type": {"key": "scaleType", "type": "str"}, } def __init__( @@ -6041,7 +5932,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,19 +5942,18 @@ 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", and "None". :paramtype scale_type: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuScaleType """ - super(IntegrationServiceEnvironmentSkuCapacity, self).__init__(**kwargs) + super().__init__(**kwargs) self.minimum = minimum self.maximum = maximum self.default = default self.scale_type = scale_type -class IntegrationServiceEnvironmentSkuDefinition(msrest.serialization.Model): +class IntegrationServiceEnvironmentSkuDefinition(_serialization.Model): """The integration service environment sku definition. :ivar resource_type: The resource type. @@ -6075,17 +5965,17 @@ class IntegrationServiceEnvironmentSkuDefinition(msrest.serialization.Model): """ _attribute_map = { - 'resource_type': {'key': 'resourceType', 'type': 'str'}, - 'sku': {'key': 'sku', 'type': 'IntegrationServiceEnvironmentSkuDefinitionSku'}, - 'capacity': {'key': 'capacity', 'type': 'IntegrationServiceEnvironmentSkuCapacity'}, + "resource_type": {"key": "resourceType", "type": "str"}, + "sku": {"key": "sku", "type": "IntegrationServiceEnvironmentSkuDefinitionSku"}, + "capacity": {"key": "capacity", "type": "IntegrationServiceEnvironmentSkuCapacity"}, } 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 ): """ @@ -6096,45 +5986,45 @@ def __init__( :keyword capacity: The sku capacity. :paramtype capacity: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuCapacity """ - super(IntegrationServiceEnvironmentSkuDefinition, self).__init__(**kwargs) + super().__init__(**kwargs) self.resource_type = resource_type self.sku = sku self.capacity = capacity -class IntegrationServiceEnvironmentSkuDefinitionSku(msrest.serialization.Model): +class IntegrationServiceEnvironmentSkuDefinitionSku(_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", and "Developer". :vartype name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName :ivar tier: The sku tier. :vartype tier: str """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, } 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", and "Developer". :paramtype name: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuName :keyword tier: The sku tier. :paramtype tier: str """ - super(IntegrationServiceEnvironmentSkuDefinitionSku, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = name self.tier = tier -class IntegrationServiceEnvironmentSkuList(msrest.serialization.Model): +class IntegrationServiceEnvironmentSkuList(_serialization.Model): """The list of integration service environment skus. :ivar value: The list of integration service environment skus. @@ -6144,14 +6034,14 @@ class IntegrationServiceEnvironmentSkuList(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[IntegrationServiceEnvironmentSkuDefinition]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[IntegrationServiceEnvironmentSkuDefinition]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["IntegrationServiceEnvironmentSkuDefinition"]] = None, + value: Optional[List["_models.IntegrationServiceEnvironmentSkuDefinition"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -6161,12 +6051,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(IntegrationServiceEnvironmentSkuList, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class IntegrationServiceEnvironmentSubnetNetworkHealth(msrest.serialization.Model): +class IntegrationServiceEnvironmentSubnetNetworkHealth(_serialization.Model): """The integration service environment subnet network health. All required parameters must be populated in order to send to Azure. @@ -6177,28 +6067,36 @@ class IntegrationServiceEnvironmentSubnetNetworkHealth(msrest.serialization.Mode :ivar outbound_network_health: The integration service environment network health. :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". + :ivar network_dependency_health_state: The integration service environment network health + state. Required. Known values are: "NotSpecified", "Unknown", "Available", and "NotAvailable". :vartype network_dependency_health_state: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState """ _validation = { - 'network_dependency_health_state': {'required': True}, + "network_dependency_health_state": {"required": True}, } _attribute_map = { - 'outbound_network_dependencies': {'key': 'outboundNetworkDependencies', 'type': '[IntegrationServiceEnvironmentNetworkDependency]'}, - 'outbound_network_health': {'key': 'outboundNetworkHealth', 'type': 'IntegrationServiceEnvironmentNetworkDependencyHealth'}, - 'network_dependency_health_state': {'key': 'networkDependencyHealthState', 'type': 'str'}, + "outbound_network_dependencies": { + "key": "outboundNetworkDependencies", + "type": "[IntegrationServiceEnvironmentNetworkDependency]", + }, + "outbound_network_health": { + "key": "outboundNetworkHealth", + "type": "IntegrationServiceEnvironmentNetworkDependencyHealth", + }, + "network_dependency_health_state": {"key": "networkDependencyHealthState", "type": "str"}, } 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 ): """ @@ -6208,18 +6106,18 @@ def __init__( :keyword outbound_network_health: The integration service environment network health. :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". + :keyword network_dependency_health_state: The integration service environment network health + state. Required. Known values are: "NotSpecified", "Unknown", "Available", and "NotAvailable". :paramtype network_dependency_health_state: str or ~azure.mgmt.logic.models.IntegrationServiceEnvironmentNetworkEndPointAccessibilityState """ - super(IntegrationServiceEnvironmentSubnetNetworkHealth, self).__init__(**kwargs) + super().__init__(**kwargs) self.outbound_network_dependencies = outbound_network_dependencies self.outbound_network_health = outbound_network_health self.network_dependency_health_state = network_dependency_health_state -class IpAddress(msrest.serialization.Model): +class IpAddress(_serialization.Model): """The ip address. :ivar address: The address. @@ -6227,24 +6125,19 @@ class IpAddress(msrest.serialization.Model): """ _attribute_map = { - 'address': {'key': 'address', 'type': 'str'}, + "address": {"key": "address", "type": "str"}, } - def __init__( - self, - *, - address: Optional[str] = None, - **kwargs - ): + def __init__(self, *, address: Optional[str] = None, **kwargs): """ :keyword address: The address. :paramtype address: str """ - super(IpAddress, self).__init__(**kwargs) + super().__init__(**kwargs) self.address = address -class IpAddressRange(msrest.serialization.Model): +class IpAddressRange(_serialization.Model): """The ip address range. :ivar address_range: The IP address range. @@ -6252,24 +6145,19 @@ class IpAddressRange(msrest.serialization.Model): """ _attribute_map = { - 'address_range': {'key': 'addressRange', 'type': 'str'}, + "address_range": {"key": "addressRange", "type": "str"}, } - def __init__( - self, - *, - address_range: Optional[str] = None, - **kwargs - ): + def __init__(self, *, address_range: Optional[str] = None, **kwargs): """ :keyword address_range: The IP address range. :paramtype address_range: str """ - super(IpAddressRange, self).__init__(**kwargs) + super().__init__(**kwargs) self.address_range = address_range -class JsonSchema(msrest.serialization.Model): +class JsonSchema(_serialization.Model): """The JSON schema. :ivar title: The JSON title. @@ -6279,29 +6167,23 @@ class JsonSchema(msrest.serialization.Model): """ _attribute_map = { - 'title': {'key': 'title', 'type': 'str'}, - 'content': {'key': 'content', 'type': 'str'}, + "title": {"key": "title", "type": "str"}, + "content": {"key": "content", "type": "str"}, } - def __init__( - self, - *, - title: Optional[str] = None, - content: Optional[str] = None, - **kwargs - ): + def __init__(self, *, title: Optional[str] = None, content: Optional[str] = None, **kwargs): """ :keyword title: The JSON title. :paramtype title: str :keyword content: The JSON content. :paramtype content: str """ - super(JsonSchema, self).__init__(**kwargs) + super().__init__(**kwargs) self.title = title self.content = content -class KeyVaultKey(msrest.serialization.Model): +class KeyVaultKey(_serialization.Model): """The key vault key. :ivar kid: The key id. @@ -6311,16 +6193,12 @@ class KeyVaultKey(msrest.serialization.Model): """ _attribute_map = { - 'kid': {'key': 'kid', 'type': 'str'}, - 'attributes': {'key': 'attributes', 'type': 'KeyVaultKeyAttributes'}, + "kid": {"key": "kid", "type": "str"}, + "attributes": {"key": "attributes", "type": "KeyVaultKeyAttributes"}, } def __init__( - self, - *, - kid: Optional[str] = None, - attributes: Optional["KeyVaultKeyAttributes"] = None, - **kwargs + self, *, kid: Optional[str] = None, attributes: Optional["_models.KeyVaultKeyAttributes"] = None, **kwargs ): """ :keyword kid: The key id. @@ -6328,51 +6206,46 @@ def __init__( :keyword attributes: The key attributes. :paramtype attributes: ~azure.mgmt.logic.models.KeyVaultKeyAttributes """ - super(KeyVaultKey, self).__init__(**kwargs) + super().__init__(**kwargs) self.kid = kid self.attributes = attributes -class KeyVaultKeyAttributes(msrest.serialization.Model): +class KeyVaultKeyAttributes(_serialization.Model): """The key attributes. :ivar enabled: Whether the key is enabled or not. :vartype enabled: bool :ivar created: When the key was created. - :vartype created: long + :vartype created: int :ivar updated: When the key was updated. - :vartype updated: long + :vartype updated: int """ _attribute_map = { - 'enabled': {'key': 'enabled', 'type': 'bool'}, - 'created': {'key': 'created', 'type': 'long'}, - 'updated': {'key': 'updated', 'type': 'long'}, + "enabled": {"key": "enabled", "type": "bool"}, + "created": {"key": "created", "type": "int"}, + "updated": {"key": "updated", "type": "int"}, } def __init__( - self, - *, - enabled: Optional[bool] = None, - created: Optional[int] = None, - updated: Optional[int] = None, - **kwargs + self, *, enabled: Optional[bool] = None, created: Optional[int] = None, updated: Optional[int] = None, **kwargs ): """ :keyword enabled: Whether the key is enabled or not. :paramtype enabled: bool :keyword created: When the key was created. - :paramtype created: long + :paramtype created: int :keyword updated: When the key was updated. - :paramtype updated: long + :paramtype updated: int """ - super(KeyVaultKeyAttributes, self).__init__(**kwargs) + super().__init__(**kwargs) self.enabled = enabled self.created = created self.updated = updated -class KeyVaultKeyCollection(msrest.serialization.Model): +class KeyVaultKeyCollection(_serialization.Model): """Collection of key vault keys. :ivar value: The key vault keys. @@ -6382,16 +6255,12 @@ class KeyVaultKeyCollection(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[KeyVaultKey]'}, - 'skip_token': {'key': 'skipToken', 'type': 'str'}, + "value": {"key": "value", "type": "[KeyVaultKey]"}, + "skip_token": {"key": "skipToken", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["KeyVaultKey"]] = None, - skip_token: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.KeyVaultKey"]] = None, skip_token: Optional[str] = None, **kwargs ): """ :keyword value: The key vault keys. @@ -6399,58 +6268,58 @@ def __init__( :keyword skip_token: The skip token. :paramtype skip_token: str """ - super(KeyVaultKeyCollection, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.skip_token = skip_token -class KeyVaultKeyReference(msrest.serialization.Model): +class KeyVaultKeyReference(_serialization.Model): """The reference to the key vault key. All required parameters must be populated in order to send to Azure. - :ivar key_vault: Required. The key vault reference. + :ivar key_vault: The key vault reference. Required. :vartype key_vault: ~azure.mgmt.logic.models.KeyVaultKeyReferenceKeyVault - :ivar key_name: Required. The private key name in key vault. + :ivar key_name: The private key name in key vault. Required. :vartype key_name: str :ivar key_version: The private key version in key vault. :vartype key_version: str """ _validation = { - 'key_vault': {'required': True}, - 'key_name': {'required': True}, + "key_vault": {"required": True}, + "key_name": {"required": True}, } _attribute_map = { - 'key_vault': {'key': 'keyVault', 'type': 'KeyVaultKeyReferenceKeyVault'}, - 'key_name': {'key': 'keyName', 'type': 'str'}, - 'key_version': {'key': 'keyVersion', 'type': 'str'}, + "key_vault": {"key": "keyVault", "type": "KeyVaultKeyReferenceKeyVault"}, + "key_name": {"key": "keyName", "type": "str"}, + "key_version": {"key": "keyVersion", "type": "str"}, } def __init__( self, *, - key_vault: "KeyVaultKeyReferenceKeyVault", + key_vault: "_models.KeyVaultKeyReferenceKeyVault", key_name: str, key_version: Optional[str] = None, **kwargs ): """ - :keyword key_vault: Required. The key vault reference. + :keyword key_vault: The key vault reference. Required. :paramtype key_vault: ~azure.mgmt.logic.models.KeyVaultKeyReferenceKeyVault - :keyword key_name: Required. The private key name in key vault. + :keyword key_name: The private key name in key vault. Required. :paramtype key_name: str :keyword key_version: The private key version in key vault. :paramtype key_version: str """ - super(KeyVaultKeyReference, self).__init__(**kwargs) + super().__init__(**kwargs) self.key_vault = key_vault self.key_name = key_name self.key_version = key_version -class KeyVaultKeyReferenceKeyVault(msrest.serialization.Model): +class KeyVaultKeyReferenceKeyVault(_serialization.Model): """The key vault reference. Variables are only populated by the server, and will be ignored when sending a request. @@ -6464,27 +6333,22 @@ class KeyVaultKeyReferenceKeyVault(msrest.serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin """ :keyword id: The resource id. :paramtype id: str """ - super(KeyVaultKeyReferenceKeyVault, self).__init__(**kwargs) + super().__init__(**kwargs) self.id = id self.name = None self.type = None @@ -6504,63 +6368,52 @@ class KeyVaultReference(ResourceReference): """ _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin """ :keyword id: The resource id. :paramtype id: str """ - super(KeyVaultReference, self).__init__(id=id, **kwargs) + super().__init__(id=id, **kwargs) -class ListKeyVaultKeysDefinition(msrest.serialization.Model): +class ListKeyVaultKeysDefinition(_serialization.Model): """The list key vault keys definition. All required parameters must be populated in order to send to Azure. - :ivar key_vault: Required. The key vault reference. + :ivar key_vault: The key vault reference. Required. :vartype key_vault: ~azure.mgmt.logic.models.KeyVaultReference :ivar skip_token: The skip token. :vartype skip_token: str """ _validation = { - 'key_vault': {'required': True}, + "key_vault": {"required": True}, } _attribute_map = { - 'key_vault': {'key': 'keyVault', 'type': 'KeyVaultReference'}, - 'skip_token': {'key': 'skipToken', 'type': 'str'}, + "key_vault": {"key": "keyVault", "type": "KeyVaultReference"}, + "skip_token": {"key": "skipToken", "type": "str"}, } - def __init__( - self, - *, - key_vault: "KeyVaultReference", - skip_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, key_vault: "_models.KeyVaultReference", skip_token: Optional[str] = None, **kwargs): """ - :keyword key_vault: Required. The key vault reference. + :keyword key_vault: The key vault reference. Required. :paramtype key_vault: ~azure.mgmt.logic.models.KeyVaultReference :keyword skip_token: The skip token. :paramtype skip_token: str """ - super(ListKeyVaultKeysDefinition, self).__init__(**kwargs) + super().__init__(**kwargs) self.key_vault = key_vault self.skip_token = skip_token @@ -6578,25 +6431,25 @@ class ManagedApi(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar properties: The api resource properties. :vartype properties: ~azure.mgmt.logic.models.ApiResourceProperties """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'ApiResourceProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "ApiResourceProperties"}, } def __init__( @@ -6604,22 +6457,22 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - properties: Optional["ApiResourceProperties"] = None, + properties: Optional["_models.ApiResourceProperties"] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword properties: The api resource properties. :paramtype properties: ~azure.mgmt.logic.models.ApiResourceProperties """ - super(ManagedApi, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.properties = properties -class ManagedApiListResult(msrest.serialization.Model): +class ManagedApiListResult(_serialization.Model): """The list of managed APIs. :ivar value: The managed APIs. @@ -6629,16 +6482,12 @@ class ManagedApiListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[ManagedApi]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ManagedApi]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["ManagedApi"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.ManagedApi"]] = None, next_link: Optional[str] = None, **kwargs ): """ :keyword value: The managed APIs. @@ -6646,21 +6495,21 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(ManagedApiListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class ManagedServiceIdentity(msrest.serialization.Model): +class ManagedServiceIdentity(_serialization.Model): """Managed service identity properties. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. - :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". + :ivar type: Type of managed service identity. The type 'SystemAssigned' includes an implicitly + created identity. The type 'None' will remove any identities from the resource. Required. Known + values are: "SystemAssigned", "UserAssigned", and "None". :vartype type: str or ~azure.mgmt.logic.models.ManagedServiceIdentityType :ivar tenant_id: Tenant of managed service identity. :vartype tenant_id: str @@ -6673,43 +6522,43 @@ class ManagedServiceIdentity(msrest.serialization.Model): """ _validation = { - 'type': {'required': True}, - 'tenant_id': {'readonly': True}, - 'principal_id': {'readonly': True}, + "type": {"required": True}, + "tenant_id": {"readonly": True}, + "principal_id": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "type": {"key": "type", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "principal_id": {"key": "principalId", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, } 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". + :keyword type: Type of managed service identity. The type 'SystemAssigned' includes an + implicitly created identity. The type 'None' will remove any identities from the resource. + Required. Known values are: "SystemAssigned", "UserAssigned", and "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: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. :paramtype user_assigned_identities: dict[str, ~azure.mgmt.logic.models.UserAssignedIdentity] """ - super(ManagedServiceIdentity, self).__init__(**kwargs) + super().__init__(**kwargs) self.type = type self.tenant_id = None self.principal_id = None self.user_assigned_identities = user_assigned_identities -class NetworkConfiguration(msrest.serialization.Model): +class NetworkConfiguration(_serialization.Model): """The network configuration. :ivar virtual_network_address_space: Gets the virtual network address space. @@ -6721,17 +6570,17 @@ class NetworkConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'virtual_network_address_space': {'key': 'virtualNetworkAddressSpace', 'type': 'str'}, - 'access_endpoint': {'key': 'accessEndpoint', 'type': 'IntegrationServiceEnvironmentAccessEndpoint'}, - 'subnets': {'key': 'subnets', 'type': '[ResourceReference]'}, + "virtual_network_address_space": {"key": "virtualNetworkAddressSpace", "type": "str"}, + "access_endpoint": {"key": "accessEndpoint", "type": "IntegrationServiceEnvironmentAccessEndpoint"}, + "subnets": {"key": "subnets", "type": "[ResourceReference]"}, } 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 ): """ @@ -6743,13 +6592,13 @@ def __init__( :keyword subnets: The subnets. :paramtype subnets: list[~azure.mgmt.logic.models.ResourceReference] """ - super(NetworkConfiguration, self).__init__(**kwargs) + super().__init__(**kwargs) self.virtual_network_address_space = virtual_network_address_space self.access_endpoint = access_endpoint self.subnets = subnets -class OpenAuthenticationAccessPolicies(msrest.serialization.Model): +class OpenAuthenticationAccessPolicies(_serialization.Model): """AuthenticationPolicy of type Open. :ivar policies: Open authentication policies. @@ -6757,56 +6606,51 @@ class OpenAuthenticationAccessPolicies(msrest.serialization.Model): """ _attribute_map = { - 'policies': {'key': 'policies', 'type': '{OpenAuthenticationAccessPolicy}'}, + "policies": {"key": "policies", "type": "{OpenAuthenticationAccessPolicy}"}, } - def __init__( - self, - *, - policies: Optional[Dict[str, "OpenAuthenticationAccessPolicy"]] = None, - **kwargs - ): + def __init__(self, *, policies: Optional[Dict[str, "_models.OpenAuthenticationAccessPolicy"]] = None, **kwargs): """ :keyword policies: Open authentication policies. :paramtype policies: dict[str, ~azure.mgmt.logic.models.OpenAuthenticationAccessPolicy] """ - super(OpenAuthenticationAccessPolicies, self).__init__(**kwargs) + super().__init__(**kwargs) self.policies = policies -class OpenAuthenticationAccessPolicy(msrest.serialization.Model): +class OpenAuthenticationAccessPolicy(_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. "AAD" :vartype type: str or ~azure.mgmt.logic.models.OpenAuthenticationProviderType :ivar claims: The access policy claims. :vartype claims: list[~azure.mgmt.logic.models.OpenAuthenticationPolicyClaim] """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'claims': {'key': 'claims', 'type': '[OpenAuthenticationPolicyClaim]'}, + "type": {"key": "type", "type": "str"}, + "claims": {"key": "claims", "type": "[OpenAuthenticationPolicyClaim]"}, } 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. "AAD" :paramtype type: str or ~azure.mgmt.logic.models.OpenAuthenticationProviderType :keyword claims: The access policy claims. :paramtype claims: list[~azure.mgmt.logic.models.OpenAuthenticationPolicyClaim] """ - super(OpenAuthenticationAccessPolicy, self).__init__(**kwargs) + super().__init__(**kwargs) self.type = type self.claims = claims -class OpenAuthenticationPolicyClaim(msrest.serialization.Model): +class OpenAuthenticationPolicyClaim(_serialization.Model): """Open authentication policy claim. :ivar name: The name of the claim. @@ -6816,29 +6660,23 @@ class OpenAuthenticationPolicyClaim(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, } - def __init__( - self, - *, - name: Optional[str] = None, - value: Optional[str] = None, - **kwargs - ): + def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs): """ :keyword name: The name of the claim. :paramtype name: str :keyword value: The value of the claim. :paramtype value: str """ - super(OpenAuthenticationPolicyClaim, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = name self.value = value -class Operation(msrest.serialization.Model): +class Operation(_serialization.Model): """Logic REST API operation. :ivar origin: Operation: origin. @@ -6848,14 +6686,14 @@ class Operation(msrest.serialization.Model): :ivar display: The object that represents the operation. :vartype display: ~azure.mgmt.logic.models.OperationDisplay :ivar properties: The properties. - :vartype properties: any + :vartype properties: JSON """ _attribute_map = { - 'origin': {'key': 'origin', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'properties': {'key': 'properties', 'type': 'object'}, + "origin": {"key": "origin", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "properties": {"key": "properties", "type": "object"}, } def __init__( @@ -6863,8 +6701,8 @@ def __init__( *, origin: Optional[str] = None, name: Optional[str] = None, - display: Optional["OperationDisplay"] = None, - properties: Optional[Any] = None, + display: Optional["_models.OperationDisplay"] = None, + properties: Optional[JSON] = None, **kwargs ): """ @@ -6875,16 +6713,16 @@ def __init__( :keyword display: The object that represents the operation. :paramtype display: ~azure.mgmt.logic.models.OperationDisplay :keyword properties: The properties. - :paramtype properties: any + :paramtype properties: JSON """ - super(Operation, self).__init__(**kwargs) + super().__init__(**kwargs) self.origin = origin self.name = name self.display = display self.properties = properties -class OperationDisplay(msrest.serialization.Model): +class OperationDisplay(_serialization.Model): """The object that represents the operation. :ivar provider: Service provider: Microsoft.Logic. @@ -6898,10 +6736,10 @@ class OperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } def __init__( @@ -6923,14 +6761,14 @@ def __init__( :keyword description: Operation: description. :paramtype description: str """ - super(OperationDisplay, self).__init__(**kwargs) + super().__init__(**kwargs) self.provider = provider self.resource = resource self.operation = operation self.description = description -class OperationListResult(msrest.serialization.Model): +class OperationListResult(_serialization.Model): """Result of the request to list Logic operations. It contains a list of operations and a URL link to get the next set of results. :ivar value: List of Logic operations supported by the Logic resource provider. @@ -6940,29 +6778,23 @@ class OperationListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["Operation"]] = None, - next_link: Optional[str] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.Operation"]] = None, next_link: Optional[str] = None, **kwargs): """ :keyword value: List of Logic operations supported by the Logic resource provider. :paramtype value: list[~azure.mgmt.logic.models.Operation] :keyword next_link: URL to get the next set of operation list results if there are any. :paramtype next_link: str """ - super(OperationListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class OperationResultProperties(msrest.serialization.Model): +class OperationResultProperties(_serialization.Model): """The run operation result properties. :ivar start_time: The start time of the workflow scope repetition. @@ -6971,9 +6803,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", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: The workflow scope repetition code. :vartype code: str @@ -6982,12 +6814,12 @@ class OperationResultProperties(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code': {'key': 'code', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'object'}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "correlation": {"key": "correlation", "type": "RunActionCorrelation"}, + "status": {"key": "status", "type": "str"}, + "code": {"key": "code", "type": "str"}, + "error": {"key": "error", "type": "object"}, } def __init__( @@ -6995,8 +6827,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,16 +6840,16 @@ 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", and "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus :keyword code: The workflow scope repetition code. :paramtype code: str :keyword error: Anything. :paramtype error: any """ - super(OperationResultProperties, self).__init__(**kwargs) + super().__init__(**kwargs) self.start_time = start_time self.end_time = end_time self.correlation = correlation @@ -7026,7 +6858,7 @@ def __init__( self.error = error -class OperationResult(OperationResultProperties): +class OperationResult(OperationResultProperties): # pylint: disable=too-many-instance-attributes """The operation result definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -7037,9 +6869,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", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: The workflow scope repetition code. :vartype code: str @@ -7048,15 +6880,15 @@ class OperationResult(OperationResultProperties): :ivar tracking_id: Gets the tracking id. :vartype tracking_id: str :ivar inputs: Gets the inputs. - :vartype inputs: any + :vartype inputs: JSON :ivar inputs_link: Gets the link to inputs. :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink :ivar outputs: Gets the outputs. - :vartype outputs: any + :vartype outputs: JSON :ivar outputs_link: Gets the link to outputs. :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink :ivar tracked_properties: Gets the tracked properties. - :vartype tracked_properties: any + :vartype tracked_properties: JSON :ivar retry_history: Gets the retry histories. :vartype retry_history: list[~azure.mgmt.logic.models.RetryHistory] :ivar iteration_count: @@ -7064,29 +6896,29 @@ class OperationResult(OperationResultProperties): """ _validation = { - 'tracking_id': {'readonly': True}, - 'inputs': {'readonly': True}, - 'inputs_link': {'readonly': True}, - 'outputs': {'readonly': True}, - 'outputs_link': {'readonly': True}, - 'tracked_properties': {'readonly': True}, + "tracking_id": {"readonly": True}, + "inputs": {"readonly": True}, + "inputs_link": {"readonly": True}, + "outputs": {"readonly": True}, + "outputs_link": {"readonly": True}, + "tracked_properties": {"readonly": True}, } _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code': {'key': 'code', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'object'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': 'object'}, - 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, - 'outputs': {'key': 'outputs', 'type': 'object'}, - 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, - 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, - 'retry_history': {'key': 'retryHistory', 'type': '[RetryHistory]'}, - 'iteration_count': {'key': 'iterationCount', 'type': 'int'}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "correlation": {"key": "correlation", "type": "RunActionCorrelation"}, + "status": {"key": "status", "type": "str"}, + "code": {"key": "code", "type": "str"}, + "error": {"key": "error", "type": "object"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "inputs": {"key": "inputs", "type": "object"}, + "inputs_link": {"key": "inputsLink", "type": "ContentLink"}, + "outputs": {"key": "outputs", "type": "object"}, + "outputs_link": {"key": "outputsLink", "type": "ContentLink"}, + "tracked_properties": {"key": "trackedProperties", "type": "object"}, + "retry_history": {"key": "retryHistory", "type": "[RetryHistory]"}, + "iteration_count": {"key": "iterationCount", "type": "int"}, } def __init__( @@ -7094,11 +6926,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 +6941,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", and "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus :keyword code: The workflow scope repetition code. :paramtype code: str @@ -7122,7 +6954,15 @@ def __init__( :keyword iteration_count: :paramtype iteration_count: int """ - super(OperationResult, self).__init__(start_time=start_time, end_time=end_time, correlation=correlation, status=status, code=code, error=error, **kwargs) + super().__init__( + start_time=start_time, + end_time=end_time, + correlation=correlation, + status=status, + code=code, + error=error, + **kwargs + ) self.tracking_id = None self.inputs = None self.inputs_link = None @@ -7133,7 +6973,7 @@ def __init__( self.iteration_count = iteration_count -class PartnerContent(msrest.serialization.Model): +class PartnerContent(_serialization.Model): """The integration account partner content. :ivar b2_b: The B2B partner content. @@ -7141,24 +6981,19 @@ class PartnerContent(msrest.serialization.Model): """ _attribute_map = { - 'b2_b': {'key': 'b2b', 'type': 'B2BPartnerContent'}, + "b2_b": {"key": "b2b", "type": "B2BPartnerContent"}, } - def __init__( - self, - *, - b2_b: Optional["B2BPartnerContent"] = None, - **kwargs - ): + def __init__(self, *, b2_b: Optional["_models.B2BPartnerContent"] = None, **kwargs): """ :keyword b2_b: The B2B partner content. :paramtype b2_b: ~azure.mgmt.logic.models.B2BPartnerContent """ - super(PartnerContent, self).__init__(**kwargs) + super().__init__(**kwargs) self.b2_b = b2_b -class RecurrenceSchedule(msrest.serialization.Model): +class RecurrenceSchedule(_serialization.Model): """The recurrence schedule. :ivar minutes: The minutes. @@ -7174,11 +7009,11 @@ class RecurrenceSchedule(msrest.serialization.Model): """ _attribute_map = { - 'minutes': {'key': 'minutes', 'type': '[int]'}, - 'hours': {'key': 'hours', 'type': '[int]'}, - 'week_days': {'key': 'weekDays', 'type': '[str]'}, - 'month_days': {'key': 'monthDays', 'type': '[int]'}, - 'monthly_occurrences': {'key': 'monthlyOccurrences', 'type': '[RecurrenceScheduleOccurrence]'}, + "minutes": {"key": "minutes", "type": "[int]"}, + "hours": {"key": "hours", "type": "[int]"}, + "week_days": {"key": "weekDays", "type": "[str]"}, + "month_days": {"key": "monthDays", "type": "[int]"}, + "monthly_occurrences": {"key": "monthlyOccurrences", "type": "[RecurrenceScheduleOccurrence]"}, } def __init__( @@ -7186,9 +7021,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 ): """ @@ -7203,7 +7038,7 @@ def __init__( :keyword monthly_occurrences: The monthly occurrences. :paramtype monthly_occurrences: list[~azure.mgmt.logic.models.RecurrenceScheduleOccurrence] """ - super(RecurrenceSchedule, self).__init__(**kwargs) + super().__init__(**kwargs) self.minutes = minutes self.hours = hours self.week_days = week_days @@ -7211,109 +7046,93 @@ def __init__( self.monthly_occurrences = monthly_occurrences -class RecurrenceScheduleOccurrence(msrest.serialization.Model): +class RecurrenceScheduleOccurrence(_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", and "Saturday". :vartype day: str or ~azure.mgmt.logic.models.DayOfWeek :ivar occurrence: The occurrence. :vartype occurrence: int """ _attribute_map = { - 'day': {'key': 'day', 'type': 'str'}, - 'occurrence': {'key': 'occurrence', 'type': 'int'}, + "day": {"key": "day", "type": "str"}, + "occurrence": {"key": "occurrence", "type": "int"}, } def __init__( - self, - *, - day: Optional[Union[str, "DayOfWeek"]] = None, - occurrence: Optional[int] = None, - **kwargs + self, *, 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", - "Wednesday", "Thursday", "Friday", "Saturday". + :keyword day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", and "Saturday". :paramtype day: str or ~azure.mgmt.logic.models.DayOfWeek :keyword occurrence: The occurrence. :paramtype occurrence: int """ - super(RecurrenceScheduleOccurrence, self).__init__(**kwargs) + super().__init__(**kwargs) self.day = day self.occurrence = occurrence -class RegenerateActionParameter(msrest.serialization.Model): +class RegenerateActionParameter(_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", and "Secondary". :vartype key_type: str or ~azure.mgmt.logic.models.KeyType """ _attribute_map = { - 'key_type': {'key': 'keyType', 'type': 'str'}, + "key_type": {"key": "keyType", "type": "str"}, } - def __init__( - self, - *, - key_type: Optional[Union[str, "KeyType"]] = None, - **kwargs - ): + def __init__(self, *, 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", and "Secondary". :paramtype key_type: str or ~azure.mgmt.logic.models.KeyType """ - super(RegenerateActionParameter, self).__init__(**kwargs) + super().__init__(**kwargs) self.key_type = key_type -class RepetitionIndex(msrest.serialization.Model): +class RepetitionIndex(_serialization.Model): """The workflow run action repetition index. All required parameters must be populated in order to send to Azure. :ivar scope_name: The scope. :vartype scope_name: str - :ivar item_index: Required. The index. + :ivar item_index: The index. Required. :vartype item_index: int """ _validation = { - 'item_index': {'required': True}, + "item_index": {"required": True}, } _attribute_map = { - 'scope_name': {'key': 'scopeName', 'type': 'str'}, - 'item_index': {'key': 'itemIndex', 'type': 'int'}, + "scope_name": {"key": "scopeName", "type": "str"}, + "item_index": {"key": "itemIndex", "type": "int"}, } - def __init__( - self, - *, - item_index: int, - scope_name: Optional[str] = None, - **kwargs - ): + def __init__(self, *, item_index: int, scope_name: Optional[str] = None, **kwargs): """ :keyword scope_name: The scope. :paramtype scope_name: str - :keyword item_index: Required. The index. + :keyword item_index: The index. Required. :paramtype item_index: int """ - super(RepetitionIndex, self).__init__(**kwargs) + super().__init__(**kwargs) self.scope_name = scope_name self.item_index = item_index -class Request(msrest.serialization.Model): +class Request(_serialization.Model): """A request. :ivar headers: A list of all the headers attached to the request. - :vartype headers: any + :vartype headers: JSON :ivar uri: The destination for the request. :vartype uri: str :ivar method: The HTTP method used for the request. @@ -7321,28 +7140,23 @@ class Request(msrest.serialization.Model): """ _attribute_map = { - 'headers': {'key': 'headers', 'type': 'object'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'method': {'key': 'method', 'type': 'str'}, + "headers": {"key": "headers", "type": "object"}, + "uri": {"key": "uri", "type": "str"}, + "method": {"key": "method", "type": "str"}, } def __init__( - self, - *, - headers: Optional[Any] = None, - uri: Optional[str] = None, - method: Optional[str] = None, - **kwargs + self, *, headers: Optional[JSON] = None, uri: Optional[str] = None, method: Optional[str] = None, **kwargs ): """ :keyword headers: A list of all the headers attached to the request. - :paramtype headers: any + :paramtype headers: JSON :keyword uri: The destination for the request. :paramtype uri: str :keyword method: The HTTP method used for the request. :paramtype method: str """ - super(Request, self).__init__(**kwargs) + super().__init__(**kwargs) self.headers = headers self.uri = uri self.method = method @@ -7361,25 +7175,25 @@ class RequestHistory(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar properties: The request history properties. :vartype properties: ~azure.mgmt.logic.models.RequestHistoryProperties """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'properties': {'key': 'properties', 'type': 'RequestHistoryProperties'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "RequestHistoryProperties"}, } def __init__( @@ -7387,22 +7201,22 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - properties: Optional["RequestHistoryProperties"] = None, + properties: Optional["_models.RequestHistoryProperties"] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword properties: The request history properties. :paramtype properties: ~azure.mgmt.logic.models.RequestHistoryProperties """ - super(RequestHistory, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.properties = properties -class RequestHistoryListResult(msrest.serialization.Model): +class RequestHistoryListResult(_serialization.Model): """The list of workflow request histories. :ivar value: A list of workflow request histories. @@ -7412,16 +7226,12 @@ class RequestHistoryListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[RequestHistory]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[RequestHistory]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["RequestHistory"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.RequestHistory"]] = None, next_link: Optional[str] = None, **kwargs ): """ :keyword value: A list of workflow request histories. @@ -7429,12 +7239,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(RequestHistoryListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class RequestHistoryProperties(msrest.serialization.Model): +class RequestHistoryProperties(_serialization.Model): """The request history. :ivar start_time: The time the request started. @@ -7448,10 +7258,10 @@ class RequestHistoryProperties(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'request': {'key': 'request', 'type': 'Request'}, - 'response': {'key': 'response', 'type': 'Response'}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "request": {"key": "request", "type": "Request"}, + "response": {"key": "response", "type": "Response"}, } def __init__( @@ -7459,8 +7269,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 ): """ @@ -7473,18 +7283,18 @@ def __init__( :keyword response: The response. :paramtype response: ~azure.mgmt.logic.models.Response """ - super(RequestHistoryProperties, self).__init__(**kwargs) + super().__init__(**kwargs) self.start_time = start_time self.end_time = end_time self.request = request self.response = response -class Response(msrest.serialization.Model): +class Response(_serialization.Model): """A response. :ivar headers: A list of all the headers attached to the response. - :vartype headers: any + :vartype headers: JSON :ivar status_code: The status code of the response. :vartype status_code: int :ivar body_link: Details on the location of the body content. @@ -7492,34 +7302,34 @@ class Response(msrest.serialization.Model): """ _attribute_map = { - 'headers': {'key': 'headers', 'type': 'object'}, - 'status_code': {'key': 'statusCode', 'type': 'int'}, - 'body_link': {'key': 'bodyLink', 'type': 'ContentLink'}, + "headers": {"key": "headers", "type": "object"}, + "status_code": {"key": "statusCode", "type": "int"}, + "body_link": {"key": "bodyLink", "type": "ContentLink"}, } def __init__( self, *, - headers: Optional[Any] = None, + headers: Optional[JSON] = None, status_code: Optional[int] = None, - body_link: Optional["ContentLink"] = None, + body_link: Optional["_models.ContentLink"] = None, **kwargs ): """ :keyword headers: A list of all the headers attached to the response. - :paramtype headers: any + :paramtype headers: JSON :keyword status_code: The status code of the response. :paramtype status_code: int :keyword body_link: Details on the location of the body content. :paramtype body_link: ~azure.mgmt.logic.models.ContentLink """ - super(Response, self).__init__(**kwargs) + super().__init__(**kwargs) self.headers = headers self.status_code = status_code self.body_link = body_link -class RetryHistory(msrest.serialization.Model): +class RetryHistory(_serialization.Model): """The retry history. :ivar start_time: Gets the start time. @@ -7537,12 +7347,12 @@ class RetryHistory(msrest.serialization.Model): """ _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'code': {'key': 'code', 'type': 'str'}, - 'client_request_id': {'key': 'clientRequestId', 'type': 'str'}, - 'service_request_id': {'key': 'serviceRequestId', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'ErrorResponse'}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "code": {"key": "code", "type": "str"}, + "client_request_id": {"key": "clientRequestId", "type": "str"}, + "service_request_id": {"key": "serviceRequestId", "type": "str"}, + "error": {"key": "error", "type": "ErrorResponse"}, } def __init__( @@ -7553,7 +7363,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 ): """ @@ -7570,7 +7380,7 @@ def __init__( :keyword error: Gets the error response. :paramtype error: ~azure.mgmt.logic.models.ErrorResponse """ - super(RetryHistory, self).__init__(**kwargs) + super().__init__(**kwargs) self.start_time = start_time self.end_time = end_time self.code = code @@ -7579,7 +7389,7 @@ def __init__( self.error = error -class RunCorrelation(msrest.serialization.Model): +class RunCorrelation(_serialization.Model): """The correlation properties. :ivar client_tracking_id: The client tracking identifier. @@ -7589,16 +7399,12 @@ class RunCorrelation(msrest.serialization.Model): """ _attribute_map = { - 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, - 'client_keywords': {'key': 'clientKeywords', 'type': '[str]'}, + "client_tracking_id": {"key": "clientTrackingId", "type": "str"}, + "client_keywords": {"key": "clientKeywords", "type": "[str]"}, } def __init__( - self, - *, - client_tracking_id: Optional[str] = None, - client_keywords: Optional[List[str]] = None, - **kwargs + self, *, client_tracking_id: Optional[str] = None, client_keywords: Optional[List[str]] = None, **kwargs ): """ :keyword client_tracking_id: The client tracking identifier. @@ -7606,7 +7412,7 @@ def __init__( :keyword client_keywords: The client keywords. :paramtype client_keywords: list[str] """ - super(RunCorrelation, self).__init__(**kwargs) + super().__init__(**kwargs) self.client_tracking_id = client_tracking_id self.client_keywords = client_keywords @@ -7623,9 +7429,9 @@ class RunActionCorrelation(RunCorrelation): """ _attribute_map = { - 'client_tracking_id': {'key': 'clientTrackingId', 'type': 'str'}, - 'client_keywords': {'key': 'clientKeywords', 'type': '[str]'}, - 'action_tracking_id': {'key': 'actionTrackingId', 'type': 'str'}, + "client_tracking_id": {"key": "clientTrackingId", "type": "str"}, + "client_keywords": {"key": "clientKeywords", "type": "[str]"}, + "action_tracking_id": {"key": "actionTrackingId", "type": "str"}, } def __init__( @@ -7644,82 +7450,73 @@ def __init__( :keyword action_tracking_id: The action tracking identifier. :paramtype action_tracking_id: str """ - super(RunActionCorrelation, self).__init__(client_tracking_id=client_tracking_id, client_keywords=client_keywords, **kwargs) + super().__init__(client_tracking_id=client_tracking_id, client_keywords=client_keywords, **kwargs) self.action_tracking_id = action_tracking_id -class SetTriggerStateActionDefinition(msrest.serialization.Model): +class SetTriggerStateActionDefinition(_serialization.Model): """The set trigger state action definition. All required parameters must be populated in order to send to Azure. - :ivar source: Required. The source. + :ivar source: The source. Required. :vartype source: ~azure.mgmt.logic.models.WorkflowTriggerReference """ _validation = { - 'source': {'required': True}, + "source": {"required": True}, } _attribute_map = { - 'source': {'key': 'source', 'type': 'WorkflowTriggerReference'}, + "source": {"key": "source", "type": "WorkflowTriggerReference"}, } - def __init__( - self, - *, - source: "WorkflowTriggerReference", - **kwargs - ): + def __init__(self, *, source: "_models.WorkflowTriggerReference", **kwargs): """ - :keyword source: Required. The source. + :keyword source: The source. Required. :paramtype source: ~azure.mgmt.logic.models.WorkflowTriggerReference """ - super(SetTriggerStateActionDefinition, self).__init__(**kwargs) + super().__init__(**kwargs) self.source = source -class Sku(msrest.serialization.Model): +class Sku(_serialization.Model): """The sku type. 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: The name. Required. Known values are: "NotSpecified", "Free", "Shared", "Basic", + "Standard", and "Premium". :vartype name: str or ~azure.mgmt.logic.models.SkuName :ivar plan: The reference to plan. :vartype plan: ~azure.mgmt.logic.models.ResourceReference """ _validation = { - 'name': {'required': True}, + "name": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'plan': {'key': 'plan', 'type': 'ResourceReference'}, + "name": {"key": "name", "type": "str"}, + "plan": {"key": "plan", "type": "ResourceReference"}, } def __init__( - self, - *, - name: Union[str, "SkuName"], - plan: Optional["ResourceReference"] = None, - **kwargs + self, *, 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: The name. Required. Known values are: "NotSpecified", "Free", "Shared", "Basic", + "Standard", and "Premium". :paramtype name: str or ~azure.mgmt.logic.models.SkuName :keyword plan: The reference to plan. :paramtype plan: ~azure.mgmt.logic.models.ResourceReference """ - super(Sku, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = name self.plan = plan -class SubResource(msrest.serialization.Model): +class SubResource(_serialization.Model): """The sub resource type. Variables are only populated by the server, and will be ignored when sending a request. @@ -7729,24 +7526,20 @@ class SubResource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, + "id": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(SubResource, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.id = None -class SwaggerCustomDynamicList(msrest.serialization.Model): +class SwaggerCustomDynamicList(_serialization.Model): """The swagger custom dynamic list. :ivar operation_id: The operation id to fetch dynamic schema. @@ -7765,12 +7558,12 @@ class SwaggerCustomDynamicList(msrest.serialization.Model): """ _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'built_in_operation': {'key': 'builtInOperation', 'type': 'str'}, - 'items_path': {'key': 'itemsPath', 'type': 'str'}, - 'item_value_path': {'key': 'itemValuePath', 'type': 'str'}, - 'item_title_path': {'key': 'itemTitlePath', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicProperties}'}, + "operation_id": {"key": "operationId", "type": "str"}, + "built_in_operation": {"key": "builtInOperation", "type": "str"}, + "items_path": {"key": "itemsPath", "type": "str"}, + "item_value_path": {"key": "itemValuePath", "type": "str"}, + "item_title_path": {"key": "itemTitlePath", "type": "str"}, + "parameters": {"key": "parameters", "type": "{SwaggerCustomDynamicProperties}"}, } def __init__( @@ -7781,7 +7574,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 ): """ @@ -7800,7 +7593,7 @@ def __init__( :keyword parameters: The parameters. :paramtype parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicProperties] """ - super(SwaggerCustomDynamicList, self).__init__(**kwargs) + super().__init__(**kwargs) self.operation_id = operation_id self.built_in_operation = built_in_operation self.items_path = items_path @@ -7809,7 +7602,7 @@ def __init__( self.parameters = parameters -class SwaggerCustomDynamicProperties(msrest.serialization.Model): +class SwaggerCustomDynamicProperties(_serialization.Model): """The swagger custom dynamic properties. :ivar operation_id: The operation id to fetch dynamic schema. @@ -7821,9 +7614,9 @@ class SwaggerCustomDynamicProperties(msrest.serialization.Model): """ _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'value_path': {'key': 'valuePath', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicProperties}'}, + "operation_id": {"key": "operationId", "type": "str"}, + "value_path": {"key": "valuePath", "type": "str"}, + "parameters": {"key": "parameters", "type": "{SwaggerCustomDynamicProperties}"}, } def __init__( @@ -7831,7 +7624,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 ): """ @@ -7842,13 +7635,13 @@ def __init__( :keyword parameters: The operation parameters. :paramtype parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicProperties] """ - super(SwaggerCustomDynamicProperties, self).__init__(**kwargs) + super().__init__(**kwargs) self.operation_id = operation_id self.value_path = value_path self.parameters = parameters -class SwaggerCustomDynamicSchema(msrest.serialization.Model): +class SwaggerCustomDynamicSchema(_serialization.Model): """The swagger custom dynamic schema. :ivar operation_id: The operation id to fetch dynamic schema. @@ -7856,13 +7649,13 @@ class SwaggerCustomDynamicSchema(msrest.serialization.Model): :ivar value_path: Json pointer to the dynamic schema on the response body. :vartype value_path: str :ivar parameters: The operation parameters. - :vartype parameters: dict[str, any] + :vartype parameters: dict[str, JSON] """ _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'value_path': {'key': 'valuePath', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': '{object}'}, + "operation_id": {"key": "operationId", "type": "str"}, + "value_path": {"key": "valuePath", "type": "str"}, + "parameters": {"key": "parameters", "type": "{object}"}, } def __init__( @@ -7870,7 +7663,7 @@ def __init__( *, operation_id: Optional[str] = None, value_path: Optional[str] = None, - parameters: Optional[Dict[str, Any]] = None, + parameters: Optional[Dict[str, JSON]] = None, **kwargs ): """ @@ -7879,15 +7672,15 @@ def __init__( :keyword value_path: Json pointer to the dynamic schema on the response body. :paramtype value_path: str :keyword parameters: The operation parameters. - :paramtype parameters: dict[str, any] + :paramtype parameters: dict[str, JSON] """ - super(SwaggerCustomDynamicSchema, self).__init__(**kwargs) + super().__init__(**kwargs) self.operation_id = operation_id self.value_path = value_path self.parameters = parameters -class SwaggerCustomDynamicTree(msrest.serialization.Model): +class SwaggerCustomDynamicTree(_serialization.Model): """The swagger custom dynamic tree. :ivar settings: The tree settings. @@ -7899,17 +7692,17 @@ class SwaggerCustomDynamicTree(msrest.serialization.Model): """ _attribute_map = { - 'settings': {'key': 'settings', 'type': 'SwaggerCustomDynamicTreeSettings'}, - 'open': {'key': 'open', 'type': 'SwaggerCustomDynamicTreeCommand'}, - 'browse': {'key': 'browse', 'type': 'SwaggerCustomDynamicTreeCommand'}, + "settings": {"key": "settings", "type": "SwaggerCustomDynamicTreeSettings"}, + "open": {"key": "open", "type": "SwaggerCustomDynamicTreeCommand"}, + "browse": {"key": "browse", "type": "SwaggerCustomDynamicTreeCommand"}, } 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 ): """ @@ -7920,13 +7713,13 @@ def __init__( :keyword browse: The tree on-browse configuration. :paramtype browse: ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeCommand """ - super(SwaggerCustomDynamicTree, self).__init__(**kwargs) + super().__init__(**kwargs) self.settings = settings self.open = open self.browse = browse -class SwaggerCustomDynamicTreeCommand(msrest.serialization.Model): +class SwaggerCustomDynamicTreeCommand(_serialization.Model): """The swagger tree command. :ivar operation_id: The path to an item property which defines the display name of the item. @@ -7950,14 +7743,14 @@ class SwaggerCustomDynamicTreeCommand(msrest.serialization.Model): """ _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - 'items_path': {'key': 'itemsPath', 'type': 'str'}, - 'item_value_path': {'key': 'itemValuePath', 'type': 'str'}, - 'item_title_path': {'key': 'itemTitlePath', 'type': 'str'}, - 'item_full_title_path': {'key': 'itemFullTitlePath', 'type': 'str'}, - 'item_is_parent': {'key': 'itemIsParent', 'type': 'str'}, - 'selectable_filter': {'key': 'selectableFilter', 'type': 'str'}, - 'parameters': {'key': 'parameters', 'type': '{SwaggerCustomDynamicTreeParameter}'}, + "operation_id": {"key": "operationId", "type": "str"}, + "items_path": {"key": "itemsPath", "type": "str"}, + "item_value_path": {"key": "itemValuePath", "type": "str"}, + "item_title_path": {"key": "itemTitlePath", "type": "str"}, + "item_full_title_path": {"key": "itemFullTitlePath", "type": "str"}, + "item_is_parent": {"key": "itemIsParent", "type": "str"}, + "selectable_filter": {"key": "selectableFilter", "type": "str"}, + "parameters": {"key": "parameters", "type": "{SwaggerCustomDynamicTreeParameter}"}, } def __init__( @@ -7970,7 +7763,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 ): """ @@ -7996,7 +7789,7 @@ def __init__( :keyword parameters: Dictionary of :code:``. :paramtype parameters: dict[str, ~azure.mgmt.logic.models.SwaggerCustomDynamicTreeParameter] """ - super(SwaggerCustomDynamicTreeCommand, self).__init__(**kwargs) + super().__init__(**kwargs) self.operation_id = operation_id self.items_path = items_path self.item_value_path = item_value_path @@ -8007,14 +7800,14 @@ def __init__( self.parameters = parameters -class SwaggerCustomDynamicTreeParameter(msrest.serialization.Model): +class SwaggerCustomDynamicTreeParameter(_serialization.Model): """The swagger custom dynamic tree parameter. :ivar selected_item_value_path: Gets or sets a path to a property in the currently selected item to pass as a value to a parameter for the given operation. :vartype selected_item_value_path: str :ivar value: The parameter value. - :vartype value: any + :vartype value: JSON :ivar parameter_reference: The parameter reference. :vartype parameter_reference: str :ivar required: Indicates whether the parameter is required. @@ -8022,17 +7815,17 @@ class SwaggerCustomDynamicTreeParameter(msrest.serialization.Model): """ _attribute_map = { - 'selected_item_value_path': {'key': 'selectedItemValuePath', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'parameter_reference': {'key': 'parameterReference', 'type': 'str'}, - 'required': {'key': 'required', 'type': 'bool'}, + "selected_item_value_path": {"key": "selectedItemValuePath", "type": "str"}, + "value": {"key": "value", "type": "object"}, + "parameter_reference": {"key": "parameterReference", "type": "str"}, + "required": {"key": "required", "type": "bool"}, } def __init__( self, *, selected_item_value_path: Optional[str] = None, - value: Optional[Any] = None, + value: Optional[JSON] = None, parameter_reference: Optional[str] = None, required: Optional[bool] = None, **kwargs @@ -8042,20 +7835,20 @@ def __init__( item to pass as a value to a parameter for the given operation. :paramtype selected_item_value_path: str :keyword value: The parameter value. - :paramtype value: any + :paramtype value: JSON :keyword parameter_reference: The parameter reference. :paramtype parameter_reference: str :keyword required: Indicates whether the parameter is required. :paramtype required: bool """ - super(SwaggerCustomDynamicTreeParameter, self).__init__(**kwargs) + super().__init__(**kwargs) self.selected_item_value_path = selected_item_value_path self.value = value self.parameter_reference = parameter_reference self.required = required -class SwaggerCustomDynamicTreeSettings(msrest.serialization.Model): +class SwaggerCustomDynamicTreeSettings(_serialization.Model): """The swagger custom dynamic tree settings. :ivar can_select_parent_nodes: Indicates whether parent nodes can be selected. @@ -8065,16 +7858,12 @@ class SwaggerCustomDynamicTreeSettings(msrest.serialization.Model): """ _attribute_map = { - 'can_select_parent_nodes': {'key': 'CanSelectParentNodes', 'type': 'bool'}, - 'can_select_leaf_nodes': {'key': 'CanSelectLeafNodes', 'type': 'bool'}, + "can_select_parent_nodes": {"key": "CanSelectParentNodes", "type": "bool"}, + "can_select_leaf_nodes": {"key": "CanSelectLeafNodes", "type": "bool"}, } def __init__( - self, - *, - can_select_parent_nodes: Optional[bool] = None, - can_select_leaf_nodes: Optional[bool] = None, - **kwargs + self, *, can_select_parent_nodes: Optional[bool] = None, can_select_leaf_nodes: Optional[bool] = None, **kwargs ): """ :keyword can_select_parent_nodes: Indicates whether parent nodes can be selected. @@ -8082,12 +7871,12 @@ def __init__( :keyword can_select_leaf_nodes: Indicates whether leaf nodes can be selected. :paramtype can_select_leaf_nodes: bool """ - super(SwaggerCustomDynamicTreeSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.can_select_parent_nodes = can_select_parent_nodes self.can_select_leaf_nodes = can_select_leaf_nodes -class SwaggerExternalDocumentation(msrest.serialization.Model): +class SwaggerExternalDocumentation(_serialization.Model): """The swagger external documentation. :ivar description: The document description. @@ -8095,13 +7884,13 @@ class SwaggerExternalDocumentation(msrest.serialization.Model): :ivar uri: The documentation Uri. :vartype uri: str :ivar extensions: The vendor extensions. - :vartype extensions: dict[str, any] + :vartype extensions: dict[str, JSON] """ _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'uri': {'key': 'uri', 'type': 'str'}, - 'extensions': {'key': 'extensions', 'type': '{object}'}, + "description": {"key": "description", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + "extensions": {"key": "extensions", "type": "{object}"}, } def __init__( @@ -8109,7 +7898,7 @@ def __init__( *, description: Optional[str] = None, uri: Optional[str] = None, - extensions: Optional[Dict[str, Any]] = None, + extensions: Optional[Dict[str, JSON]] = None, **kwargs ): """ @@ -8118,21 +7907,21 @@ def __init__( :keyword uri: The documentation Uri. :paramtype uri: str :keyword extensions: The vendor extensions. - :paramtype extensions: dict[str, any] + :paramtype extensions: dict[str, JSON] """ - super(SwaggerExternalDocumentation, self).__init__(**kwargs) + super().__init__(**kwargs) self.description = description self.uri = uri self.extensions = extensions -class SwaggerSchema(msrest.serialization.Model): +class SwaggerSchema(_serialization.Model): # pylint: disable=too-many-instance-attributes """The swagger schema. :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", and "Null". :vartype type: str or ~azure.mgmt.logic.models.SwaggerSchemaType :ivar title: The title. :vartype title: str @@ -8141,7 +7930,7 @@ class SwaggerSchema(msrest.serialization.Model): :ivar properties: The object properties. :vartype properties: dict[str, ~azure.mgmt.logic.models.SwaggerSchema] :ivar additional_properties: The additional properties. - :vartype additional_properties: any + :vartype additional_properties: JSON :ivar required: The object required properties. :vartype required: list[str] :ivar max_properties: The maximum number of allowed properties. @@ -8159,7 +7948,7 @@ class SwaggerSchema(msrest.serialization.Model): :ivar external_docs: The external documentation. :vartype external_docs: ~azure.mgmt.logic.models.SwaggerExternalDocumentation :ivar example: The example value. - :vartype example: any + :vartype example: JSON :ivar notification_url_extension: Indicates the notification url extension. If this is set, the property's value should be a callback url for a webhook. :vartype notification_url_extension: bool @@ -8174,58 +7963,58 @@ class SwaggerSchema(msrest.serialization.Model): """ _attribute_map = { - 'ref': {'key': 'ref', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'title': {'key': 'title', 'type': 'str'}, - 'items': {'key': 'items', 'type': 'SwaggerSchema'}, - 'properties': {'key': 'properties', 'type': '{SwaggerSchema}'}, - 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, - 'required': {'key': 'required', 'type': '[str]'}, - 'max_properties': {'key': 'maxProperties', 'type': 'int'}, - 'min_properties': {'key': 'minProperties', 'type': 'int'}, - 'all_of': {'key': 'allOf', 'type': '[SwaggerSchema]'}, - 'discriminator': {'key': 'discriminator', 'type': 'str'}, - 'read_only': {'key': 'readOnly', 'type': 'bool'}, - 'xml': {'key': 'xml', 'type': 'SwaggerXml'}, - 'external_docs': {'key': 'externalDocs', 'type': 'SwaggerExternalDocumentation'}, - 'example': {'key': 'example', 'type': 'object'}, - 'notification_url_extension': {'key': 'notificationUrlExtension', 'type': 'bool'}, - 'dynamic_schema_old': {'key': 'dynamicSchemaOld', 'type': 'SwaggerCustomDynamicSchema'}, - 'dynamic_schema_new': {'key': 'dynamicSchemaNew', 'type': 'SwaggerCustomDynamicProperties'}, - 'dynamic_list_new': {'key': 'dynamicListNew', 'type': 'SwaggerCustomDynamicList'}, - 'dynamic_tree': {'key': 'dynamicTree', 'type': 'SwaggerCustomDynamicTree'}, + "ref": {"key": "ref", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "title": {"key": "title", "type": "str"}, + "items": {"key": "items", "type": "SwaggerSchema"}, + "properties": {"key": "properties", "type": "{SwaggerSchema}"}, + "additional_properties": {"key": "additionalProperties", "type": "object"}, + "required": {"key": "required", "type": "[str]"}, + "max_properties": {"key": "maxProperties", "type": "int"}, + "min_properties": {"key": "minProperties", "type": "int"}, + "all_of": {"key": "allOf", "type": "[SwaggerSchema]"}, + "discriminator": {"key": "discriminator", "type": "str"}, + "read_only": {"key": "readOnly", "type": "bool"}, + "xml": {"key": "xml", "type": "SwaggerXml"}, + "external_docs": {"key": "externalDocs", "type": "SwaggerExternalDocumentation"}, + "example": {"key": "example", "type": "object"}, + "notification_url_extension": {"key": "notificationUrlExtension", "type": "bool"}, + "dynamic_schema_old": {"key": "dynamicSchemaOld", "type": "SwaggerCustomDynamicSchema"}, + "dynamic_schema_new": {"key": "dynamicSchemaNew", "type": "SwaggerCustomDynamicProperties"}, + "dynamic_list_new": {"key": "dynamicListNew", "type": "SwaggerCustomDynamicList"}, + "dynamic_tree": {"key": "dynamicTree", "type": "SwaggerCustomDynamicTree"}, } 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, - additional_properties: Optional[Any] = None, + items: Optional["_models.SwaggerSchema"] = None, + properties: Optional[Dict[str, "_models.SwaggerSchema"]] = None, + additional_properties: Optional[JSON] = 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, - example: Optional[Any] = None, + xml: Optional["_models.SwaggerXml"] = None, + external_docs: Optional["_models.SwaggerExternalDocumentation"] = None, + example: Optional[JSON] = 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", and "Null". :paramtype type: str or ~azure.mgmt.logic.models.SwaggerSchemaType :keyword title: The title. :paramtype title: str @@ -8234,7 +8023,7 @@ def __init__( :keyword properties: The object properties. :paramtype properties: dict[str, ~azure.mgmt.logic.models.SwaggerSchema] :keyword additional_properties: The additional properties. - :paramtype additional_properties: any + :paramtype additional_properties: JSON :keyword required: The object required properties. :paramtype required: list[str] :keyword max_properties: The maximum number of allowed properties. @@ -8252,7 +8041,7 @@ def __init__( :keyword external_docs: The external documentation. :paramtype external_docs: ~azure.mgmt.logic.models.SwaggerExternalDocumentation :keyword example: The example value. - :paramtype example: any + :paramtype example: JSON :keyword notification_url_extension: Indicates the notification url extension. If this is set, the property's value should be a callback url for a webhook. :paramtype notification_url_extension: bool @@ -8265,7 +8054,7 @@ def __init__( :keyword dynamic_tree: The dynamic values tree configuration. :paramtype dynamic_tree: ~azure.mgmt.logic.models.SwaggerCustomDynamicTree """ - super(SwaggerSchema, self).__init__(**kwargs) + super().__init__(**kwargs) self.ref = ref self.type = type self.title = title @@ -8288,7 +8077,7 @@ def __init__( self.dynamic_tree = dynamic_tree -class SwaggerXml(msrest.serialization.Model): +class SwaggerXml(_serialization.Model): """The Swagger XML. :ivar name: The xml element or attribute name. @@ -8302,16 +8091,16 @@ class SwaggerXml(msrest.serialization.Model): :ivar wrapped: Indicates whether the array elements are wrapped in a container element. :vartype wrapped: bool :ivar extensions: The vendor extensions. - :vartype extensions: dict[str, any] + :vartype extensions: dict[str, JSON] """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'namespace': {'key': 'namespace', 'type': 'str'}, - 'prefix': {'key': 'prefix', 'type': 'str'}, - 'attribute': {'key': 'attribute', 'type': 'bool'}, - 'wrapped': {'key': 'wrapped', 'type': 'bool'}, - 'extensions': {'key': 'extensions', 'type': '{object}'}, + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "prefix": {"key": "prefix", "type": "str"}, + "attribute": {"key": "attribute", "type": "bool"}, + "wrapped": {"key": "wrapped", "type": "bool"}, + "extensions": {"key": "extensions", "type": "{object}"}, } def __init__( @@ -8322,7 +8111,7 @@ def __init__( prefix: Optional[str] = None, attribute: Optional[bool] = None, wrapped: Optional[bool] = None, - extensions: Optional[Dict[str, Any]] = None, + extensions: Optional[Dict[str, JSON]] = None, **kwargs ): """ @@ -8338,9 +8127,9 @@ def __init__( :keyword wrapped: Indicates whether the array elements are wrapped in a container element. :paramtype wrapped: bool :keyword extensions: The vendor extensions. - :paramtype extensions: dict[str, any] + :paramtype extensions: dict[str, JSON] """ - super(SwaggerXml, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = name self.namespace = namespace self.prefix = prefix @@ -8349,72 +8138,72 @@ def __init__( self.extensions = extensions -class TrackingEvent(msrest.serialization.Model): +class TrackingEvent(_serialization.Model): """The tracking event. All required parameters must be populated in order to send to Azure. - :ivar event_level: Required. The event level. Possible values include: "LogAlways", "Critical", - "Error", "Warning", "Informational", "Verbose". + :ivar event_level: The event level. Required. Known values are: "LogAlways", "Critical", + "Error", "Warning", "Informational", and "Verbose". :vartype event_level: str or ~azure.mgmt.logic.models.EventLevel - :ivar event_time: Required. The event time. + :ivar event_time: The event time. Required. :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: The record type. Required. Known values are: "NotSpecified", "Custom", + "AS2Message", "AS2MDN", "X12Interchange", "X12FunctionalGroup", "X12TransactionSet", "X12InterchangeAcknowledgment", "X12FunctionalGroupAcknowledgment", "X12TransactionSetAcknowledgment", "EdifactInterchange", "EdifactFunctionalGroup", "EdifactTransactionSet", "EdifactInterchangeAcknowledgment", - "EdifactFunctionalGroupAcknowledgment", "EdifactTransactionSetAcknowledgment". + "EdifactFunctionalGroupAcknowledgment", and "EdifactTransactionSetAcknowledgment". :vartype record_type: str or ~azure.mgmt.logic.models.TrackingRecordType :ivar record: The record. - :vartype record: any + :vartype record: JSON :ivar error: The error. :vartype error: ~azure.mgmt.logic.models.TrackingEventErrorInfo """ _validation = { - 'event_level': {'required': True}, - 'event_time': {'required': True}, - 'record_type': {'required': True}, + "event_level": {"required": True}, + "event_time": {"required": True}, + "record_type": {"required": True}, } _attribute_map = { - 'event_level': {'key': 'eventLevel', 'type': 'str'}, - 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, - 'record_type': {'key': 'recordType', 'type': 'str'}, - 'record': {'key': 'record', 'type': 'object'}, - 'error': {'key': 'error', 'type': 'TrackingEventErrorInfo'}, + "event_level": {"key": "eventLevel", "type": "str"}, + "event_time": {"key": "eventTime", "type": "iso-8601"}, + "record_type": {"key": "recordType", "type": "str"}, + "record": {"key": "record", "type": "object"}, + "error": {"key": "error", "type": "TrackingEventErrorInfo"}, } def __init__( self, *, - event_level: Union[str, "EventLevel"], + event_level: Union[str, "_models.EventLevel"], event_time: datetime.datetime, - record_type: Union[str, "TrackingRecordType"], - record: Optional[Any] = None, - error: Optional["TrackingEventErrorInfo"] = None, + record_type: Union[str, "_models.TrackingRecordType"], + record: Optional[JSON] = 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: The event level. Required. Known values are: "LogAlways", "Critical", + "Error", "Warning", "Informational", and "Verbose". :paramtype event_level: str or ~azure.mgmt.logic.models.EventLevel - :keyword event_time: Required. The event time. + :keyword event_time: The event time. Required. :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: The record type. Required. Known values are: "NotSpecified", "Custom", + "AS2Message", "AS2MDN", "X12Interchange", "X12FunctionalGroup", "X12TransactionSet", "X12InterchangeAcknowledgment", "X12FunctionalGroupAcknowledgment", "X12TransactionSetAcknowledgment", "EdifactInterchange", "EdifactFunctionalGroup", "EdifactTransactionSet", "EdifactInterchangeAcknowledgment", - "EdifactFunctionalGroupAcknowledgment", "EdifactTransactionSetAcknowledgment". + "EdifactFunctionalGroupAcknowledgment", and "EdifactTransactionSetAcknowledgment". :paramtype record_type: str or ~azure.mgmt.logic.models.TrackingRecordType :keyword record: The record. - :paramtype record: any + :paramtype record: JSON :keyword error: The error. :paramtype error: ~azure.mgmt.logic.models.TrackingEventErrorInfo """ - super(TrackingEvent, self).__init__(**kwargs) + super().__init__(**kwargs) self.event_level = event_level self.event_time = event_time self.record_type = record_type @@ -8422,7 +8211,7 @@ def __init__( self.error = error -class TrackingEventErrorInfo(msrest.serialization.Model): +class TrackingEventErrorInfo(_serialization.Model): """The tracking event error info. :ivar message: The message. @@ -8432,77 +8221,71 @@ class TrackingEventErrorInfo(msrest.serialization.Model): """ _attribute_map = { - 'message': {'key': 'message', 'type': 'str'}, - 'code': {'key': 'code', 'type': 'str'}, + "message": {"key": "message", "type": "str"}, + "code": {"key": "code", "type": "str"}, } - def __init__( - self, - *, - message: Optional[str] = None, - code: Optional[str] = None, - **kwargs - ): + def __init__(self, *, message: Optional[str] = None, code: Optional[str] = None, **kwargs): """ :keyword message: The message. :paramtype message: str :keyword code: The code. :paramtype code: str """ - super(TrackingEventErrorInfo, self).__init__(**kwargs) + super().__init__(**kwargs) self.message = message self.code = code -class TrackingEventsDefinition(msrest.serialization.Model): +class TrackingEventsDefinition(_serialization.Model): """The tracking events definition. All required parameters must be populated in order to send to Azure. - :ivar source_type: Required. The source type. + :ivar source_type: The source type. Required. :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" and "DisableSourceInfoEnrich". :vartype track_events_options: str or ~azure.mgmt.logic.models.TrackEventsOperationOptions - :ivar events: Required. The events. + :ivar events: The events. Required. :vartype events: list[~azure.mgmt.logic.models.TrackingEvent] """ _validation = { - 'source_type': {'required': True}, - 'events': {'required': True}, + "source_type": {"required": True}, + "events": {"required": True}, } _attribute_map = { - 'source_type': {'key': 'sourceType', 'type': 'str'}, - 'track_events_options': {'key': 'trackEventsOptions', 'type': 'str'}, - 'events': {'key': 'events', 'type': '[TrackingEvent]'}, + "source_type": {"key": "sourceType", "type": "str"}, + "track_events_options": {"key": "trackEventsOptions", "type": "str"}, + "events": {"key": "events", "type": "[TrackingEvent]"}, } 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. + :keyword source_type: The source type. Required. :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" and "DisableSourceInfoEnrich". :paramtype track_events_options: str or ~azure.mgmt.logic.models.TrackEventsOperationOptions - :keyword events: Required. The events. + :keyword events: The events. Required. :paramtype events: list[~azure.mgmt.logic.models.TrackingEvent] """ - super(TrackingEventsDefinition, self).__init__(**kwargs) + super().__init__(**kwargs) self.source_type = source_type self.track_events_options = track_events_options self.events = events -class UserAssignedIdentity(msrest.serialization.Model): +class UserAssignedIdentity(_serialization.Model): """User Assigned identity properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -8514,27 +8297,23 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.principal_id = None self.client_id = None -class Workflow(Resource): +class Workflow(Resource): # pylint: disable=too-many-instance-attributes """The workflow type. Variables are only populated by the server, and will be ignored when sending a request. @@ -8547,21 +8326,21 @@ class Workflow(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :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". + "Unregistered", "Completed", "Renewing", "Pending", "Waiting", and "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", and "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState :ivar version: Gets the version. :vartype version: str @@ -8578,43 +8357,46 @@ class Workflow(Resource): :ivar integration_service_environment: The integration service environment. :vartype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference :ivar definition: The definition. - :vartype definition: any + :vartype definition: JSON :ivar parameters: The parameters. :vartype parameters: dict[str, ~azure.mgmt.logic.models.WorkflowParameter] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, - 'version': {'readonly': True}, - 'access_endpoint': {'readonly': True}, - 'sku': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'access_endpoint': {'key': 'properties.accessEndpoint', 'type': 'str'}, - 'endpoints_configuration': {'key': 'properties.endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, - 'access_control': {'key': 'properties.accessControl', 'type': 'FlowAccessControlConfiguration'}, - 'sku': {'key': 'properties.sku', 'type': 'Sku'}, - 'integration_account': {'key': 'properties.integrationAccount', 'type': 'ResourceReference'}, - 'integration_service_environment': {'key': 'properties.integrationServiceEnvironment', 'type': 'ResourceReference'}, - 'definition': {'key': 'properties.definition', 'type': 'object'}, - 'parameters': {'key': 'properties.parameters', 'type': '{WorkflowParameter}'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, + "version": {"readonly": True}, + "access_endpoint": {"readonly": True}, + "sku": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "state": {"key": "properties.state", "type": "str"}, + "version": {"key": "properties.version", "type": "str"}, + "access_endpoint": {"key": "properties.accessEndpoint", "type": "str"}, + "endpoints_configuration": {"key": "properties.endpointsConfiguration", "type": "FlowEndpointsConfiguration"}, + "access_control": {"key": "properties.accessControl", "type": "FlowAccessControlConfiguration"}, + "sku": {"key": "properties.sku", "type": "Sku"}, + "integration_account": {"key": "properties.integrationAccount", "type": "ResourceReference"}, + "integration_service_environment": { + "key": "properties.integrationServiceEnvironment", + "type": "ResourceReference", + }, + "definition": {"key": "properties.definition", "type": "object"}, + "parameters": {"key": "properties.parameters", "type": "{WorkflowParameter}"}, } def __init__( @@ -8622,25 +8404,25 @@ 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, - definition: Optional[Any] = None, - parameters: Optional[Dict[str, "WorkflowParameter"]] = 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[JSON] = None, + parameters: Optional[Dict[str, "_models.WorkflowParameter"]] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :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", - "Disabled", "Deleted", "Suspended". + :keyword state: The state. Known values are: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", and "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState :keyword endpoints_configuration: The endpoints configuration. :paramtype endpoints_configuration: ~azure.mgmt.logic.models.FlowEndpointsConfiguration @@ -8651,11 +8433,11 @@ def __init__( :keyword integration_service_environment: The integration service environment. :paramtype integration_service_environment: ~azure.mgmt.logic.models.ResourceReference :keyword definition: The definition. - :paramtype definition: any + :paramtype definition: JSON :keyword parameters: The parameters. :paramtype parameters: dict[str, ~azure.mgmt.logic.models.WorkflowParameter] """ - super(Workflow, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.identity = identity self.provisioning_state = None self.created_time = None @@ -8672,34 +8454,29 @@ def __init__( self.parameters = parameters -class WorkflowFilter(msrest.serialization.Model): +class WorkflowFilter(_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", and "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState """ _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, + "state": {"key": "state", "type": "str"}, } - def __init__( - self, - *, - state: Optional[Union[str, "WorkflowState"]] = None, - **kwargs - ): + def __init__(self, *, state: Optional[Union[str, "_models.WorkflowState"]] = None, **kwargs): """ - :keyword state: The state of workflows. Possible values include: "NotSpecified", "Completed", - "Enabled", "Disabled", "Deleted", "Suspended". + :keyword state: The state of workflows. Known values are: "NotSpecified", "Completed", + "Enabled", "Disabled", "Deleted", and "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState """ - super(WorkflowFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.state = state -class WorkflowListResult(msrest.serialization.Model): +class WorkflowListResult(_serialization.Model): """The list of workflows. :ivar value: The list of workflows. @@ -8709,70 +8486,64 @@ class WorkflowListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Workflow]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Workflow]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["Workflow"]] = None, - next_link: Optional[str] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.Workflow"]] = None, next_link: Optional[str] = None, **kwargs): """ :keyword value: The list of workflows. :paramtype value: list[~azure.mgmt.logic.models.Workflow] :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(WorkflowListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class WorkflowParameter(msrest.serialization.Model): +class WorkflowParameter(_serialization.Model): """The workflow parameters. - :ivar type: The type. Possible values include: "NotSpecified", "String", "SecureString", "Int", - "Float", "Bool", "Array", "Object", "SecureObject". + :ivar type: The type. Known values are: "NotSpecified", "String", "SecureString", "Int", + "Float", "Bool", "Array", "Object", and "SecureObject". :vartype type: str or ~azure.mgmt.logic.models.ParameterType :ivar value: The value. - :vartype value: any + :vartype value: JSON :ivar metadata: The metadata. - :vartype metadata: any + :vartype metadata: JSON :ivar description: The description. :vartype description: str """ _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'description': {'key': 'description', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "object"}, + "metadata": {"key": "metadata", "type": "object"}, + "description": {"key": "description", "type": "str"}, } def __init__( self, *, - type: Optional[Union[str, "ParameterType"]] = None, - value: Optional[Any] = None, - metadata: Optional[Any] = None, + type: Optional[Union[str, "_models.ParameterType"]] = None, + value: Optional[JSON] = None, + metadata: Optional[JSON] = 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", and "SecureObject". :paramtype type: str or ~azure.mgmt.logic.models.ParameterType :keyword value: The value. - :paramtype value: any + :paramtype value: JSON :keyword metadata: The metadata. - :paramtype metadata: any + :paramtype metadata: JSON :keyword description: The description. :paramtype description: str """ - super(WorkflowParameter, self).__init__(**kwargs) + super().__init__(**kwargs) self.type = type self.value = value self.metadata = metadata @@ -8784,52 +8555,52 @@ 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", - "Float", "Bool", "Array", "Object", "SecureObject". + :ivar type: The type. Known values are: "NotSpecified", "String", "SecureString", "Int", + "Float", "Bool", "Array", "Object", and "SecureObject". :vartype type: str or ~azure.mgmt.logic.models.ParameterType :ivar value: The value. - :vartype value: any + :vartype value: JSON :ivar metadata: The metadata. - :vartype metadata: any + :vartype metadata: JSON :ivar description: The description. :vartype description: str :ivar error: Gets the error. - :vartype error: any + :vartype error: JSON """ _validation = { - 'error': {'readonly': True}, + "error": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'metadata': {'key': 'metadata', 'type': 'object'}, - 'description': {'key': 'description', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "object"}, + "metadata": {"key": "metadata", "type": "object"}, + "description": {"key": "description", "type": "str"}, + "error": {"key": "error", "type": "object"}, } def __init__( self, *, - type: Optional[Union[str, "ParameterType"]] = None, - value: Optional[Any] = None, - metadata: Optional[Any] = None, + type: Optional[Union[str, "_models.ParameterType"]] = None, + value: Optional[JSON] = None, + metadata: Optional[JSON] = 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", and "SecureObject". :paramtype type: str or ~azure.mgmt.logic.models.ParameterType :keyword value: The value. - :paramtype value: any + :paramtype value: JSON :keyword metadata: The metadata. - :paramtype metadata: any + :paramtype metadata: JSON :keyword description: The description. :paramtype description: str """ - super(WorkflowOutputParameter, self).__init__(type=type, value=value, metadata=metadata, description=description, **kwargs) + super().__init__(type=type, value=value, metadata=metadata, description=description, **kwargs) self.error = None @@ -8847,30 +8618,25 @@ class WorkflowReference(ResourceReference): """ _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin """ :keyword id: The resource id. :paramtype id: str """ - super(WorkflowReference, self).__init__(id=id, **kwargs) + super().__init__(id=id, **kwargs) -class WorkflowRun(SubResource): +class WorkflowRun(SubResource): # pylint: disable=too-many-instance-attributes """The workflow run. Variables are only populated by the server, and will be ignored when sending a request. @@ -8887,14 +8653,14 @@ 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". + "Aborted", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: Gets the code. :vartype code: str :ivar error: Gets the error. - :vartype error: any + :vartype error: JSON :ivar correlation_id: Gets the correlation id. :vartype correlation_id: str :ivar correlation: The run correlation. @@ -8910,51 +8676,46 @@ class WorkflowRun(SubResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'wait_end_time': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'status': {'readonly': True}, - 'code': {'readonly': True}, - 'error': {'readonly': True}, - 'correlation_id': {'readonly': True}, - 'workflow': {'readonly': True}, - 'trigger': {'readonly': True}, - 'outputs': {'readonly': True}, - 'response': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'wait_end_time': {'key': 'properties.waitEndTime', 'type': 'iso-8601'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'code': {'key': 'properties.code', 'type': 'str'}, - 'error': {'key': 'properties.error', 'type': 'object'}, - 'correlation_id': {'key': 'properties.correlationId', 'type': 'str'}, - 'correlation': {'key': 'properties.correlation', 'type': 'Correlation'}, - 'workflow': {'key': 'properties.workflow', 'type': 'ResourceReference'}, - 'trigger': {'key': 'properties.trigger', 'type': 'WorkflowRunTrigger'}, - 'outputs': {'key': 'properties.outputs', 'type': '{WorkflowOutputParameter}'}, - 'response': {'key': 'properties.response', 'type': 'WorkflowRunTrigger'}, - } - - def __init__( - self, - *, - correlation: Optional["Correlation"] = None, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "wait_end_time": {"readonly": True}, + "start_time": {"readonly": True}, + "end_time": {"readonly": True}, + "status": {"readonly": True}, + "code": {"readonly": True}, + "error": {"readonly": True}, + "correlation_id": {"readonly": True}, + "workflow": {"readonly": True}, + "trigger": {"readonly": True}, + "outputs": {"readonly": True}, + "response": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "wait_end_time": {"key": "properties.waitEndTime", "type": "iso-8601"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "end_time": {"key": "properties.endTime", "type": "iso-8601"}, + "status": {"key": "properties.status", "type": "str"}, + "code": {"key": "properties.code", "type": "str"}, + "error": {"key": "properties.error", "type": "object"}, + "correlation_id": {"key": "properties.correlationId", "type": "str"}, + "correlation": {"key": "properties.correlation", "type": "Correlation"}, + "workflow": {"key": "properties.workflow", "type": "ResourceReference"}, + "trigger": {"key": "properties.trigger", "type": "WorkflowRunTrigger"}, + "outputs": {"key": "properties.outputs", "type": "{WorkflowOutputParameter}"}, + "response": {"key": "properties.response", "type": "WorkflowRunTrigger"}, + } + + def __init__(self, *, correlation: Optional["_models.Correlation"] = None, **kwargs): """ :keyword correlation: The run correlation. :paramtype correlation: ~azure.mgmt.logic.models.Correlation """ - super(WorkflowRun, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = None self.type = None self.wait_end_time = None @@ -8971,7 +8732,7 @@ def __init__( self.response = None -class WorkflowRunAction(SubResource): +class WorkflowRunAction(SubResource): # pylint: disable=too-many-instance-attributes """The workflow run action. Variables are only populated by the server, and will be ignored when sending a request. @@ -8986,14 +8747,14 @@ 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". + "Aborted", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: Gets the code. :vartype code: str :ivar error: Gets the error. - :vartype error: any + :vartype error: JSON :ivar tracking_id: Gets the tracking id. :vartype tracking_id: str :ivar correlation: The correlation properties. @@ -9003,48 +8764,48 @@ class WorkflowRunAction(SubResource): :ivar outputs_link: Gets the link to outputs. :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink :ivar tracked_properties: Gets the tracked properties. - :vartype tracked_properties: any + :vartype tracked_properties: JSON :ivar retry_history: Gets the retry histories. :vartype retry_history: list[~azure.mgmt.logic.models.RetryHistory] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'status': {'readonly': True}, - 'code': {'readonly': True}, - 'error': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'inputs_link': {'readonly': True}, - 'outputs_link': {'readonly': True}, - 'tracked_properties': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'code': {'key': 'properties.code', 'type': 'str'}, - 'error': {'key': 'properties.error', 'type': 'object'}, - 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, - 'correlation': {'key': 'properties.correlation', 'type': 'RunActionCorrelation'}, - 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, - 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, - 'tracked_properties': {'key': 'properties.trackedProperties', 'type': 'object'}, - 'retry_history': {'key': 'properties.retryHistory', 'type': '[RetryHistory]'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "start_time": {"readonly": True}, + "end_time": {"readonly": True}, + "status": {"readonly": True}, + "code": {"readonly": True}, + "error": {"readonly": True}, + "tracking_id": {"readonly": True}, + "inputs_link": {"readonly": True}, + "outputs_link": {"readonly": True}, + "tracked_properties": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "end_time": {"key": "properties.endTime", "type": "iso-8601"}, + "status": {"key": "properties.status", "type": "str"}, + "code": {"key": "properties.code", "type": "str"}, + "error": {"key": "properties.error", "type": "object"}, + "tracking_id": {"key": "properties.trackingId", "type": "str"}, + "correlation": {"key": "properties.correlation", "type": "RunActionCorrelation"}, + "inputs_link": {"key": "properties.inputsLink", "type": "ContentLink"}, + "outputs_link": {"key": "properties.outputsLink", "type": "ContentLink"}, + "tracked_properties": {"key": "properties.trackedProperties", "type": "object"}, + "retry_history": {"key": "properties.retryHistory", "type": "[RetryHistory]"}, } 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 ): """ @@ -9053,7 +8814,7 @@ def __init__( :keyword retry_history: Gets the retry histories. :paramtype retry_history: list[~azure.mgmt.logic.models.RetryHistory] """ - super(WorkflowRunAction, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = None self.type = None self.start_time = None @@ -9069,36 +8830,31 @@ def __init__( self.retry_history = retry_history -class WorkflowRunActionFilter(msrest.serialization.Model): +class WorkflowRunActionFilter(_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", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - *, - status: Optional[Union[str, "WorkflowStatus"]] = None, - **kwargs - ): + def __init__(self, *, 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", and "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ - super(WorkflowRunActionFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.status = status -class WorkflowRunActionListResult(msrest.serialization.Model): +class WorkflowRunActionListResult(_serialization.Model): """The list of workflow run actions. :ivar value: A list of workflow run actions. @@ -9108,16 +8864,12 @@ class WorkflowRunActionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkflowRunAction]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[WorkflowRunAction]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["WorkflowRunAction"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.WorkflowRunAction"]] = None, next_link: Optional[str] = None, **kwargs ): """ :keyword value: A list of workflow run actions. @@ -9125,12 +8877,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(WorkflowRunActionListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class WorkflowRunActionRepetitionDefinition(Resource): +class WorkflowRunActionRepetitionDefinition(Resource): # pylint: disable=too-many-instance-attributes """The workflow run action repetition definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -9143,7 +8895,7 @@ class WorkflowRunActionRepetitionDefinition(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar tags: The resource tags. :vartype tags: dict[str, str] :ivar start_time: The start time of the workflow scope repetition. :vartype start_time: ~datetime.datetime @@ -9151,9 +8903,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", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: The workflow scope repetition code. :vartype code: str @@ -9162,15 +8914,15 @@ class WorkflowRunActionRepetitionDefinition(Resource): :ivar tracking_id: Gets the tracking id. :vartype tracking_id: str :ivar inputs: Gets the inputs. - :vartype inputs: any + :vartype inputs: JSON :ivar inputs_link: Gets the link to inputs. :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink :ivar outputs: Gets the outputs. - :vartype outputs: any + :vartype outputs: JSON :ivar outputs_link: Gets the link to outputs. :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink :ivar tracked_properties: Gets the tracked properties. - :vartype tracked_properties: any + :vartype tracked_properties: JSON :ivar retry_history: Gets the retry histories. :vartype retry_history: list[~azure.mgmt.logic.models.RetryHistory] :ivar iteration_count: @@ -9180,38 +8932,38 @@ class WorkflowRunActionRepetitionDefinition(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'inputs': {'readonly': True}, - 'inputs_link': {'readonly': True}, - 'outputs': {'readonly': True}, - 'outputs_link': {'readonly': True}, - 'tracked_properties': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'correlation': {'key': 'properties.correlation', 'type': 'RunActionCorrelation'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'code': {'key': 'properties.code', 'type': 'str'}, - 'error': {'key': 'properties.error', 'type': 'object'}, - 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, - 'inputs': {'key': 'properties.inputs', 'type': 'object'}, - 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, - 'outputs': {'key': 'properties.outputs', 'type': 'object'}, - 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, - 'tracked_properties': {'key': 'properties.trackedProperties', 'type': 'object'}, - 'retry_history': {'key': 'properties.retryHistory', 'type': '[RetryHistory]'}, - 'iteration_count': {'key': 'properties.iterationCount', 'type': 'int'}, - 'repetition_indexes': {'key': 'properties.repetitionIndexes', 'type': '[RepetitionIndex]'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "tracking_id": {"readonly": True}, + "inputs": {"readonly": True}, + "inputs_link": {"readonly": True}, + "outputs": {"readonly": True}, + "outputs_link": {"readonly": True}, + "tracked_properties": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "end_time": {"key": "properties.endTime", "type": "iso-8601"}, + "correlation": {"key": "properties.correlation", "type": "RunActionCorrelation"}, + "status": {"key": "properties.status", "type": "str"}, + "code": {"key": "properties.code", "type": "str"}, + "error": {"key": "properties.error", "type": "object"}, + "tracking_id": {"key": "properties.trackingId", "type": "str"}, + "inputs": {"key": "properties.inputs", "type": "object"}, + "inputs_link": {"key": "properties.inputsLink", "type": "ContentLink"}, + "outputs": {"key": "properties.outputs", "type": "object"}, + "outputs_link": {"key": "properties.outputsLink", "type": "ContentLink"}, + "tracked_properties": {"key": "properties.trackedProperties", "type": "object"}, + "retry_history": {"key": "properties.retryHistory", "type": "[RetryHistory]"}, + "iteration_count": {"key": "properties.iterationCount", "type": "int"}, + "repetition_indexes": {"key": "properties.repetitionIndexes", "type": "[RepetitionIndex]"}, } def __init__( @@ -9221,19 +8973,19 @@ 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 ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] :keyword start_time: The start time of the workflow scope repetition. :paramtype start_time: ~datetime.datetime @@ -9241,9 +8993,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", and "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus :keyword code: The workflow scope repetition code. :paramtype code: str @@ -9256,7 +9008,7 @@ def __init__( :keyword repetition_indexes: The repetition indexes. :paramtype repetition_indexes: list[~azure.mgmt.logic.models.RepetitionIndex] """ - super(WorkflowRunActionRepetitionDefinition, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.start_time = start_time self.end_time = end_time self.correlation = correlation @@ -9274,7 +9026,7 @@ def __init__( self.repetition_indexes = repetition_indexes -class WorkflowRunActionRepetitionDefinitionCollection(msrest.serialization.Model): +class WorkflowRunActionRepetitionDefinitionCollection(_serialization.Model): """A collection of workflow run action repetitions. :ivar next_link: The link used to get the next page of recommendations. @@ -9284,15 +9036,15 @@ class WorkflowRunActionRepetitionDefinitionCollection(msrest.serialization.Model """ _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'value': {'key': 'value', 'type': '[WorkflowRunActionRepetitionDefinition]'}, + "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[WorkflowRunActionRepetitionDefinition]"}, } def __init__( self, *, next_link: Optional[str] = None, - value: Optional[List["WorkflowRunActionRepetitionDefinition"]] = None, + value: Optional[List["_models.WorkflowRunActionRepetitionDefinition"]] = None, **kwargs ): """ @@ -9301,12 +9053,12 @@ def __init__( :keyword value: :paramtype value: list[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition] """ - super(WorkflowRunActionRepetitionDefinitionCollection, self).__init__(**kwargs) + super().__init__(**kwargs) self.next_link = next_link self.value = value -class WorkflowRunActionRepetitionProperties(OperationResult): +class WorkflowRunActionRepetitionProperties(OperationResult): # pylint: disable=too-many-instance-attributes """The workflow run action repetition properties definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -9317,9 +9069,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", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: The workflow scope repetition code. :vartype code: str @@ -9328,15 +9080,15 @@ class WorkflowRunActionRepetitionProperties(OperationResult): :ivar tracking_id: Gets the tracking id. :vartype tracking_id: str :ivar inputs: Gets the inputs. - :vartype inputs: any + :vartype inputs: JSON :ivar inputs_link: Gets the link to inputs. :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink :ivar outputs: Gets the outputs. - :vartype outputs: any + :vartype outputs: JSON :ivar outputs_link: Gets the link to outputs. :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink :ivar tracked_properties: Gets the tracked properties. - :vartype tracked_properties: any + :vartype tracked_properties: JSON :ivar retry_history: Gets the retry histories. :vartype retry_history: list[~azure.mgmt.logic.models.RetryHistory] :ivar iteration_count: @@ -9346,30 +9098,30 @@ class WorkflowRunActionRepetitionProperties(OperationResult): """ _validation = { - 'tracking_id': {'readonly': True}, - 'inputs': {'readonly': True}, - 'inputs_link': {'readonly': True}, - 'outputs': {'readonly': True}, - 'outputs_link': {'readonly': True}, - 'tracked_properties': {'readonly': True}, + "tracking_id": {"readonly": True}, + "inputs": {"readonly": True}, + "inputs_link": {"readonly": True}, + "outputs": {"readonly": True}, + "outputs_link": {"readonly": True}, + "tracked_properties": {"readonly": True}, } _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'correlation': {'key': 'correlation', 'type': 'RunActionCorrelation'}, - 'status': {'key': 'status', 'type': 'str'}, - 'code': {'key': 'code', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'object'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': 'object'}, - 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, - 'outputs': {'key': 'outputs', 'type': 'object'}, - 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, - 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, - 'retry_history': {'key': 'retryHistory', 'type': '[RetryHistory]'}, - 'iteration_count': {'key': 'iterationCount', 'type': 'int'}, - 'repetition_indexes': {'key': 'repetitionIndexes', 'type': '[RepetitionIndex]'}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "correlation": {"key": "correlation", "type": "RunActionCorrelation"}, + "status": {"key": "status", "type": "str"}, + "code": {"key": "code", "type": "str"}, + "error": {"key": "error", "type": "object"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "inputs": {"key": "inputs", "type": "object"}, + "inputs_link": {"key": "inputsLink", "type": "ContentLink"}, + "outputs": {"key": "outputs", "type": "object"}, + "outputs_link": {"key": "outputsLink", "type": "ContentLink"}, + "tracked_properties": {"key": "trackedProperties", "type": "object"}, + "retry_history": {"key": "retryHistory", "type": "[RetryHistory]"}, + "iteration_count": {"key": "iterationCount", "type": "int"}, + "repetition_indexes": {"key": "repetitionIndexes", "type": "[RepetitionIndex]"}, } def __init__( @@ -9377,13 +9129,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 +9145,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", and "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus :keyword code: The workflow scope repetition code. :paramtype code: str @@ -9408,40 +9160,45 @@ def __init__( :keyword repetition_indexes: The repetition indexes. :paramtype repetition_indexes: list[~azure.mgmt.logic.models.RepetitionIndex] """ - super(WorkflowRunActionRepetitionProperties, self).__init__(start_time=start_time, end_time=end_time, correlation=correlation, status=status, code=code, error=error, retry_history=retry_history, iteration_count=iteration_count, **kwargs) + super().__init__( + start_time=start_time, + end_time=end_time, + correlation=correlation, + status=status, + code=code, + error=error, + retry_history=retry_history, + iteration_count=iteration_count, + **kwargs + ) self.repetition_indexes = repetition_indexes -class WorkflowRunFilter(msrest.serialization.Model): +class WorkflowRunFilter(_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". + "TimedOut", "Aborted", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - *, - status: Optional[Union[str, "WorkflowStatus"]] = None, - **kwargs - ): + def __init__(self, *, 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". + "TimedOut", "Aborted", and "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ - super(WorkflowRunFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.status = status -class WorkflowRunListResult(msrest.serialization.Model): +class WorkflowRunListResult(_serialization.Model): """The list of workflow runs. :ivar value: A list of workflow runs. @@ -9451,16 +9208,12 @@ class WorkflowRunListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkflowRun]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[WorkflowRun]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["WorkflowRun"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.WorkflowRun"]] = None, next_link: Optional[str] = None, **kwargs ): """ :keyword value: A list of workflow runs. @@ -9468,12 +9221,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(WorkflowRunListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class WorkflowRunTrigger(msrest.serialization.Model): +class WorkflowRunTrigger(_serialization.Model): # pylint: disable=too-many-instance-attributes """The workflow run trigger. Variables are only populated by the server, and will be ignored when sending a request. @@ -9481,11 +9234,11 @@ class WorkflowRunTrigger(msrest.serialization.Model): :ivar name: Gets the name. :vartype name: str :ivar inputs: Gets the inputs. - :vartype inputs: any + :vartype inputs: JSON :ivar inputs_link: Gets the link to inputs. :vartype inputs_link: ~azure.mgmt.logic.models.ContentLink :ivar outputs: Gets the outputs. - :vartype outputs: any + :vartype outputs: JSON :ivar outputs_link: Gets the link to outputs. :vartype outputs_link: ~azure.mgmt.logic.models.ContentLink :ivar scheduled_time: Gets the scheduled time. @@ -9500,60 +9253,55 @@ 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". + "Aborted", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar error: Gets the error. - :vartype error: any + :vartype error: JSON :ivar tracked_properties: Gets the tracked properties. - :vartype tracked_properties: any + :vartype tracked_properties: JSON """ _validation = { - 'name': {'readonly': True}, - 'inputs': {'readonly': True}, - 'inputs_link': {'readonly': True}, - 'outputs': {'readonly': True}, - 'outputs_link': {'readonly': True}, - 'scheduled_time': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'code': {'readonly': True}, - 'status': {'readonly': True}, - 'error': {'readonly': True}, - 'tracked_properties': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': 'object'}, - 'inputs_link': {'key': 'inputsLink', 'type': 'ContentLink'}, - 'outputs': {'key': 'outputs', 'type': 'object'}, - 'outputs_link': {'key': 'outputsLink', 'type': 'ContentLink'}, - 'scheduled_time': {'key': 'scheduledTime', 'type': 'iso-8601'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'tracking_id': {'key': 'trackingId', 'type': 'str'}, - 'correlation': {'key': 'correlation', 'type': 'Correlation'}, - 'code': {'key': 'code', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'object'}, - 'tracked_properties': {'key': 'trackedProperties', 'type': 'object'}, - } - - def __init__( - self, - *, - correlation: Optional["Correlation"] = None, - **kwargs - ): + "name": {"readonly": True}, + "inputs": {"readonly": True}, + "inputs_link": {"readonly": True}, + "outputs": {"readonly": True}, + "outputs_link": {"readonly": True}, + "scheduled_time": {"readonly": True}, + "start_time": {"readonly": True}, + "end_time": {"readonly": True}, + "tracking_id": {"readonly": True}, + "code": {"readonly": True}, + "status": {"readonly": True}, + "error": {"readonly": True}, + "tracked_properties": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "inputs": {"key": "inputs", "type": "object"}, + "inputs_link": {"key": "inputsLink", "type": "ContentLink"}, + "outputs": {"key": "outputs", "type": "object"}, + "outputs_link": {"key": "outputsLink", "type": "ContentLink"}, + "scheduled_time": {"key": "scheduledTime", "type": "iso-8601"}, + "start_time": {"key": "startTime", "type": "iso-8601"}, + "end_time": {"key": "endTime", "type": "iso-8601"}, + "tracking_id": {"key": "trackingId", "type": "str"}, + "correlation": {"key": "correlation", "type": "Correlation"}, + "code": {"key": "code", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "error": {"key": "error", "type": "object"}, + "tracked_properties": {"key": "trackedProperties", "type": "object"}, + } + + def __init__(self, *, correlation: Optional["_models.Correlation"] = None, **kwargs): """ :keyword correlation: The run correlation. :paramtype correlation: ~azure.mgmt.logic.models.Correlation """ - super(WorkflowRunTrigger, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = None self.inputs = None self.inputs_link = None @@ -9570,7 +9318,7 @@ def __init__( self.tracked_properties = None -class WorkflowTrigger(SubResource): +class WorkflowTrigger(SubResource): # pylint: disable=too-many-instance-attributes """The workflow trigger. Variables are only populated by the server, and will be ignored when sending a request. @@ -9581,21 +9329,21 @@ 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". + "Unregistered", and "Completed". :vartype provisioning_state: str or ~azure.mgmt.logic.models.WorkflowTriggerProvisioningState :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: Gets the state. Possible values include: "NotSpecified", "Completed", "Enabled", - "Disabled", "Deleted", "Suspended". + :ivar state: Gets the state. Known values are: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", and "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". + "Aborted", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar last_execution_time: Gets the last execution time. :vartype last_execution_time: ~datetime.datetime @@ -9608,42 +9356,38 @@ class WorkflowTrigger(SubResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, - 'state': {'readonly': True}, - 'status': {'readonly': True}, - 'last_execution_time': {'readonly': True}, - 'next_execution_time': {'readonly': True}, - 'recurrence': {'readonly': True}, - 'workflow': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_execution_time': {'key': 'properties.lastExecutionTime', 'type': 'iso-8601'}, - 'next_execution_time': {'key': 'properties.nextExecutionTime', 'type': 'iso-8601'}, - 'recurrence': {'key': 'properties.recurrence', 'type': 'WorkflowTriggerRecurrence'}, - 'workflow': {'key': 'properties.workflow', 'type': 'ResourceReference'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(WorkflowTrigger, self).__init__(**kwargs) + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, + "state": {"readonly": True}, + "status": {"readonly": True}, + "last_execution_time": {"readonly": True}, + "next_execution_time": {"readonly": True}, + "recurrence": {"readonly": True}, + "workflow": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "state": {"key": "properties.state", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, + "last_execution_time": {"key": "properties.lastExecutionTime", "type": "iso-8601"}, + "next_execution_time": {"key": "properties.nextExecutionTime", "type": "iso-8601"}, + "recurrence": {"key": "properties.recurrence", "type": "WorkflowTriggerRecurrence"}, + "workflow": {"key": "properties.workflow", "type": "ResourceReference"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) self.name = None self.type = None self.provisioning_state = None @@ -9657,7 +9401,7 @@ def __init__( self.workflow = None -class WorkflowTriggerCallbackUrl(msrest.serialization.Model): +class WorkflowTriggerCallbackUrl(_serialization.Model): """The workflow trigger callback URL. Variables are only populated by the server, and will be ignored when sending a request. @@ -9678,26 +9422,26 @@ class WorkflowTriggerCallbackUrl(msrest.serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'method': {'readonly': True}, - 'base_path': {'readonly': True}, - 'relative_path': {'readonly': True}, + "value": {"readonly": True}, + "method": {"readonly": True}, + "base_path": {"readonly": True}, + "relative_path": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'method': {'key': 'method', 'type': 'str'}, - 'base_path': {'key': 'basePath', 'type': 'str'}, - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'relative_path_parameters': {'key': 'relativePathParameters', 'type': '[str]'}, - 'queries': {'key': 'queries', 'type': 'WorkflowTriggerListCallbackUrlQueries'}, + "value": {"key": "value", "type": "str"}, + "method": {"key": "method", "type": "str"}, + "base_path": {"key": "basePath", "type": "str"}, + "relative_path": {"key": "relativePath", "type": "str"}, + "relative_path_parameters": {"key": "relativePathParameters", "type": "[str]"}, + "queries": {"key": "queries", "type": "WorkflowTriggerListCallbackUrlQueries"}, } def __init__( self, *, relative_path_parameters: Optional[List[str]] = None, - queries: Optional["WorkflowTriggerListCallbackUrlQueries"] = None, + queries: Optional["_models.WorkflowTriggerListCallbackUrlQueries"] = None, **kwargs ): """ @@ -9707,7 +9451,7 @@ def __init__( :keyword queries: Gets the workflow trigger callback URL query parameters. :paramtype queries: ~azure.mgmt.logic.models.WorkflowTriggerListCallbackUrlQueries """ - super(WorkflowTriggerCallbackUrl, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = None self.method = None self.base_path = None @@ -9716,34 +9460,29 @@ def __init__( self.queries = queries -class WorkflowTriggerFilter(msrest.serialization.Model): +class WorkflowTriggerFilter(_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", and "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState """ _attribute_map = { - 'state': {'key': 'state', 'type': 'str'}, + "state": {"key": "state", "type": "str"}, } - def __init__( - self, - *, - state: Optional[Union[str, "WorkflowState"]] = None, - **kwargs - ): + def __init__(self, *, 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", and "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState """ - super(WorkflowTriggerFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.state = state -class WorkflowTriggerHistory(SubResource): +class WorkflowTriggerHistory(SubResource): # pylint: disable=too-many-instance-attributes """The workflow trigger history. Variables are only populated by the server, and will be ignored when sending a request. @@ -9760,14 +9499,14 @@ 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". + "Aborted", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus :ivar code: Gets the code. :vartype code: str :ivar error: Gets the error. - :vartype error: any + :vartype error: JSON :ivar tracking_id: Gets the tracking id. :vartype tracking_id: str :ivar correlation: The run correlation. @@ -9783,51 +9522,46 @@ class WorkflowTriggerHistory(SubResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'scheduled_time': {'readonly': True}, - 'status': {'readonly': True}, - 'code': {'readonly': True}, - 'error': {'readonly': True}, - 'tracking_id': {'readonly': True}, - 'inputs_link': {'readonly': True}, - 'outputs_link': {'readonly': True}, - 'fired': {'readonly': True}, - 'run': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'scheduled_time': {'key': 'properties.scheduledTime', 'type': 'iso-8601'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'code': {'key': 'properties.code', 'type': 'str'}, - 'error': {'key': 'properties.error', 'type': 'object'}, - 'tracking_id': {'key': 'properties.trackingId', 'type': 'str'}, - 'correlation': {'key': 'properties.correlation', 'type': 'Correlation'}, - 'inputs_link': {'key': 'properties.inputsLink', 'type': 'ContentLink'}, - 'outputs_link': {'key': 'properties.outputsLink', 'type': 'ContentLink'}, - 'fired': {'key': 'properties.fired', 'type': 'bool'}, - 'run': {'key': 'properties.run', 'type': 'ResourceReference'}, - } - - def __init__( - self, - *, - correlation: Optional["Correlation"] = None, - **kwargs - ): + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "start_time": {"readonly": True}, + "end_time": {"readonly": True}, + "scheduled_time": {"readonly": True}, + "status": {"readonly": True}, + "code": {"readonly": True}, + "error": {"readonly": True}, + "tracking_id": {"readonly": True}, + "inputs_link": {"readonly": True}, + "outputs_link": {"readonly": True}, + "fired": {"readonly": True}, + "run": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "end_time": {"key": "properties.endTime", "type": "iso-8601"}, + "scheduled_time": {"key": "properties.scheduledTime", "type": "iso-8601"}, + "status": {"key": "properties.status", "type": "str"}, + "code": {"key": "properties.code", "type": "str"}, + "error": {"key": "properties.error", "type": "object"}, + "tracking_id": {"key": "properties.trackingId", "type": "str"}, + "correlation": {"key": "properties.correlation", "type": "Correlation"}, + "inputs_link": {"key": "properties.inputsLink", "type": "ContentLink"}, + "outputs_link": {"key": "properties.outputsLink", "type": "ContentLink"}, + "fired": {"key": "properties.fired", "type": "bool"}, + "run": {"key": "properties.run", "type": "ResourceReference"}, + } + + def __init__(self, *, correlation: Optional["_models.Correlation"] = None, **kwargs): """ :keyword correlation: The run correlation. :paramtype correlation: ~azure.mgmt.logic.models.Correlation """ - super(WorkflowTriggerHistory, self).__init__(**kwargs) + super().__init__(**kwargs) self.name = None self.type = None self.start_time = None @@ -9844,36 +9578,31 @@ def __init__( self.run = None -class WorkflowTriggerHistoryFilter(msrest.serialization.Model): +class WorkflowTriggerHistoryFilter(_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". + "Faulted", "TimedOut", "Aborted", and "Ignored". :vartype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, + "status": {"key": "status", "type": "str"}, } - def __init__( - self, - *, - status: Optional[Union[str, "WorkflowStatus"]] = None, - **kwargs - ): + def __init__(self, *, 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", and "Ignored". :paramtype status: str or ~azure.mgmt.logic.models.WorkflowStatus """ - super(WorkflowTriggerHistoryFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.status = status -class WorkflowTriggerHistoryListResult(msrest.serialization.Model): +class WorkflowTriggerHistoryListResult(_serialization.Model): """The list of workflow trigger histories. :ivar value: A list of workflow trigger histories. @@ -9883,14 +9612,14 @@ class WorkflowTriggerHistoryListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkflowTriggerHistory]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[WorkflowTriggerHistory]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( self, *, - value: Optional[List["WorkflowTriggerHistory"]] = None, + value: Optional[List["_models.WorkflowTriggerHistory"]] = None, next_link: Optional[str] = None, **kwargs ): @@ -9900,12 +9629,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(WorkflowTriggerHistoryListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class WorkflowTriggerListCallbackUrlQueries(msrest.serialization.Model): +class WorkflowTriggerListCallbackUrlQueries(_serialization.Model): """Gets the workflow trigger callback URL query parameters. :ivar api_version: The api version. @@ -9921,11 +9650,11 @@ class WorkflowTriggerListCallbackUrlQueries(msrest.serialization.Model): """ _attribute_map = { - 'api_version': {'key': 'api-version', 'type': 'str'}, - 'sp': {'key': 'sp', 'type': 'str'}, - 'sv': {'key': 'sv', 'type': 'str'}, - 'sig': {'key': 'sig', 'type': 'str'}, - 'se': {'key': 'se', 'type': 'str'}, + "api_version": {"key": "api-version", "type": "str"}, + "sp": {"key": "sp", "type": "str"}, + "sv": {"key": "sv", "type": "str"}, + "sig": {"key": "sig", "type": "str"}, + "se": {"key": "se", "type": "str"}, } def __init__( @@ -9950,7 +9679,7 @@ def __init__( :keyword se: The SAS timestamp. :paramtype se: str """ - super(WorkflowTriggerListCallbackUrlQueries, self).__init__(**kwargs) + super().__init__(**kwargs) self.api_version = api_version self.sp = sp self.sv = sv @@ -9958,7 +9687,7 @@ def __init__( self.se = se -class WorkflowTriggerListResult(msrest.serialization.Model): +class WorkflowTriggerListResult(_serialization.Model): """The list of workflow triggers. :ivar value: A list of workflow triggers. @@ -9968,16 +9697,12 @@ class WorkflowTriggerListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkflowTrigger]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[WorkflowTrigger]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["WorkflowTrigger"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.WorkflowTrigger"]] = None, next_link: Optional[str] = None, **kwargs ): """ :keyword value: A list of workflow triggers. @@ -9985,16 +9710,16 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(WorkflowTriggerListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class WorkflowTriggerRecurrence(msrest.serialization.Model): +class WorkflowTriggerRecurrence(_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", and "Year". :vartype frequency: str or ~azure.mgmt.logic.models.RecurrenceFrequency :ivar interval: The interval. :vartype interval: int @@ -10009,28 +9734,28 @@ class WorkflowTriggerRecurrence(msrest.serialization.Model): """ _attribute_map = { - 'frequency': {'key': 'frequency', 'type': 'str'}, - 'interval': {'key': 'interval', 'type': 'int'}, - 'start_time': {'key': 'startTime', 'type': 'str'}, - 'end_time': {'key': 'endTime', 'type': 'str'}, - 'time_zone': {'key': 'timeZone', 'type': 'str'}, - 'schedule': {'key': 'schedule', 'type': 'RecurrenceSchedule'}, + "frequency": {"key": "frequency", "type": "str"}, + "interval": {"key": "interval", "type": "int"}, + "start_time": {"key": "startTime", "type": "str"}, + "end_time": {"key": "endTime", "type": "str"}, + "time_zone": {"key": "timeZone", "type": "str"}, + "schedule": {"key": "schedule", "type": "RecurrenceSchedule"}, } 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", - "Hour", "Day", "Week", "Month", "Year". + :keyword frequency: The frequency. Known values are: "NotSpecified", "Second", "Minute", + "Hour", "Day", "Week", "Month", and "Year". :paramtype frequency: str or ~azure.mgmt.logic.models.RecurrenceFrequency :keyword interval: The interval. :paramtype interval: int @@ -10043,7 +9768,7 @@ def __init__( :keyword schedule: The recurrence schedule. :paramtype schedule: ~azure.mgmt.logic.models.RecurrenceSchedule """ - super(WorkflowTriggerRecurrence, self).__init__(**kwargs) + super().__init__(**kwargs) self.frequency = frequency self.interval = interval self.start_time = start_time @@ -10070,22 +9795,22 @@ class WorkflowTriggerReference(ResourceReference): """ _validation = { - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'flow_name': {'key': 'flowName', 'type': 'str'}, - 'trigger_name': {'key': 'triggerName', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "flow_name": {"key": "flowName", "type": "str"}, + "trigger_name": {"key": "triggerName", "type": "str"}, } def __init__( self, *, - id: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin flow_name: Optional[str] = None, trigger_name: Optional[str] = None, **kwargs @@ -10098,12 +9823,12 @@ def __init__( :keyword trigger_name: The workflow trigger name. :paramtype trigger_name: str """ - super(WorkflowTriggerReference, self).__init__(id=id, **kwargs) + super().__init__(id=id, **kwargs) self.flow_name = flow_name self.trigger_name = trigger_name -class WorkflowVersion(Resource): +class WorkflowVersion(Resource): # pylint: disable=too-many-instance-attributes """The workflow version. Variables are only populated by the server, and will be ignored when sending a request. @@ -10116,19 +9841,19 @@ class WorkflowVersion(Resource): :vartype type: str :ivar location: The resource location. :vartype location: str - :ivar tags: A set of tags. The resource tags. + :ivar 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", - "Unregistered", "Completed", "Renewing", "Pending", "Waiting", "InProgress". + :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", and "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", and "Suspended". :vartype state: str or ~azure.mgmt.logic.models.WorkflowState :ivar version: Gets the version. :vartype version: str @@ -10143,41 +9868,41 @@ class WorkflowVersion(Resource): :ivar integration_account: The integration account. :vartype integration_account: ~azure.mgmt.logic.models.ResourceReference :ivar definition: The definition. - :vartype definition: any + :vartype definition: JSON :ivar parameters: The parameters. :vartype parameters: dict[str, ~azure.mgmt.logic.models.WorkflowParameter] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'created_time': {'readonly': True}, - 'changed_time': {'readonly': True}, - 'version': {'readonly': True}, - 'access_endpoint': {'readonly': True}, - 'sku': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, - 'changed_time': {'key': 'properties.changedTime', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'access_endpoint': {'key': 'properties.accessEndpoint', 'type': 'str'}, - 'endpoints_configuration': {'key': 'properties.endpointsConfiguration', 'type': 'FlowEndpointsConfiguration'}, - 'access_control': {'key': 'properties.accessControl', 'type': 'FlowAccessControlConfiguration'}, - 'sku': {'key': 'properties.sku', 'type': 'Sku'}, - 'integration_account': {'key': 'properties.integrationAccount', 'type': 'ResourceReference'}, - 'definition': {'key': 'properties.definition', 'type': 'object'}, - 'parameters': {'key': 'properties.parameters', 'type': '{WorkflowParameter}'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, + "created_time": {"readonly": True}, + "changed_time": {"readonly": True}, + "version": {"readonly": True}, + "access_endpoint": {"readonly": True}, + "sku": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "changed_time": {"key": "properties.changedTime", "type": "iso-8601"}, + "state": {"key": "properties.state", "type": "str"}, + "version": {"key": "properties.version", "type": "str"}, + "access_endpoint": {"key": "properties.accessEndpoint", "type": "str"}, + "endpoints_configuration": {"key": "properties.endpointsConfiguration", "type": "FlowEndpointsConfiguration"}, + "access_control": {"key": "properties.accessControl", "type": "FlowAccessControlConfiguration"}, + "sku": {"key": "properties.sku", "type": "Sku"}, + "integration_account": {"key": "properties.integrationAccount", "type": "ResourceReference"}, + "definition": {"key": "properties.definition", "type": "object"}, + "parameters": {"key": "properties.parameters", "type": "{WorkflowParameter}"}, } def __init__( @@ -10185,21 +9910,21 @@ 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, - definition: Optional[Any] = None, - parameters: Optional[Dict[str, "WorkflowParameter"]] = 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[JSON] = None, + parameters: Optional[Dict[str, "_models.WorkflowParameter"]] = None, **kwargs ): """ :keyword location: The resource location. :paramtype location: str - :keyword tags: A set of tags. The resource tags. + :keyword tags: The resource tags. :paramtype tags: dict[str, str] - :keyword state: The state. Possible values include: "NotSpecified", "Completed", "Enabled", - "Disabled", "Deleted", "Suspended". + :keyword state: The state. Known values are: "NotSpecified", "Completed", "Enabled", + "Disabled", "Deleted", and "Suspended". :paramtype state: str or ~azure.mgmt.logic.models.WorkflowState :keyword endpoints_configuration: The endpoints configuration. :paramtype endpoints_configuration: ~azure.mgmt.logic.models.FlowEndpointsConfiguration @@ -10208,11 +9933,11 @@ def __init__( :keyword integration_account: The integration account. :paramtype integration_account: ~azure.mgmt.logic.models.ResourceReference :keyword definition: The definition. - :paramtype definition: any + :paramtype definition: JSON :keyword parameters: The parameters. :paramtype parameters: dict[str, ~azure.mgmt.logic.models.WorkflowParameter] """ - super(WorkflowVersion, self).__init__(location=location, tags=tags, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.provisioning_state = None self.created_time = None self.changed_time = None @@ -10227,7 +9952,7 @@ def __init__( self.parameters = parameters -class WorkflowVersionListResult(msrest.serialization.Model): +class WorkflowVersionListResult(_serialization.Model): """The list of workflow versions. :ivar value: A list of workflow versions. @@ -10237,16 +9962,12 @@ class WorkflowVersionListResult(msrest.serialization.Model): """ _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkflowVersion]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[WorkflowVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - value: Optional[List["WorkflowVersion"]] = None, - next_link: Optional[str] = None, - **kwargs + self, *, value: Optional[List["_models.WorkflowVersion"]] = None, next_link: Optional[str] = None, **kwargs ): """ :keyword value: A list of workflow versions. @@ -10254,12 +9975,12 @@ def __init__( :keyword next_link: The URL to get the next set of results. :paramtype next_link: str """ - super(WorkflowVersionListResult, self).__init__(**kwargs) + super().__init__(**kwargs) self.value = value self.next_link = next_link -class WsdlService(msrest.serialization.Model): +class WsdlService(_serialization.Model): """The WSDL service. :ivar qualified_name: The qualified name. @@ -10269,16 +9990,12 @@ class WsdlService(msrest.serialization.Model): """ _attribute_map = { - 'qualified_name': {'key': 'qualifiedName', 'type': 'str'}, - 'endpoint_qualified_names': {'key': 'EndpointQualifiedNames', 'type': '[str]'}, + "qualified_name": {"key": "qualifiedName", "type": "str"}, + "endpoint_qualified_names": {"key": "EndpointQualifiedNames", "type": "[str]"}, } def __init__( - self, - *, - qualified_name: Optional[str] = None, - endpoint_qualified_names: Optional[List[str]] = None, - **kwargs + self, *, qualified_name: Optional[str] = None, endpoint_qualified_names: Optional[List[str]] = None, **kwargs ): """ :keyword qualified_name: The qualified name. @@ -10286,89 +10003,89 @@ def __init__( :keyword endpoint_qualified_names: The list of endpoints' qualified names. :paramtype endpoint_qualified_names: list[str] """ - super(WsdlService, self).__init__(**kwargs) + super().__init__(**kwargs) self.qualified_name = qualified_name self.endpoint_qualified_names = endpoint_qualified_names -class X12AcknowledgementSettings(msrest.serialization.Model): +class X12AcknowledgementSettings(_serialization.Model): # pylint: disable=too-many-instance-attributes """The X12 agreement acknowledgement settings. All required parameters must be populated in order to send to Azure. - :ivar need_technical_acknowledgement: Required. The value indicating whether technical - acknowledgement is needed. + :ivar need_technical_acknowledgement: The value indicating whether technical acknowledgement is + needed. Required. :vartype need_technical_acknowledgement: bool - :ivar batch_technical_acknowledgements: Required. The value indicating whether to batch the - technical acknowledgements. + :ivar batch_technical_acknowledgements: The value indicating whether to batch the technical + acknowledgements. Required. :vartype batch_technical_acknowledgements: bool - :ivar need_functional_acknowledgement: Required. The value indicating whether functional - acknowledgement is needed. + :ivar need_functional_acknowledgement: The value indicating whether functional acknowledgement + is needed. Required. :vartype need_functional_acknowledgement: bool :ivar functional_acknowledgement_version: The functional acknowledgement version. :vartype functional_acknowledgement_version: str - :ivar batch_functional_acknowledgements: Required. The value indicating whether to batch - functional acknowledgements. + :ivar batch_functional_acknowledgements: The value indicating whether to batch functional + acknowledgements. Required. :vartype batch_functional_acknowledgements: bool - :ivar need_implementation_acknowledgement: Required. The value indicating whether - implementation acknowledgement is needed. + :ivar need_implementation_acknowledgement: The value indicating whether implementation + acknowledgement is needed. Required. :vartype need_implementation_acknowledgement: bool :ivar implementation_acknowledgement_version: The implementation acknowledgement version. :vartype implementation_acknowledgement_version: str - :ivar batch_implementation_acknowledgements: Required. The value indicating whether to batch - implementation acknowledgements. + :ivar batch_implementation_acknowledgements: The value indicating whether to batch + implementation acknowledgements. Required. :vartype batch_implementation_acknowledgements: bool - :ivar need_loop_for_valid_messages: Required. The value indicating whether a loop is needed for - valid messages. + :ivar need_loop_for_valid_messages: The value indicating whether a loop is needed for valid + messages. Required. :vartype need_loop_for_valid_messages: bool - :ivar send_synchronous_acknowledgement: Required. The value indicating whether to send - synchronous acknowledgement. + :ivar send_synchronous_acknowledgement: The value indicating whether to send synchronous + acknowledgement. Required. :vartype send_synchronous_acknowledgement: bool :ivar acknowledgement_control_number_prefix: The acknowledgement control number prefix. :vartype acknowledgement_control_number_prefix: str :ivar acknowledgement_control_number_suffix: The acknowledgement control number suffix. :vartype acknowledgement_control_number_suffix: str - :ivar acknowledgement_control_number_lower_bound: Required. The acknowledgement control number - lower bound. + :ivar acknowledgement_control_number_lower_bound: The acknowledgement control number lower + bound. Required. :vartype acknowledgement_control_number_lower_bound: int - :ivar acknowledgement_control_number_upper_bound: Required. The acknowledgement control number - upper bound. + :ivar acknowledgement_control_number_upper_bound: The acknowledgement control number upper + bound. Required. :vartype acknowledgement_control_number_upper_bound: int - :ivar rollover_acknowledgement_control_number: Required. The value indicating whether to - rollover acknowledgement control number. + :ivar rollover_acknowledgement_control_number: The value indicating whether to rollover + acknowledgement control number. Required. :vartype rollover_acknowledgement_control_number: bool """ _validation = { - 'need_technical_acknowledgement': {'required': True}, - 'batch_technical_acknowledgements': {'required': True}, - 'need_functional_acknowledgement': {'required': True}, - 'batch_functional_acknowledgements': {'required': True}, - 'need_implementation_acknowledgement': {'required': True}, - 'batch_implementation_acknowledgements': {'required': True}, - 'need_loop_for_valid_messages': {'required': True}, - 'send_synchronous_acknowledgement': {'required': True}, - 'acknowledgement_control_number_lower_bound': {'required': True}, - 'acknowledgement_control_number_upper_bound': {'required': True}, - 'rollover_acknowledgement_control_number': {'required': True}, - } - - _attribute_map = { - 'need_technical_acknowledgement': {'key': 'needTechnicalAcknowledgement', 'type': 'bool'}, - 'batch_technical_acknowledgements': {'key': 'batchTechnicalAcknowledgements', 'type': 'bool'}, - 'need_functional_acknowledgement': {'key': 'needFunctionalAcknowledgement', 'type': 'bool'}, - 'functional_acknowledgement_version': {'key': 'functionalAcknowledgementVersion', 'type': 'str'}, - 'batch_functional_acknowledgements': {'key': 'batchFunctionalAcknowledgements', 'type': 'bool'}, - 'need_implementation_acknowledgement': {'key': 'needImplementationAcknowledgement', 'type': 'bool'}, - 'implementation_acknowledgement_version': {'key': 'implementationAcknowledgementVersion', 'type': 'str'}, - 'batch_implementation_acknowledgements': {'key': 'batchImplementationAcknowledgements', 'type': 'bool'}, - 'need_loop_for_valid_messages': {'key': 'needLoopForValidMessages', 'type': 'bool'}, - 'send_synchronous_acknowledgement': {'key': 'sendSynchronousAcknowledgement', 'type': 'bool'}, - 'acknowledgement_control_number_prefix': {'key': 'acknowledgementControlNumberPrefix', 'type': 'str'}, - 'acknowledgement_control_number_suffix': {'key': 'acknowledgementControlNumberSuffix', 'type': 'str'}, - 'acknowledgement_control_number_lower_bound': {'key': 'acknowledgementControlNumberLowerBound', 'type': 'int'}, - 'acknowledgement_control_number_upper_bound': {'key': 'acknowledgementControlNumberUpperBound', 'type': 'int'}, - 'rollover_acknowledgement_control_number': {'key': 'rolloverAcknowledgementControlNumber', 'type': 'bool'}, + "need_technical_acknowledgement": {"required": True}, + "batch_technical_acknowledgements": {"required": True}, + "need_functional_acknowledgement": {"required": True}, + "batch_functional_acknowledgements": {"required": True}, + "need_implementation_acknowledgement": {"required": True}, + "batch_implementation_acknowledgements": {"required": True}, + "need_loop_for_valid_messages": {"required": True}, + "send_synchronous_acknowledgement": {"required": True}, + "acknowledgement_control_number_lower_bound": {"required": True}, + "acknowledgement_control_number_upper_bound": {"required": True}, + "rollover_acknowledgement_control_number": {"required": True}, + } + + _attribute_map = { + "need_technical_acknowledgement": {"key": "needTechnicalAcknowledgement", "type": "bool"}, + "batch_technical_acknowledgements": {"key": "batchTechnicalAcknowledgements", "type": "bool"}, + "need_functional_acknowledgement": {"key": "needFunctionalAcknowledgement", "type": "bool"}, + "functional_acknowledgement_version": {"key": "functionalAcknowledgementVersion", "type": "str"}, + "batch_functional_acknowledgements": {"key": "batchFunctionalAcknowledgements", "type": "bool"}, + "need_implementation_acknowledgement": {"key": "needImplementationAcknowledgement", "type": "bool"}, + "implementation_acknowledgement_version": {"key": "implementationAcknowledgementVersion", "type": "str"}, + "batch_implementation_acknowledgements": {"key": "batchImplementationAcknowledgements", "type": "bool"}, + "need_loop_for_valid_messages": {"key": "needLoopForValidMessages", "type": "bool"}, + "send_synchronous_acknowledgement": {"key": "sendSynchronousAcknowledgement", "type": "bool"}, + "acknowledgement_control_number_prefix": {"key": "acknowledgementControlNumberPrefix", "type": "str"}, + "acknowledgement_control_number_suffix": {"key": "acknowledgementControlNumberSuffix", "type": "str"}, + "acknowledgement_control_number_lower_bound": {"key": "acknowledgementControlNumberLowerBound", "type": "int"}, + "acknowledgement_control_number_upper_bound": {"key": "acknowledgementControlNumberUpperBound", "type": "int"}, + "rollover_acknowledgement_control_number": {"key": "rolloverAcknowledgementControlNumber", "type": "bool"}, } def __init__( @@ -10392,49 +10109,49 @@ def __init__( **kwargs ): """ - :keyword need_technical_acknowledgement: Required. The value indicating whether technical - acknowledgement is needed. + :keyword need_technical_acknowledgement: The value indicating whether technical acknowledgement + is needed. Required. :paramtype need_technical_acknowledgement: bool - :keyword batch_technical_acknowledgements: Required. The value indicating whether to batch the - technical acknowledgements. + :keyword batch_technical_acknowledgements: The value indicating whether to batch the technical + acknowledgements. Required. :paramtype batch_technical_acknowledgements: bool - :keyword need_functional_acknowledgement: Required. The value indicating whether functional - acknowledgement is needed. + :keyword need_functional_acknowledgement: The value indicating whether functional + acknowledgement is needed. Required. :paramtype need_functional_acknowledgement: bool :keyword functional_acknowledgement_version: The functional acknowledgement version. :paramtype functional_acknowledgement_version: str - :keyword batch_functional_acknowledgements: Required. The value indicating whether to batch - functional acknowledgements. + :keyword batch_functional_acknowledgements: The value indicating whether to batch functional + acknowledgements. Required. :paramtype batch_functional_acknowledgements: bool - :keyword need_implementation_acknowledgement: Required. The value indicating whether - implementation acknowledgement is needed. + :keyword need_implementation_acknowledgement: The value indicating whether implementation + acknowledgement is needed. Required. :paramtype need_implementation_acknowledgement: bool :keyword implementation_acknowledgement_version: The implementation acknowledgement version. :paramtype implementation_acknowledgement_version: str - :keyword batch_implementation_acknowledgements: Required. The value indicating whether to batch - implementation acknowledgements. + :keyword batch_implementation_acknowledgements: The value indicating whether to batch + implementation acknowledgements. Required. :paramtype batch_implementation_acknowledgements: bool - :keyword need_loop_for_valid_messages: Required. The value indicating whether a loop is needed - for valid messages. + :keyword need_loop_for_valid_messages: The value indicating whether a loop is needed for valid + messages. Required. :paramtype need_loop_for_valid_messages: bool - :keyword send_synchronous_acknowledgement: Required. The value indicating whether to send - synchronous acknowledgement. + :keyword send_synchronous_acknowledgement: The value indicating whether to send synchronous + acknowledgement. Required. :paramtype send_synchronous_acknowledgement: bool :keyword acknowledgement_control_number_prefix: The acknowledgement control number prefix. :paramtype acknowledgement_control_number_prefix: str :keyword acknowledgement_control_number_suffix: The acknowledgement control number suffix. :paramtype acknowledgement_control_number_suffix: str - :keyword acknowledgement_control_number_lower_bound: Required. The acknowledgement control - number lower bound. + :keyword acknowledgement_control_number_lower_bound: The acknowledgement control number lower + bound. Required. :paramtype acknowledgement_control_number_lower_bound: int - :keyword acknowledgement_control_number_upper_bound: Required. The acknowledgement control - number upper bound. + :keyword acknowledgement_control_number_upper_bound: The acknowledgement control number upper + bound. Required. :paramtype acknowledgement_control_number_upper_bound: int - :keyword rollover_acknowledgement_control_number: Required. The value indicating whether to - rollover acknowledgement control number. + :keyword rollover_acknowledgement_control_number: The value indicating whether to rollover + acknowledgement control number. Required. :paramtype rollover_acknowledgement_control_number: bool """ - super(X12AcknowledgementSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.need_technical_acknowledgement = need_technical_acknowledgement self.batch_technical_acknowledgements = batch_technical_acknowledgements self.need_functional_acknowledgement = need_functional_acknowledgement @@ -10452,46 +10169,42 @@ def __init__( self.rollover_acknowledgement_control_number = rollover_acknowledgement_control_number -class X12AgreementContent(msrest.serialization.Model): +class X12AgreementContent(_serialization.Model): """The X12 agreement content. All required parameters must be populated in order to send to Azure. - :ivar receive_agreement: Required. The X12 one-way receive agreement. + :ivar receive_agreement: The X12 one-way receive agreement. Required. :vartype receive_agreement: ~azure.mgmt.logic.models.X12OneWayAgreement - :ivar send_agreement: Required. The X12 one-way send agreement. + :ivar send_agreement: The X12 one-way send agreement. Required. :vartype send_agreement: ~azure.mgmt.logic.models.X12OneWayAgreement """ _validation = { - 'receive_agreement': {'required': True}, - 'send_agreement': {'required': True}, + "receive_agreement": {"required": True}, + "send_agreement": {"required": True}, } _attribute_map = { - 'receive_agreement': {'key': 'receiveAgreement', 'type': 'X12OneWayAgreement'}, - 'send_agreement': {'key': 'sendAgreement', 'type': 'X12OneWayAgreement'}, + "receive_agreement": {"key": "receiveAgreement", "type": "X12OneWayAgreement"}, + "send_agreement": {"key": "sendAgreement", "type": "X12OneWayAgreement"}, } def __init__( - self, - *, - receive_agreement: "X12OneWayAgreement", - send_agreement: "X12OneWayAgreement", - **kwargs + self, *, receive_agreement: "_models.X12OneWayAgreement", send_agreement: "_models.X12OneWayAgreement", **kwargs ): """ - :keyword receive_agreement: Required. The X12 one-way receive agreement. + :keyword receive_agreement: The X12 one-way receive agreement. Required. :paramtype receive_agreement: ~azure.mgmt.logic.models.X12OneWayAgreement - :keyword send_agreement: Required. The X12 one-way send agreement. + :keyword send_agreement: The X12 one-way send agreement. Required. :paramtype send_agreement: ~azure.mgmt.logic.models.X12OneWayAgreement """ - super(X12AgreementContent, self).__init__(**kwargs) + super().__init__(**kwargs) self.receive_agreement = receive_agreement self.send_agreement = send_agreement -class X12DelimiterOverrides(msrest.serialization.Model): +class X12DelimiterOverrides(_serialization.Model): """The X12 delimiter override settings. All required parameters must be populated in order to send to Azure. @@ -10500,19 +10213,19 @@ class X12DelimiterOverrides(msrest.serialization.Model): :vartype protocol_version: str :ivar message_id: The message id. :vartype message_id: str - :ivar data_element_separator: Required. The data element separator. + :ivar data_element_separator: The data element separator. Required. :vartype data_element_separator: int - :ivar component_separator: Required. The component separator. + :ivar component_separator: The component separator. Required. :vartype component_separator: int - :ivar segment_terminator: Required. The segment terminator. + :ivar segment_terminator: The segment terminator. Required. :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: The segment terminator suffix. Required. Known values are: + "NotSpecified", "None", "CR", "LF", and "CRLF". :vartype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix - :ivar replace_character: Required. The replacement character. + :ivar replace_character: The replacement character. Required. :vartype replace_character: int - :ivar replace_separators_in_payload: Required. The value indicating whether to replace - separators in payload. + :ivar replace_separators_in_payload: The value indicating whether to replace separators in + payload. Required. :vartype replace_separators_in_payload: bool :ivar target_namespace: The target namespace on which this delimiter settings has to be applied. @@ -10520,24 +10233,24 @@ class X12DelimiterOverrides(msrest.serialization.Model): """ _validation = { - 'data_element_separator': {'required': True}, - 'component_separator': {'required': True}, - 'segment_terminator': {'required': True}, - 'segment_terminator_suffix': {'required': True}, - 'replace_character': {'required': True}, - 'replace_separators_in_payload': {'required': True}, + "data_element_separator": {"required": True}, + "component_separator": {"required": True}, + "segment_terminator": {"required": True}, + "segment_terminator_suffix": {"required": True}, + "replace_character": {"required": True}, + "replace_separators_in_payload": {"required": True}, } _attribute_map = { - 'protocol_version': {'key': 'protocolVersion', 'type': 'str'}, - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, - 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, - 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, - 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, - 'replace_character': {'key': 'replaceCharacter', 'type': 'int'}, - 'replace_separators_in_payload': {'key': 'replaceSeparatorsInPayload', 'type': 'bool'}, - 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, + "protocol_version": {"key": "protocolVersion", "type": "str"}, + "message_id": {"key": "messageId", "type": "str"}, + "data_element_separator": {"key": "dataElementSeparator", "type": "int"}, + "component_separator": {"key": "componentSeparator", "type": "int"}, + "segment_terminator": {"key": "segmentTerminator", "type": "int"}, + "segment_terminator_suffix": {"key": "segmentTerminatorSuffix", "type": "str"}, + "replace_character": {"key": "replaceCharacter", "type": "int"}, + "replace_separators_in_payload": {"key": "replaceSeparatorsInPayload", "type": "bool"}, + "target_namespace": {"key": "targetNamespace", "type": "str"}, } def __init__( @@ -10546,7 +10259,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, @@ -10559,25 +10272,25 @@ def __init__( :paramtype protocol_version: str :keyword message_id: The message id. :paramtype message_id: str - :keyword data_element_separator: Required. The data element separator. + :keyword data_element_separator: The data element separator. Required. :paramtype data_element_separator: int - :keyword component_separator: Required. The component separator. + :keyword component_separator: The component separator. Required. :paramtype component_separator: int - :keyword segment_terminator: Required. The segment terminator. + :keyword segment_terminator: The segment terminator. Required. :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: The segment terminator suffix. Required. Known values are: + "NotSpecified", "None", "CR", "LF", and "CRLF". :paramtype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix - :keyword replace_character: Required. The replacement character. + :keyword replace_character: The replacement character. Required. :paramtype replace_character: int - :keyword replace_separators_in_payload: Required. The value indicating whether to replace - separators in payload. + :keyword replace_separators_in_payload: The value indicating whether to replace separators in + payload. Required. :paramtype replace_separators_in_payload: bool :keyword target_namespace: The target namespace on which this delimiter settings has to be applied. :paramtype target_namespace: str """ - super(X12DelimiterOverrides, self).__init__(**kwargs) + super().__init__(**kwargs) self.protocol_version = protocol_version self.message_id = message_id self.data_element_separator = data_element_separator @@ -10589,60 +10302,60 @@ def __init__( self.target_namespace = target_namespace -class X12EnvelopeOverride(msrest.serialization.Model): +class X12EnvelopeOverride(_serialization.Model): """The X12 envelope override settings. All required parameters must be populated in order to send to Azure. - :ivar target_namespace: Required. The target namespace on which this envelope settings has to - be applied. + :ivar target_namespace: The target namespace on which this envelope settings has to be applied. + Required. :vartype target_namespace: str - :ivar protocol_version: Required. The protocol version on which this envelope settings has to - be applied. + :ivar protocol_version: The protocol version on which this envelope settings has to be applied. + Required. :vartype protocol_version: str - :ivar message_id: Required. The message id on which this envelope settings has to be applied. + :ivar message_id: The message id on which this envelope settings has to be applied. Required. :vartype message_id: str - :ivar responsible_agency_code: Required. The responsible agency code. + :ivar responsible_agency_code: The responsible agency code. Required. :vartype responsible_agency_code: str - :ivar header_version: Required. The header version. + :ivar header_version: The header version. Required. :vartype header_version: str - :ivar sender_application_id: Required. The sender application id. + :ivar sender_application_id: The sender application id. Required. :vartype sender_application_id: str - :ivar receiver_application_id: Required. The receiver application id. + :ivar receiver_application_id: The receiver application id. Required. :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: The date format. Required. Known values are: "NotSpecified", "CCYYMMDD", and + "YYMMDD". :vartype date_format: str or ~azure.mgmt.logic.models.X12DateFormat - :ivar time_format: Required. The time format. Possible values include: "NotSpecified", "HHMM", - "HHMMSS", "HHMMSSdd", "HHMMSSd". + :ivar time_format: The time format. Required. Known values are: "NotSpecified", "HHMM", + "HHMMSS", "HHMMSSdd", and "HHMMSSd". :vartype time_format: str or ~azure.mgmt.logic.models.X12TimeFormat """ _validation = { - 'target_namespace': {'required': True}, - 'protocol_version': {'required': True}, - 'message_id': {'required': True}, - 'responsible_agency_code': {'required': True}, - 'header_version': {'required': True}, - 'sender_application_id': {'required': True}, - 'receiver_application_id': {'required': True}, - 'date_format': {'required': True}, - 'time_format': {'required': True}, + "target_namespace": {"required": True}, + "protocol_version": {"required": True}, + "message_id": {"required": True}, + "responsible_agency_code": {"required": True}, + "header_version": {"required": True}, + "sender_application_id": {"required": True}, + "receiver_application_id": {"required": True}, + "date_format": {"required": True}, + "time_format": {"required": True}, } _attribute_map = { - 'target_namespace': {'key': 'targetNamespace', 'type': 'str'}, - 'protocol_version': {'key': 'protocolVersion', 'type': 'str'}, - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'responsible_agency_code': {'key': 'responsibleAgencyCode', 'type': 'str'}, - 'header_version': {'key': 'headerVersion', 'type': 'str'}, - 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, - 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, - 'functional_identifier_code': {'key': 'functionalIdentifierCode', 'type': 'str'}, - 'date_format': {'key': 'dateFormat', 'type': 'str'}, - 'time_format': {'key': 'timeFormat', 'type': 'str'}, + "target_namespace": {"key": "targetNamespace", "type": "str"}, + "protocol_version": {"key": "protocolVersion", "type": "str"}, + "message_id": {"key": "messageId", "type": "str"}, + "responsible_agency_code": {"key": "responsibleAgencyCode", "type": "str"}, + "header_version": {"key": "headerVersion", "type": "str"}, + "sender_application_id": {"key": "senderApplicationId", "type": "str"}, + "receiver_application_id": {"key": "receiverApplicationId", "type": "str"}, + "functional_identifier_code": {"key": "functionalIdentifierCode", "type": "str"}, + "date_format": {"key": "dateFormat", "type": "str"}, + "time_format": {"key": "timeFormat", "type": "str"}, } def __init__( @@ -10655,39 +10368,39 @@ 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 ): """ - :keyword target_namespace: Required. The target namespace on which this envelope settings has - to be applied. + :keyword target_namespace: The target namespace on which this envelope settings has to be + applied. Required. :paramtype target_namespace: str - :keyword protocol_version: Required. The protocol version on which this envelope settings has - to be applied. + :keyword protocol_version: The protocol version on which this envelope settings has to be + applied. Required. :paramtype protocol_version: str - :keyword message_id: Required. The message id on which this envelope settings has to be - applied. + :keyword message_id: The message id on which this envelope settings has to be applied. + Required. :paramtype message_id: str - :keyword responsible_agency_code: Required. The responsible agency code. + :keyword responsible_agency_code: The responsible agency code. Required. :paramtype responsible_agency_code: str - :keyword header_version: Required. The header version. + :keyword header_version: The header version. Required. :paramtype header_version: str - :keyword sender_application_id: Required. The sender application id. + :keyword sender_application_id: The sender application id. Required. :paramtype sender_application_id: str - :keyword receiver_application_id: Required. The receiver application id. + :keyword receiver_application_id: The receiver application id. Required. :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: The date format. Required. Known values are: "NotSpecified", "CCYYMMDD", + and "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: The time format. Required. Known values are: "NotSpecified", "HHMM", + "HHMMSS", "HHMMSSdd", and "HHMMSSd". :paramtype time_format: str or ~azure.mgmt.logic.models.X12TimeFormat """ - super(X12EnvelopeOverride, self).__init__(**kwargs) + super().__init__(**kwargs) self.target_namespace = target_namespace self.protocol_version = protocol_version self.message_id = message_id @@ -10700,126 +10413,132 @@ def __init__( self.time_format = time_format -class X12EnvelopeSettings(msrest.serialization.Model): +class X12EnvelopeSettings(_serialization.Model): # pylint: disable=too-many-instance-attributes """The X12 agreement envelope settings. All required parameters must be populated in order to send to Azure. - :ivar control_standards_id: Required. The controls standards id. + :ivar control_standards_id: The controls standards id. Required. :vartype control_standards_id: int - :ivar use_control_standards_id_as_repetition_character: Required. The value indicating whether - to use control standards id as repetition character. + :ivar use_control_standards_id_as_repetition_character: The value indicating whether to use + control standards id as repetition character. Required. :vartype use_control_standards_id_as_repetition_character: bool - :ivar sender_application_id: Required. The sender application id. + :ivar sender_application_id: The sender application id. Required. :vartype sender_application_id: str - :ivar receiver_application_id: Required. The receiver application id. + :ivar receiver_application_id: The receiver application id. Required. :vartype receiver_application_id: str - :ivar control_version_number: Required. The control version number. + :ivar control_version_number: The control version number. Required. :vartype control_version_number: str - :ivar interchange_control_number_lower_bound: Required. The interchange control number lower - bound. + :ivar interchange_control_number_lower_bound: The interchange control number lower bound. + Required. :vartype interchange_control_number_lower_bound: int - :ivar interchange_control_number_upper_bound: Required. The interchange control number upper - bound. + :ivar interchange_control_number_upper_bound: The interchange control number upper bound. + Required. :vartype interchange_control_number_upper_bound: int - :ivar rollover_interchange_control_number: Required. The value indicating whether to rollover - interchange control number. + :ivar rollover_interchange_control_number: The value indicating whether to rollover interchange + control number. Required. :vartype rollover_interchange_control_number: bool - :ivar enable_default_group_headers: Required. The value indicating whether to enable default - group headers. + :ivar enable_default_group_headers: The value indicating whether to enable default group + headers. Required. :vartype enable_default_group_headers: bool :ivar functional_group_id: The functional group id. :vartype functional_group_id: str - :ivar group_control_number_lower_bound: Required. The group control number lower bound. + :ivar group_control_number_lower_bound: The group control number lower bound. Required. :vartype group_control_number_lower_bound: int - :ivar group_control_number_upper_bound: Required. The group control number upper bound. + :ivar group_control_number_upper_bound: The group control number upper bound. Required. :vartype group_control_number_upper_bound: int - :ivar rollover_group_control_number: Required. The value indicating whether to rollover group - control number. + :ivar rollover_group_control_number: The value indicating whether to rollover group control + number. Required. :vartype rollover_group_control_number: bool - :ivar group_header_agency_code: Required. The group header agency code. + :ivar group_header_agency_code: The group header agency code. Required. :vartype group_header_agency_code: str - :ivar group_header_version: Required. The group header version. + :ivar group_header_version: The group header version. Required. :vartype group_header_version: str - :ivar transaction_set_control_number_lower_bound: Required. The transaction set control number - lower bound. + :ivar transaction_set_control_number_lower_bound: The transaction set control number lower + bound. Required. :vartype transaction_set_control_number_lower_bound: int - :ivar transaction_set_control_number_upper_bound: Required. The transaction set control number - upper bound. + :ivar transaction_set_control_number_upper_bound: The transaction set control number upper + bound. Required. :vartype transaction_set_control_number_upper_bound: int - :ivar rollover_transaction_set_control_number: Required. The value indicating whether to - rollover transaction set control number. + :ivar rollover_transaction_set_control_number: The value indicating whether to rollover + transaction set control number. Required. :vartype rollover_transaction_set_control_number: bool :ivar transaction_set_control_number_prefix: The transaction set control number prefix. :vartype transaction_set_control_number_prefix: str :ivar transaction_set_control_number_suffix: The transaction set control number suffix. :vartype transaction_set_control_number_suffix: str - :ivar overwrite_existing_transaction_set_control_number: Required. The value indicating whether - to overwrite existing transaction set control number. + :ivar overwrite_existing_transaction_set_control_number: The value indicating whether to + overwrite existing transaction set control number. Required. :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: The group header date format. Required. Known values are: + "NotSpecified", "CCYYMMDD", and "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: The group header time format. Required. Known values are: + "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", and "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: The usage indicator. Required. Known values are: "NotSpecified", "Test", + "Information", and "Production". :vartype usage_indicator: str or ~azure.mgmt.logic.models.UsageIndicator """ _validation = { - 'control_standards_id': {'required': True}, - 'use_control_standards_id_as_repetition_character': {'required': True}, - 'sender_application_id': {'required': True}, - 'receiver_application_id': {'required': True}, - 'control_version_number': {'required': True}, - 'interchange_control_number_lower_bound': {'required': True}, - 'interchange_control_number_upper_bound': {'required': True}, - 'rollover_interchange_control_number': {'required': True}, - 'enable_default_group_headers': {'required': True}, - 'group_control_number_lower_bound': {'required': True}, - 'group_control_number_upper_bound': {'required': True}, - 'rollover_group_control_number': {'required': True}, - 'group_header_agency_code': {'required': True}, - 'group_header_version': {'required': True}, - 'transaction_set_control_number_lower_bound': {'required': True}, - 'transaction_set_control_number_upper_bound': {'required': True}, - 'rollover_transaction_set_control_number': {'required': True}, - 'overwrite_existing_transaction_set_control_number': {'required': True}, - 'group_header_date_format': {'required': True}, - 'group_header_time_format': {'required': True}, - 'usage_indicator': {'required': True}, - } - - _attribute_map = { - 'control_standards_id': {'key': 'controlStandardsId', 'type': 'int'}, - 'use_control_standards_id_as_repetition_character': {'key': 'useControlStandardsIdAsRepetitionCharacter', 'type': 'bool'}, - 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, - 'receiver_application_id': {'key': 'receiverApplicationId', 'type': 'str'}, - 'control_version_number': {'key': 'controlVersionNumber', 'type': 'str'}, - 'interchange_control_number_lower_bound': {'key': 'interchangeControlNumberLowerBound', 'type': 'int'}, - 'interchange_control_number_upper_bound': {'key': 'interchangeControlNumberUpperBound', 'type': 'int'}, - 'rollover_interchange_control_number': {'key': 'rolloverInterchangeControlNumber', 'type': 'bool'}, - 'enable_default_group_headers': {'key': 'enableDefaultGroupHeaders', 'type': 'bool'}, - 'functional_group_id': {'key': 'functionalGroupId', 'type': 'str'}, - 'group_control_number_lower_bound': {'key': 'groupControlNumberLowerBound', 'type': 'int'}, - 'group_control_number_upper_bound': {'key': 'groupControlNumberUpperBound', 'type': 'int'}, - 'rollover_group_control_number': {'key': 'rolloverGroupControlNumber', 'type': 'bool'}, - 'group_header_agency_code': {'key': 'groupHeaderAgencyCode', 'type': 'str'}, - 'group_header_version': {'key': 'groupHeaderVersion', 'type': 'str'}, - 'transaction_set_control_number_lower_bound': {'key': 'transactionSetControlNumberLowerBound', 'type': 'int'}, - 'transaction_set_control_number_upper_bound': {'key': 'transactionSetControlNumberUpperBound', 'type': 'int'}, - 'rollover_transaction_set_control_number': {'key': 'rolloverTransactionSetControlNumber', 'type': 'bool'}, - 'transaction_set_control_number_prefix': {'key': 'transactionSetControlNumberPrefix', 'type': 'str'}, - 'transaction_set_control_number_suffix': {'key': 'transactionSetControlNumberSuffix', 'type': 'str'}, - 'overwrite_existing_transaction_set_control_number': {'key': 'overwriteExistingTransactionSetControlNumber', 'type': 'bool'}, - 'group_header_date_format': {'key': 'groupHeaderDateFormat', 'type': 'str'}, - 'group_header_time_format': {'key': 'groupHeaderTimeFormat', 'type': 'str'}, - 'usage_indicator': {'key': 'usageIndicator', 'type': 'str'}, - } - - def __init__( + "control_standards_id": {"required": True}, + "use_control_standards_id_as_repetition_character": {"required": True}, + "sender_application_id": {"required": True}, + "receiver_application_id": {"required": True}, + "control_version_number": {"required": True}, + "interchange_control_number_lower_bound": {"required": True}, + "interchange_control_number_upper_bound": {"required": True}, + "rollover_interchange_control_number": {"required": True}, + "enable_default_group_headers": {"required": True}, + "group_control_number_lower_bound": {"required": True}, + "group_control_number_upper_bound": {"required": True}, + "rollover_group_control_number": {"required": True}, + "group_header_agency_code": {"required": True}, + "group_header_version": {"required": True}, + "transaction_set_control_number_lower_bound": {"required": True}, + "transaction_set_control_number_upper_bound": {"required": True}, + "rollover_transaction_set_control_number": {"required": True}, + "overwrite_existing_transaction_set_control_number": {"required": True}, + "group_header_date_format": {"required": True}, + "group_header_time_format": {"required": True}, + "usage_indicator": {"required": True}, + } + + _attribute_map = { + "control_standards_id": {"key": "controlStandardsId", "type": "int"}, + "use_control_standards_id_as_repetition_character": { + "key": "useControlStandardsIdAsRepetitionCharacter", + "type": "bool", + }, + "sender_application_id": {"key": "senderApplicationId", "type": "str"}, + "receiver_application_id": {"key": "receiverApplicationId", "type": "str"}, + "control_version_number": {"key": "controlVersionNumber", "type": "str"}, + "interchange_control_number_lower_bound": {"key": "interchangeControlNumberLowerBound", "type": "int"}, + "interchange_control_number_upper_bound": {"key": "interchangeControlNumberUpperBound", "type": "int"}, + "rollover_interchange_control_number": {"key": "rolloverInterchangeControlNumber", "type": "bool"}, + "enable_default_group_headers": {"key": "enableDefaultGroupHeaders", "type": "bool"}, + "functional_group_id": {"key": "functionalGroupId", "type": "str"}, + "group_control_number_lower_bound": {"key": "groupControlNumberLowerBound", "type": "int"}, + "group_control_number_upper_bound": {"key": "groupControlNumberUpperBound", "type": "int"}, + "rollover_group_control_number": {"key": "rolloverGroupControlNumber", "type": "bool"}, + "group_header_agency_code": {"key": "groupHeaderAgencyCode", "type": "str"}, + "group_header_version": {"key": "groupHeaderVersion", "type": "str"}, + "transaction_set_control_number_lower_bound": {"key": "transactionSetControlNumberLowerBound", "type": "int"}, + "transaction_set_control_number_upper_bound": {"key": "transactionSetControlNumberUpperBound", "type": "int"}, + "rollover_transaction_set_control_number": {"key": "rolloverTransactionSetControlNumber", "type": "bool"}, + "transaction_set_control_number_prefix": {"key": "transactionSetControlNumberPrefix", "type": "str"}, + "transaction_set_control_number_suffix": {"key": "transactionSetControlNumberSuffix", "type": "str"}, + "overwrite_existing_transaction_set_control_number": { + "key": "overwriteExistingTransactionSetControlNumber", + "type": "bool", + }, + "group_header_date_format": {"key": "groupHeaderDateFormat", "type": "str"}, + "group_header_time_format": {"key": "groupHeaderTimeFormat", "type": "str"}, + "usage_indicator": {"key": "usageIndicator", "type": "str"}, + } + + def __init__( # pylint: disable=too-many-locals self, *, control_standards_id: int, @@ -10840,78 +10559,78 @@ 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, **kwargs ): """ - :keyword control_standards_id: Required. The controls standards id. + :keyword control_standards_id: The controls standards id. Required. :paramtype control_standards_id: int - :keyword use_control_standards_id_as_repetition_character: Required. The value indicating - whether to use control standards id as repetition character. + :keyword use_control_standards_id_as_repetition_character: The value indicating whether to use + control standards id as repetition character. Required. :paramtype use_control_standards_id_as_repetition_character: bool - :keyword sender_application_id: Required. The sender application id. + :keyword sender_application_id: The sender application id. Required. :paramtype sender_application_id: str - :keyword receiver_application_id: Required. The receiver application id. + :keyword receiver_application_id: The receiver application id. Required. :paramtype receiver_application_id: str - :keyword control_version_number: Required. The control version number. + :keyword control_version_number: The control version number. Required. :paramtype control_version_number: str - :keyword interchange_control_number_lower_bound: Required. The interchange control number - lower bound. + :keyword interchange_control_number_lower_bound: The interchange control number lower bound. + Required. :paramtype interchange_control_number_lower_bound: int - :keyword interchange_control_number_upper_bound: Required. The interchange control number - upper bound. + :keyword interchange_control_number_upper_bound: The interchange control number upper bound. + Required. :paramtype interchange_control_number_upper_bound: int - :keyword rollover_interchange_control_number: Required. The value indicating whether to - rollover interchange control number. + :keyword rollover_interchange_control_number: The value indicating whether to rollover + interchange control number. Required. :paramtype rollover_interchange_control_number: bool - :keyword enable_default_group_headers: Required. The value indicating whether to enable default - group headers. + :keyword enable_default_group_headers: The value indicating whether to enable default group + headers. Required. :paramtype enable_default_group_headers: bool :keyword functional_group_id: The functional group id. :paramtype functional_group_id: str - :keyword group_control_number_lower_bound: Required. The group control number lower bound. + :keyword group_control_number_lower_bound: The group control number lower bound. Required. :paramtype group_control_number_lower_bound: int - :keyword group_control_number_upper_bound: Required. The group control number upper bound. + :keyword group_control_number_upper_bound: The group control number upper bound. Required. :paramtype group_control_number_upper_bound: int - :keyword rollover_group_control_number: Required. The value indicating whether to rollover - group control number. + :keyword rollover_group_control_number: The value indicating whether to rollover group control + number. Required. :paramtype rollover_group_control_number: bool - :keyword group_header_agency_code: Required. The group header agency code. + :keyword group_header_agency_code: The group header agency code. Required. :paramtype group_header_agency_code: str - :keyword group_header_version: Required. The group header version. + :keyword group_header_version: The group header version. Required. :paramtype group_header_version: str - :keyword transaction_set_control_number_lower_bound: Required. The transaction set control - number lower bound. + :keyword transaction_set_control_number_lower_bound: The transaction set control number lower + bound. Required. :paramtype transaction_set_control_number_lower_bound: int - :keyword transaction_set_control_number_upper_bound: Required. The transaction set control - number upper bound. + :keyword transaction_set_control_number_upper_bound: The transaction set control number upper + bound. Required. :paramtype transaction_set_control_number_upper_bound: int - :keyword rollover_transaction_set_control_number: Required. The value indicating whether to - rollover transaction set control number. + :keyword rollover_transaction_set_control_number: The value indicating whether to rollover + transaction set control number. Required. :paramtype rollover_transaction_set_control_number: bool :keyword transaction_set_control_number_prefix: The transaction set control number prefix. :paramtype transaction_set_control_number_prefix: str :keyword transaction_set_control_number_suffix: The transaction set control number suffix. :paramtype transaction_set_control_number_suffix: str - :keyword overwrite_existing_transaction_set_control_number: Required. The value indicating - whether to overwrite existing transaction set control number. + :keyword overwrite_existing_transaction_set_control_number: The value indicating whether to + overwrite existing transaction set control number. Required. :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: The group header date format. Required. Known values are: + "NotSpecified", "CCYYMMDD", and "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: The group header time format. Required. Known values are: + "NotSpecified", "HHMM", "HHMMSS", "HHMMSSdd", and "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: The usage indicator. Required. Known values are: "NotSpecified", + "Test", "Information", and "Production". :paramtype usage_indicator: str or ~azure.mgmt.logic.models.UsageIndicator """ - super(X12EnvelopeSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.control_standards_id = control_standards_id self.use_control_standards_id_as_repetition_character = use_control_standards_id_as_repetition_character self.sender_application_id = sender_application_id @@ -10938,48 +10657,48 @@ def __init__( self.usage_indicator = usage_indicator -class X12FramingSettings(msrest.serialization.Model): +class X12FramingSettings(_serialization.Model): """The X12 agreement framing settings. All required parameters must be populated in order to send to Azure. - :ivar data_element_separator: Required. The data element separator. + :ivar data_element_separator: The data element separator. Required. :vartype data_element_separator: int - :ivar component_separator: Required. The component separator. + :ivar component_separator: The component separator. Required. :vartype component_separator: int - :ivar replace_separators_in_payload: Required. The value indicating whether to replace - separators in payload. + :ivar replace_separators_in_payload: The value indicating whether to replace separators in + payload. Required. :vartype replace_separators_in_payload: bool - :ivar replace_character: Required. The replacement character. + :ivar replace_character: The replacement character. Required. :vartype replace_character: int - :ivar segment_terminator: Required. The segment terminator. + :ivar segment_terminator: The segment terminator. Required. :vartype segment_terminator: int - :ivar character_set: Required. The X12 character set. Possible values include: "NotSpecified", - "Basic", "Extended", "UTF8". + :ivar character_set: The X12 character set. Required. Known values are: "NotSpecified", + "Basic", "Extended", and "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: The segment terminator suffix. Required. Known values are: + "NotSpecified", "None", "CR", "LF", and "CRLF". :vartype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix """ _validation = { - 'data_element_separator': {'required': True}, - 'component_separator': {'required': True}, - 'replace_separators_in_payload': {'required': True}, - 'replace_character': {'required': True}, - 'segment_terminator': {'required': True}, - 'character_set': {'required': True}, - 'segment_terminator_suffix': {'required': True}, + "data_element_separator": {"required": True}, + "component_separator": {"required": True}, + "replace_separators_in_payload": {"required": True}, + "replace_character": {"required": True}, + "segment_terminator": {"required": True}, + "character_set": {"required": True}, + "segment_terminator_suffix": {"required": True}, } _attribute_map = { - 'data_element_separator': {'key': 'dataElementSeparator', 'type': 'int'}, - 'component_separator': {'key': 'componentSeparator', 'type': 'int'}, - 'replace_separators_in_payload': {'key': 'replaceSeparatorsInPayload', 'type': 'bool'}, - 'replace_character': {'key': 'replaceCharacter', 'type': 'int'}, - 'segment_terminator': {'key': 'segmentTerminator', 'type': 'int'}, - 'character_set': {'key': 'characterSet', 'type': 'str'}, - 'segment_terminator_suffix': {'key': 'segmentTerminatorSuffix', 'type': 'str'}, + "data_element_separator": {"key": "dataElementSeparator", "type": "int"}, + "component_separator": {"key": "componentSeparator", "type": "int"}, + "replace_separators_in_payload": {"key": "replaceSeparatorsInPayload", "type": "bool"}, + "replace_character": {"key": "replaceCharacter", "type": "int"}, + "segment_terminator": {"key": "segmentTerminator", "type": "int"}, + "character_set": {"key": "characterSet", "type": "str"}, + "segment_terminator_suffix": {"key": "segmentTerminatorSuffix", "type": "str"}, } def __init__( @@ -10990,30 +10709,30 @@ 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 ): """ - :keyword data_element_separator: Required. The data element separator. + :keyword data_element_separator: The data element separator. Required. :paramtype data_element_separator: int - :keyword component_separator: Required. The component separator. + :keyword component_separator: The component separator. Required. :paramtype component_separator: int - :keyword replace_separators_in_payload: Required. The value indicating whether to replace - separators in payload. + :keyword replace_separators_in_payload: The value indicating whether to replace separators in + payload. Required. :paramtype replace_separators_in_payload: bool - :keyword replace_character: Required. The replacement character. + :keyword replace_character: The replacement character. Required. :paramtype replace_character: int - :keyword segment_terminator: Required. The segment terminator. + :keyword segment_terminator: The segment terminator. Required. :paramtype segment_terminator: int - :keyword character_set: Required. The X12 character set. Possible values include: - "NotSpecified", "Basic", "Extended", "UTF8". + :keyword character_set: The X12 character set. Required. Known values are: "NotSpecified", + "Basic", "Extended", and "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: The segment terminator suffix. Required. Known values are: + "NotSpecified", "None", "CR", "LF", and "CRLF". :paramtype segment_terminator_suffix: str or ~azure.mgmt.logic.models.SegmentTerminatorSuffix """ - super(X12FramingSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.data_element_separator = data_element_separator self.component_separator = component_separator self.replace_separators_in_payload = replace_separators_in_payload @@ -11023,156 +10742,149 @@ def __init__( self.segment_terminator_suffix = segment_terminator_suffix -class X12MessageFilter(msrest.serialization.Model): +class X12MessageFilter(_serialization.Model): """The X12 message filter for odata query. 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: The message filter type. Required. Known values are: "NotSpecified", + "Include", and "Exclude". :vartype message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType """ _validation = { - 'message_filter_type': {'required': True}, + "message_filter_type": {"required": True}, } _attribute_map = { - 'message_filter_type': {'key': 'messageFilterType', 'type': 'str'}, + "message_filter_type": {"key": "messageFilterType", "type": "str"}, } - def __init__( - self, - *, - message_filter_type: Union[str, "MessageFilterType"], - **kwargs - ): + def __init__(self, *, message_filter_type: Union[str, "_models.MessageFilterType"], **kwargs): """ - :keyword message_filter_type: Required. The message filter type. Possible values include: - "NotSpecified", "Include", "Exclude". + :keyword message_filter_type: The message filter type. Required. Known values are: + "NotSpecified", "Include", and "Exclude". :paramtype message_filter_type: str or ~azure.mgmt.logic.models.MessageFilterType """ - super(X12MessageFilter, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_filter_type = message_filter_type -class X12MessageIdentifier(msrest.serialization.Model): +class X12MessageIdentifier(_serialization.Model): """The X12 message identifier. All required parameters must be populated in order to send to Azure. - :ivar message_id: Required. The message id. + :ivar message_id: The message id. Required. :vartype message_id: str """ _validation = { - 'message_id': {'required': True}, + "message_id": {"required": True}, } _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, + "message_id": {"key": "messageId", "type": "str"}, } - def __init__( - self, - *, - message_id: str, - **kwargs - ): + def __init__(self, *, message_id: str, **kwargs): """ - :keyword message_id: Required. The message id. + :keyword message_id: The message id. Required. :paramtype message_id: str """ - super(X12MessageIdentifier, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_id = message_id -class X12OneWayAgreement(msrest.serialization.Model): +class X12OneWayAgreement(_serialization.Model): """The X12 one-way agreement. All required parameters must be populated in order to send to Azure. - :ivar sender_business_identity: Required. The sender business identity. + :ivar sender_business_identity: The sender business identity. Required. :vartype sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :ivar receiver_business_identity: Required. The receiver business identity. + :ivar receiver_business_identity: The receiver business identity. Required. :vartype receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :ivar protocol_settings: Required. The X12 protocol settings. + :ivar protocol_settings: The X12 protocol settings. Required. :vartype protocol_settings: ~azure.mgmt.logic.models.X12ProtocolSettings """ _validation = { - 'sender_business_identity': {'required': True}, - 'receiver_business_identity': {'required': True}, - 'protocol_settings': {'required': True}, + "sender_business_identity": {"required": True}, + "receiver_business_identity": {"required": True}, + "protocol_settings": {"required": True}, } _attribute_map = { - 'sender_business_identity': {'key': 'senderBusinessIdentity', 'type': 'BusinessIdentity'}, - 'receiver_business_identity': {'key': 'receiverBusinessIdentity', 'type': 'BusinessIdentity'}, - 'protocol_settings': {'key': 'protocolSettings', 'type': 'X12ProtocolSettings'}, + "sender_business_identity": {"key": "senderBusinessIdentity", "type": "BusinessIdentity"}, + "receiver_business_identity": {"key": "receiverBusinessIdentity", "type": "BusinessIdentity"}, + "protocol_settings": {"key": "protocolSettings", "type": "X12ProtocolSettings"}, } 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 ): """ - :keyword sender_business_identity: Required. The sender business identity. + :keyword sender_business_identity: The sender business identity. Required. :paramtype sender_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :keyword receiver_business_identity: Required. The receiver business identity. + :keyword receiver_business_identity: The receiver business identity. Required. :paramtype receiver_business_identity: ~azure.mgmt.logic.models.BusinessIdentity - :keyword protocol_settings: Required. The X12 protocol settings. + :keyword protocol_settings: The X12 protocol settings. Required. :paramtype protocol_settings: ~azure.mgmt.logic.models.X12ProtocolSettings """ - super(X12OneWayAgreement, self).__init__(**kwargs) + super().__init__(**kwargs) self.sender_business_identity = sender_business_identity self.receiver_business_identity = receiver_business_identity self.protocol_settings = protocol_settings -class X12ProcessingSettings(msrest.serialization.Model): +class X12ProcessingSettings(_serialization.Model): """The X12 processing settings. All required parameters must be populated in order to send to Azure. - :ivar mask_security_info: Required. The value indicating whether to mask security information. + :ivar mask_security_info: The value indicating whether to mask security information. Required. :vartype mask_security_info: bool - :ivar convert_implied_decimal: Required. The value indicating whether to convert numerical type - to implied decimal. + :ivar convert_implied_decimal: The value indicating whether to convert numerical type to + implied decimal. Required. :vartype convert_implied_decimal: bool - :ivar preserve_interchange: Required. The value indicating whether to preserve interchange. + :ivar preserve_interchange: The value indicating whether to preserve interchange. Required. :vartype preserve_interchange: bool - :ivar suspend_interchange_on_error: Required. The value indicating whether to suspend - interchange on error. + :ivar suspend_interchange_on_error: The value indicating whether to suspend interchange on + error. Required. :vartype suspend_interchange_on_error: bool - :ivar create_empty_xml_tags_for_trailing_separators: Required. The value indicating whether to - create empty xml tags for trailing separators. + :ivar create_empty_xml_tags_for_trailing_separators: The value indicating whether to create + empty xml tags for trailing separators. Required. :vartype create_empty_xml_tags_for_trailing_separators: bool - :ivar use_dot_as_decimal_separator: Required. The value indicating whether to use dot as - decimal separator. + :ivar use_dot_as_decimal_separator: The value indicating whether to use dot as decimal + separator. Required. :vartype use_dot_as_decimal_separator: bool """ _validation = { - 'mask_security_info': {'required': True}, - 'convert_implied_decimal': {'required': True}, - 'preserve_interchange': {'required': True}, - 'suspend_interchange_on_error': {'required': True}, - 'create_empty_xml_tags_for_trailing_separators': {'required': True}, - 'use_dot_as_decimal_separator': {'required': True}, + "mask_security_info": {"required": True}, + "convert_implied_decimal": {"required": True}, + "preserve_interchange": {"required": True}, + "suspend_interchange_on_error": {"required": True}, + "create_empty_xml_tags_for_trailing_separators": {"required": True}, + "use_dot_as_decimal_separator": {"required": True}, } _attribute_map = { - 'mask_security_info': {'key': 'maskSecurityInfo', 'type': 'bool'}, - 'convert_implied_decimal': {'key': 'convertImpliedDecimal', 'type': 'bool'}, - 'preserve_interchange': {'key': 'preserveInterchange', 'type': 'bool'}, - 'suspend_interchange_on_error': {'key': 'suspendInterchangeOnError', 'type': 'bool'}, - 'create_empty_xml_tags_for_trailing_separators': {'key': 'createEmptyXmlTagsForTrailingSeparators', 'type': 'bool'}, - 'use_dot_as_decimal_separator': {'key': 'useDotAsDecimalSeparator', 'type': 'bool'}, + "mask_security_info": {"key": "maskSecurityInfo", "type": "bool"}, + "convert_implied_decimal": {"key": "convertImpliedDecimal", "type": "bool"}, + "preserve_interchange": {"key": "preserveInterchange", "type": "bool"}, + "suspend_interchange_on_error": {"key": "suspendInterchangeOnError", "type": "bool"}, + "create_empty_xml_tags_for_trailing_separators": { + "key": "createEmptyXmlTagsForTrailingSeparators", + "type": "bool", + }, + "use_dot_as_decimal_separator": {"key": "useDotAsDecimalSeparator", "type": "bool"}, } def __init__( @@ -11187,25 +10899,25 @@ def __init__( **kwargs ): """ - :keyword mask_security_info: Required. The value indicating whether to mask security - information. + :keyword mask_security_info: The value indicating whether to mask security information. + Required. :paramtype mask_security_info: bool - :keyword convert_implied_decimal: Required. The value indicating whether to convert numerical - type to implied decimal. + :keyword convert_implied_decimal: The value indicating whether to convert numerical type to + implied decimal. Required. :paramtype convert_implied_decimal: bool - :keyword preserve_interchange: Required. The value indicating whether to preserve interchange. + :keyword preserve_interchange: The value indicating whether to preserve interchange. Required. :paramtype preserve_interchange: bool - :keyword suspend_interchange_on_error: Required. The value indicating whether to suspend - interchange on error. + :keyword suspend_interchange_on_error: The value indicating whether to suspend interchange on + error. Required. :paramtype suspend_interchange_on_error: bool - :keyword create_empty_xml_tags_for_trailing_separators: Required. The value indicating whether - to create empty xml tags for trailing separators. + :keyword create_empty_xml_tags_for_trailing_separators: The value indicating whether to create + empty xml tags for trailing separators. Required. :paramtype create_empty_xml_tags_for_trailing_separators: bool - :keyword use_dot_as_decimal_separator: Required. The value indicating whether to use dot as - decimal separator. + :keyword use_dot_as_decimal_separator: The value indicating whether to use dot as decimal + separator. Required. :paramtype use_dot_as_decimal_separator: bool """ - super(X12ProcessingSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.mask_security_info = mask_security_info self.convert_implied_decimal = convert_implied_decimal self.preserve_interchange = preserve_interchange @@ -11214,24 +10926,24 @@ def __init__( self.use_dot_as_decimal_separator = use_dot_as_decimal_separator -class X12ProtocolSettings(msrest.serialization.Model): +class X12ProtocolSettings(_serialization.Model): # pylint: disable=too-many-instance-attributes """The X12 agreement protocol settings. All required parameters must be populated in order to send to Azure. - :ivar validation_settings: Required. The X12 validation settings. + :ivar validation_settings: The X12 validation settings. Required. :vartype validation_settings: ~azure.mgmt.logic.models.X12ValidationSettings - :ivar framing_settings: Required. The X12 framing settings. + :ivar framing_settings: The X12 framing settings. Required. :vartype framing_settings: ~azure.mgmt.logic.models.X12FramingSettings - :ivar envelope_settings: Required. The X12 envelope settings. + :ivar envelope_settings: The X12 envelope settings. Required. :vartype envelope_settings: ~azure.mgmt.logic.models.X12EnvelopeSettings - :ivar acknowledgement_settings: Required. The X12 acknowledgment settings. + :ivar acknowledgement_settings: The X12 acknowledgment settings. Required. :vartype acknowledgement_settings: ~azure.mgmt.logic.models.X12AcknowledgementSettings - :ivar message_filter: Required. The X12 message filter. + :ivar message_filter: The X12 message filter. Required. :vartype message_filter: ~azure.mgmt.logic.models.X12MessageFilter - :ivar security_settings: Required. The X12 security settings. + :ivar security_settings: The X12 security settings. Required. :vartype security_settings: ~azure.mgmt.logic.models.X12SecuritySettings - :ivar processing_settings: Required. The X12 processing settings. + :ivar processing_settings: The X12 processing settings. Required. :vartype processing_settings: ~azure.mgmt.logic.models.X12ProcessingSettings :ivar envelope_overrides: The X12 envelope override settings. :vartype envelope_overrides: list[~azure.mgmt.logic.models.X12EnvelopeOverride] @@ -11239,69 +10951,69 @@ class X12ProtocolSettings(msrest.serialization.Model): :vartype validation_overrides: list[~azure.mgmt.logic.models.X12ValidationOverride] :ivar message_filter_list: The X12 message filter list. :vartype message_filter_list: list[~azure.mgmt.logic.models.X12MessageIdentifier] - :ivar schema_references: Required. The X12 schema references. + :ivar schema_references: The X12 schema references. Required. :vartype schema_references: list[~azure.mgmt.logic.models.X12SchemaReference] :ivar x12_delimiter_overrides: The X12 delimiter override settings. :vartype x12_delimiter_overrides: list[~azure.mgmt.logic.models.X12DelimiterOverrides] """ _validation = { - 'validation_settings': {'required': True}, - 'framing_settings': {'required': True}, - 'envelope_settings': {'required': True}, - 'acknowledgement_settings': {'required': True}, - 'message_filter': {'required': True}, - 'security_settings': {'required': True}, - 'processing_settings': {'required': True}, - 'schema_references': {'required': True}, + "validation_settings": {"required": True}, + "framing_settings": {"required": True}, + "envelope_settings": {"required": True}, + "acknowledgement_settings": {"required": True}, + "message_filter": {"required": True}, + "security_settings": {"required": True}, + "processing_settings": {"required": True}, + "schema_references": {"required": True}, } _attribute_map = { - 'validation_settings': {'key': 'validationSettings', 'type': 'X12ValidationSettings'}, - 'framing_settings': {'key': 'framingSettings', 'type': 'X12FramingSettings'}, - 'envelope_settings': {'key': 'envelopeSettings', 'type': 'X12EnvelopeSettings'}, - 'acknowledgement_settings': {'key': 'acknowledgementSettings', 'type': 'X12AcknowledgementSettings'}, - 'message_filter': {'key': 'messageFilter', 'type': 'X12MessageFilter'}, - 'security_settings': {'key': 'securitySettings', 'type': 'X12SecuritySettings'}, - 'processing_settings': {'key': 'processingSettings', 'type': 'X12ProcessingSettings'}, - 'envelope_overrides': {'key': 'envelopeOverrides', 'type': '[X12EnvelopeOverride]'}, - 'validation_overrides': {'key': 'validationOverrides', 'type': '[X12ValidationOverride]'}, - 'message_filter_list': {'key': 'messageFilterList', 'type': '[X12MessageIdentifier]'}, - 'schema_references': {'key': 'schemaReferences', 'type': '[X12SchemaReference]'}, - 'x12_delimiter_overrides': {'key': 'x12DelimiterOverrides', 'type': '[X12DelimiterOverrides]'}, + "validation_settings": {"key": "validationSettings", "type": "X12ValidationSettings"}, + "framing_settings": {"key": "framingSettings", "type": "X12FramingSettings"}, + "envelope_settings": {"key": "envelopeSettings", "type": "X12EnvelopeSettings"}, + "acknowledgement_settings": {"key": "acknowledgementSettings", "type": "X12AcknowledgementSettings"}, + "message_filter": {"key": "messageFilter", "type": "X12MessageFilter"}, + "security_settings": {"key": "securitySettings", "type": "X12SecuritySettings"}, + "processing_settings": {"key": "processingSettings", "type": "X12ProcessingSettings"}, + "envelope_overrides": {"key": "envelopeOverrides", "type": "[X12EnvelopeOverride]"}, + "validation_overrides": {"key": "validationOverrides", "type": "[X12ValidationOverride]"}, + "message_filter_list": {"key": "messageFilterList", "type": "[X12MessageIdentifier]"}, + "schema_references": {"key": "schemaReferences", "type": "[X12SchemaReference]"}, + "x12_delimiter_overrides": {"key": "x12DelimiterOverrides", "type": "[X12DelimiterOverrides]"}, } 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 ): """ - :keyword validation_settings: Required. The X12 validation settings. + :keyword validation_settings: The X12 validation settings. Required. :paramtype validation_settings: ~azure.mgmt.logic.models.X12ValidationSettings - :keyword framing_settings: Required. The X12 framing settings. + :keyword framing_settings: The X12 framing settings. Required. :paramtype framing_settings: ~azure.mgmt.logic.models.X12FramingSettings - :keyword envelope_settings: Required. The X12 envelope settings. + :keyword envelope_settings: The X12 envelope settings. Required. :paramtype envelope_settings: ~azure.mgmt.logic.models.X12EnvelopeSettings - :keyword acknowledgement_settings: Required. The X12 acknowledgment settings. + :keyword acknowledgement_settings: The X12 acknowledgment settings. Required. :paramtype acknowledgement_settings: ~azure.mgmt.logic.models.X12AcknowledgementSettings - :keyword message_filter: Required. The X12 message filter. + :keyword message_filter: The X12 message filter. Required. :paramtype message_filter: ~azure.mgmt.logic.models.X12MessageFilter - :keyword security_settings: Required. The X12 security settings. + :keyword security_settings: The X12 security settings. Required. :paramtype security_settings: ~azure.mgmt.logic.models.X12SecuritySettings - :keyword processing_settings: Required. The X12 processing settings. + :keyword processing_settings: The X12 processing settings. Required. :paramtype processing_settings: ~azure.mgmt.logic.models.X12ProcessingSettings :keyword envelope_overrides: The X12 envelope override settings. :paramtype envelope_overrides: list[~azure.mgmt.logic.models.X12EnvelopeOverride] @@ -11309,12 +11021,12 @@ def __init__( :paramtype validation_overrides: list[~azure.mgmt.logic.models.X12ValidationOverride] :keyword message_filter_list: The X12 message filter list. :paramtype message_filter_list: list[~azure.mgmt.logic.models.X12MessageIdentifier] - :keyword schema_references: Required. The X12 schema references. + :keyword schema_references: The X12 schema references. Required. :paramtype schema_references: list[~azure.mgmt.logic.models.X12SchemaReference] :keyword x12_delimiter_overrides: The X12 delimiter override settings. :paramtype x12_delimiter_overrides: list[~azure.mgmt.logic.models.X12DelimiterOverrides] """ - super(X12ProtocolSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.validation_settings = validation_settings self.framing_settings = framing_settings self.envelope_settings = envelope_settings @@ -11329,32 +11041,32 @@ def __init__( self.x12_delimiter_overrides = x12_delimiter_overrides -class X12SchemaReference(msrest.serialization.Model): +class X12SchemaReference(_serialization.Model): """The X12 schema reference. All required parameters must be populated in order to send to Azure. - :ivar message_id: Required. The message id. + :ivar message_id: The message id. Required. :vartype message_id: str :ivar sender_application_id: The sender application id. :vartype sender_application_id: str - :ivar schema_version: Required. The schema version. + :ivar schema_version: The schema version. Required. :vartype schema_version: str - :ivar schema_name: Required. The schema name. + :ivar schema_name: The schema name. Required. :vartype schema_name: str """ _validation = { - 'message_id': {'required': True}, - 'schema_version': {'required': True}, - 'schema_name': {'required': True}, + "message_id": {"required": True}, + "schema_version": {"required": True}, + "schema_name": {"required": True}, } _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'sender_application_id': {'key': 'senderApplicationId', 'type': 'str'}, - 'schema_version': {'key': 'schemaVersion', 'type': 'str'}, - 'schema_name': {'key': 'schemaName', 'type': 'str'}, + "message_id": {"key": "messageId", "type": "str"}, + "sender_application_id": {"key": "senderApplicationId", "type": "str"}, + "schema_version": {"key": "schemaVersion", "type": "str"}, + "schema_name": {"key": "schemaName", "type": "str"}, } def __init__( @@ -11367,47 +11079,47 @@ def __init__( **kwargs ): """ - :keyword message_id: Required. The message id. + :keyword message_id: The message id. Required. :paramtype message_id: str :keyword sender_application_id: The sender application id. :paramtype sender_application_id: str - :keyword schema_version: Required. The schema version. + :keyword schema_version: The schema version. Required. :paramtype schema_version: str - :keyword schema_name: Required. The schema name. + :keyword schema_name: The schema name. Required. :paramtype schema_name: str """ - super(X12SchemaReference, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_id = message_id self.sender_application_id = sender_application_id self.schema_version = schema_version self.schema_name = schema_name -class X12SecuritySettings(msrest.serialization.Model): +class X12SecuritySettings(_serialization.Model): """The X12 agreement security settings. All required parameters must be populated in order to send to Azure. - :ivar authorization_qualifier: Required. The authorization qualifier. + :ivar authorization_qualifier: The authorization qualifier. Required. :vartype authorization_qualifier: str :ivar authorization_value: The authorization value. :vartype authorization_value: str - :ivar security_qualifier: Required. The security qualifier. + :ivar security_qualifier: The security qualifier. Required. :vartype security_qualifier: str :ivar password_value: The password value. :vartype password_value: str """ _validation = { - 'authorization_qualifier': {'required': True}, - 'security_qualifier': {'required': True}, + "authorization_qualifier": {"required": True}, + "security_qualifier": {"required": True}, } _attribute_map = { - 'authorization_qualifier': {'key': 'authorizationQualifier', 'type': 'str'}, - 'authorization_value': {'key': 'authorizationValue', 'type': 'str'}, - 'security_qualifier': {'key': 'securityQualifier', 'type': 'str'}, - 'password_value': {'key': 'passwordValue', 'type': 'str'}, + "authorization_qualifier": {"key": "authorizationQualifier", "type": "str"}, + "authorization_value": {"key": "authorizationValue", "type": "str"}, + "security_qualifier": {"key": "securityQualifier", "type": "str"}, + "password_value": {"key": "passwordValue", "type": "str"}, } def __init__( @@ -11420,64 +11132,67 @@ def __init__( **kwargs ): """ - :keyword authorization_qualifier: Required. The authorization qualifier. + :keyword authorization_qualifier: The authorization qualifier. Required. :paramtype authorization_qualifier: str :keyword authorization_value: The authorization value. :paramtype authorization_value: str - :keyword security_qualifier: Required. The security qualifier. + :keyword security_qualifier: The security qualifier. Required. :paramtype security_qualifier: str :keyword password_value: The password value. :paramtype password_value: str """ - super(X12SecuritySettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.authorization_qualifier = authorization_qualifier self.authorization_value = authorization_value self.security_qualifier = security_qualifier self.password_value = password_value -class X12ValidationOverride(msrest.serialization.Model): +class X12ValidationOverride(_serialization.Model): """The X12 validation override settings. All required parameters must be populated in order to send to Azure. - :ivar message_id: Required. The message id on which the validation settings has to be applied. + :ivar message_id: The message id on which the validation settings has to be applied. Required. :vartype message_id: str - :ivar validate_edi_types: Required. The value indicating whether to validate EDI types. + :ivar validate_edi_types: The value indicating whether to validate EDI types. Required. :vartype validate_edi_types: bool - :ivar validate_xsd_types: Required. The value indicating whether to validate XSD types. + :ivar validate_xsd_types: The value indicating whether to validate XSD types. Required. :vartype validate_xsd_types: bool - :ivar allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - allow leading and trailing spaces and zeroes. + :ivar allow_leading_and_trailing_spaces_and_zeroes: The value indicating whether to allow + leading and trailing spaces and zeroes. Required. :vartype allow_leading_and_trailing_spaces_and_zeroes: bool - :ivar validate_character_set: Required. The value indicating whether to validate character Set. + :ivar validate_character_set: The value indicating whether to validate character Set. Required. :vartype validate_character_set: bool - :ivar trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - trim leading and trailing spaces and zeroes. + :ivar trim_leading_and_trailing_spaces_and_zeroes: The value indicating whether to trim leading + and trailing spaces and zeroes. Required. :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: The trailing separator policy. Required. Known values are: + "NotSpecified", "NotAllowed", "Optional", and "Mandatory". :vartype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ _validation = { - 'message_id': {'required': True}, - 'validate_edi_types': {'required': True}, - 'validate_xsd_types': {'required': True}, - 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, - 'validate_character_set': {'required': True}, - 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, - 'trailing_separator_policy': {'required': True}, + "message_id": {"required": True}, + "validate_edi_types": {"required": True}, + "validate_xsd_types": {"required": True}, + "allow_leading_and_trailing_spaces_and_zeroes": {"required": True}, + "validate_character_set": {"required": True}, + "trim_leading_and_trailing_spaces_and_zeroes": {"required": True}, + "trailing_separator_policy": {"required": True}, } _attribute_map = { - 'message_id': {'key': 'messageId', 'type': 'str'}, - 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, - 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, - 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, - 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, - 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, - 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + "message_id": {"key": "messageId", "type": "str"}, + "validate_edi_types": {"key": "validateEDITypes", "type": "bool"}, + "validate_xsd_types": {"key": "validateXSDTypes", "type": "bool"}, + "allow_leading_and_trailing_spaces_and_zeroes": { + "key": "allowLeadingAndTrailingSpacesAndZeroes", + "type": "bool", + }, + "validate_character_set": {"key": "validateCharacterSet", "type": "bool"}, + "trim_leading_and_trailing_spaces_and_zeroes": {"key": "trimLeadingAndTrailingSpacesAndZeroes", "type": "bool"}, + "trailing_separator_policy": {"key": "trailingSeparatorPolicy", "type": "str"}, } def __init__( @@ -11489,31 +11204,31 @@ 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 ): """ - :keyword message_id: Required. The message id on which the validation settings has to be - applied. + :keyword message_id: The message id on which the validation settings has to be applied. + Required. :paramtype message_id: str - :keyword validate_edi_types: Required. The value indicating whether to validate EDI types. + :keyword validate_edi_types: The value indicating whether to validate EDI types. Required. :paramtype validate_edi_types: bool - :keyword validate_xsd_types: Required. The value indicating whether to validate XSD types. + :keyword validate_xsd_types: The value indicating whether to validate XSD types. Required. :paramtype validate_xsd_types: bool - :keyword allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether - to allow leading and trailing spaces and zeroes. + :keyword allow_leading_and_trailing_spaces_and_zeroes: The value indicating whether to allow + leading and trailing spaces and zeroes. Required. :paramtype allow_leading_and_trailing_spaces_and_zeroes: bool - :keyword validate_character_set: Required. The value indicating whether to validate character - Set. + :keyword validate_character_set: The value indicating whether to validate character Set. + Required. :paramtype validate_character_set: bool - :keyword trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - trim leading and trailing spaces and zeroes. + :keyword trim_leading_and_trailing_spaces_and_zeroes: The value indicating whether to trim + leading and trailing spaces and zeroes. Required. :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: The trailing separator policy. Required. Known values are: + "NotSpecified", "NotAllowed", "Optional", and "Mandatory". :paramtype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ - super(X12ValidationOverride, self).__init__(**kwargs) + super().__init__(**kwargs) self.message_id = message_id self.validate_edi_types = validate_edi_types self.validate_xsd_types = validate_xsd_types @@ -11523,67 +11238,73 @@ def __init__( self.trailing_separator_policy = trailing_separator_policy -class X12ValidationSettings(msrest.serialization.Model): +class X12ValidationSettings(_serialization.Model): """The X12 agreement validation settings. All required parameters must be populated in order to send to Azure. - :ivar validate_character_set: Required. The value indicating whether to validate character set - in the message. + :ivar validate_character_set: The value indicating whether to validate character set in the + message. Required. :vartype validate_character_set: bool - :ivar check_duplicate_interchange_control_number: Required. The value indicating whether to - check for duplicate interchange control number. + :ivar check_duplicate_interchange_control_number: The value indicating whether to check for + duplicate interchange control number. Required. :vartype check_duplicate_interchange_control_number: bool - :ivar interchange_control_number_validity_days: Required. The validity period of interchange - control number. + :ivar interchange_control_number_validity_days: The validity period of interchange control + number. Required. :vartype interchange_control_number_validity_days: int - :ivar check_duplicate_group_control_number: Required. The value indicating whether to check for - duplicate group control number. + :ivar check_duplicate_group_control_number: The value indicating whether to check for duplicate + group control number. Required. :vartype check_duplicate_group_control_number: bool - :ivar check_duplicate_transaction_set_control_number: Required. The value indicating whether to - check for duplicate transaction set control number. + :ivar check_duplicate_transaction_set_control_number: The value indicating whether to check for + duplicate transaction set control number. Required. :vartype check_duplicate_transaction_set_control_number: bool - :ivar validate_edi_types: Required. The value indicating whether to Whether to validate EDI - types. + :ivar validate_edi_types: The value indicating whether to Whether to validate EDI types. + Required. :vartype validate_edi_types: bool - :ivar validate_xsd_types: Required. The value indicating whether to Whether to validate XSD - types. + :ivar validate_xsd_types: The value indicating whether to Whether to validate XSD types. + Required. :vartype validate_xsd_types: bool - :ivar allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - allow leading and trailing spaces and zeroes. + :ivar allow_leading_and_trailing_spaces_and_zeroes: The value indicating whether to allow + leading and trailing spaces and zeroes. Required. :vartype allow_leading_and_trailing_spaces_and_zeroes: bool - :ivar trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - trim leading and trailing spaces and zeroes. + :ivar trim_leading_and_trailing_spaces_and_zeroes: The value indicating whether to trim leading + and trailing spaces and zeroes. Required. :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: The trailing separator policy. Required. Known values are: + "NotSpecified", "NotAllowed", "Optional", and "Mandatory". :vartype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ _validation = { - 'validate_character_set': {'required': True}, - 'check_duplicate_interchange_control_number': {'required': True}, - 'interchange_control_number_validity_days': {'required': True}, - 'check_duplicate_group_control_number': {'required': True}, - 'check_duplicate_transaction_set_control_number': {'required': True}, - 'validate_edi_types': {'required': True}, - 'validate_xsd_types': {'required': True}, - 'allow_leading_and_trailing_spaces_and_zeroes': {'required': True}, - 'trim_leading_and_trailing_spaces_and_zeroes': {'required': True}, - 'trailing_separator_policy': {'required': True}, + "validate_character_set": {"required": True}, + "check_duplicate_interchange_control_number": {"required": True}, + "interchange_control_number_validity_days": {"required": True}, + "check_duplicate_group_control_number": {"required": True}, + "check_duplicate_transaction_set_control_number": {"required": True}, + "validate_edi_types": {"required": True}, + "validate_xsd_types": {"required": True}, + "allow_leading_and_trailing_spaces_and_zeroes": {"required": True}, + "trim_leading_and_trailing_spaces_and_zeroes": {"required": True}, + "trailing_separator_policy": {"required": True}, } _attribute_map = { - 'validate_character_set': {'key': 'validateCharacterSet', 'type': 'bool'}, - 'check_duplicate_interchange_control_number': {'key': 'checkDuplicateInterchangeControlNumber', 'type': 'bool'}, - 'interchange_control_number_validity_days': {'key': 'interchangeControlNumberValidityDays', 'type': 'int'}, - 'check_duplicate_group_control_number': {'key': 'checkDuplicateGroupControlNumber', 'type': 'bool'}, - 'check_duplicate_transaction_set_control_number': {'key': 'checkDuplicateTransactionSetControlNumber', 'type': 'bool'}, - 'validate_edi_types': {'key': 'validateEDITypes', 'type': 'bool'}, - 'validate_xsd_types': {'key': 'validateXSDTypes', 'type': 'bool'}, - 'allow_leading_and_trailing_spaces_and_zeroes': {'key': 'allowLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, - 'trim_leading_and_trailing_spaces_and_zeroes': {'key': 'trimLeadingAndTrailingSpacesAndZeroes', 'type': 'bool'}, - 'trailing_separator_policy': {'key': 'trailingSeparatorPolicy', 'type': 'str'}, + "validate_character_set": {"key": "validateCharacterSet", "type": "bool"}, + "check_duplicate_interchange_control_number": {"key": "checkDuplicateInterchangeControlNumber", "type": "bool"}, + "interchange_control_number_validity_days": {"key": "interchangeControlNumberValidityDays", "type": "int"}, + "check_duplicate_group_control_number": {"key": "checkDuplicateGroupControlNumber", "type": "bool"}, + "check_duplicate_transaction_set_control_number": { + "key": "checkDuplicateTransactionSetControlNumber", + "type": "bool", + }, + "validate_edi_types": {"key": "validateEDITypes", "type": "bool"}, + "validate_xsd_types": {"key": "validateXSDTypes", "type": "bool"}, + "allow_leading_and_trailing_spaces_and_zeroes": { + "key": "allowLeadingAndTrailingSpacesAndZeroes", + "type": "bool", + }, + "trim_leading_and_trailing_spaces_and_zeroes": {"key": "trimLeadingAndTrailingSpacesAndZeroes", "type": "bool"}, + "trailing_separator_policy": {"key": "trailingSeparatorPolicy", "type": "str"}, } def __init__( @@ -11598,42 +11319,42 @@ 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 ): """ - :keyword validate_character_set: Required. The value indicating whether to validate character - set in the message. + :keyword validate_character_set: The value indicating whether to validate character set in the + message. Required. :paramtype validate_character_set: bool - :keyword check_duplicate_interchange_control_number: Required. The value indicating whether to - check for duplicate interchange control number. + :keyword check_duplicate_interchange_control_number: The value indicating whether to check for + duplicate interchange control number. Required. :paramtype check_duplicate_interchange_control_number: bool - :keyword interchange_control_number_validity_days: Required. The validity period of interchange - control number. + :keyword interchange_control_number_validity_days: The validity period of interchange control + number. Required. :paramtype interchange_control_number_validity_days: int - :keyword check_duplicate_group_control_number: Required. The value indicating whether to check - for duplicate group control number. + :keyword check_duplicate_group_control_number: The value indicating whether to check for + duplicate group control number. Required. :paramtype check_duplicate_group_control_number: bool - :keyword check_duplicate_transaction_set_control_number: Required. The value indicating whether - to check for duplicate transaction set control number. + :keyword check_duplicate_transaction_set_control_number: The value indicating whether to check + for duplicate transaction set control number. Required. :paramtype check_duplicate_transaction_set_control_number: bool - :keyword validate_edi_types: Required. The value indicating whether to Whether to validate EDI - types. + :keyword validate_edi_types: The value indicating whether to Whether to validate EDI types. + Required. :paramtype validate_edi_types: bool - :keyword validate_xsd_types: Required. The value indicating whether to Whether to validate XSD - types. + :keyword validate_xsd_types: The value indicating whether to Whether to validate XSD types. + Required. :paramtype validate_xsd_types: bool - :keyword allow_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether - to allow leading and trailing spaces and zeroes. + :keyword allow_leading_and_trailing_spaces_and_zeroes: The value indicating whether to allow + leading and trailing spaces and zeroes. Required. :paramtype allow_leading_and_trailing_spaces_and_zeroes: bool - :keyword trim_leading_and_trailing_spaces_and_zeroes: Required. The value indicating whether to - trim leading and trailing spaces and zeroes. + :keyword trim_leading_and_trailing_spaces_and_zeroes: The value indicating whether to trim + leading and trailing spaces and zeroes. Required. :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: The trailing separator policy. Required. Known values are: + "NotSpecified", "NotAllowed", "Optional", and "Mandatory". :paramtype trailing_separator_policy: str or ~azure.mgmt.logic.models.TrailingSeparatorPolicy """ - super(X12ValidationSettings, self).__init__(**kwargs) + super().__init__(**kwargs) self.validate_character_set = validate_character_set self.check_duplicate_interchange_control_number = check_duplicate_interchange_control_number self.interchange_control_number_validity_days = interchange_control_number_validity_days 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..f7dd32510333 --- /dev/null +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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..91e2700d1e6e 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 @@ -14,7 +14,9 @@ from ._workflow_runs_operations import WorkflowRunsOperations from ._workflow_run_actions_operations import WorkflowRunActionsOperations from ._workflow_run_action_repetitions_operations import WorkflowRunActionRepetitionsOperations -from ._workflow_run_action_repetitions_request_histories_operations import WorkflowRunActionRepetitionsRequestHistoriesOperations +from ._workflow_run_action_repetitions_request_histories_operations import ( + WorkflowRunActionRepetitionsRequestHistoriesOperations, +) from ._workflow_run_action_request_histories_operations import WorkflowRunActionRequestHistoriesOperations from ._workflow_run_action_scope_repetitions_operations import WorkflowRunActionScopeRepetitionsOperations from ._workflow_run_operations_operations import WorkflowRunOperationsOperations @@ -29,37 +31,47 @@ from ._integration_account_sessions_operations import IntegrationAccountSessionsOperations from ._integration_service_environments_operations import IntegrationServiceEnvironmentsOperations from ._integration_service_environment_skus_operations import IntegrationServiceEnvironmentSkusOperations -from ._integration_service_environment_network_health_operations import IntegrationServiceEnvironmentNetworkHealthOperations +from ._integration_service_environment_network_health_operations import ( + IntegrationServiceEnvironmentNetworkHealthOperations, +) from ._integration_service_environment_managed_apis_operations import IntegrationServiceEnvironmentManagedApisOperations -from ._integration_service_environment_managed_api_operations_operations import IntegrationServiceEnvironmentManagedApiOperationsOperations +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', - 'WorkflowTriggersOperations', - 'WorkflowVersionTriggersOperations', - 'WorkflowTriggerHistoriesOperations', - 'WorkflowRunsOperations', - 'WorkflowRunActionsOperations', - 'WorkflowRunActionRepetitionsOperations', - 'WorkflowRunActionRepetitionsRequestHistoriesOperations', - 'WorkflowRunActionRequestHistoriesOperations', - 'WorkflowRunActionScopeRepetitionsOperations', - 'WorkflowRunOperationsOperations', - 'IntegrationAccountsOperations', - 'IntegrationAccountAssembliesOperations', - 'IntegrationAccountBatchConfigurationsOperations', - 'IntegrationAccountSchemasOperations', - 'IntegrationAccountMapsOperations', - 'IntegrationAccountPartnersOperations', - 'IntegrationAccountAgreementsOperations', - 'IntegrationAccountCertificatesOperations', - 'IntegrationAccountSessionsOperations', - 'IntegrationServiceEnvironmentsOperations', - 'IntegrationServiceEnvironmentSkusOperations', - 'IntegrationServiceEnvironmentNetworkHealthOperations', - 'IntegrationServiceEnvironmentManagedApisOperations', - 'IntegrationServiceEnvironmentManagedApiOperationsOperations', - 'Operations', + "WorkflowsOperations", + "WorkflowVersionsOperations", + "WorkflowTriggersOperations", + "WorkflowVersionTriggersOperations", + "WorkflowTriggerHistoriesOperations", + "WorkflowRunsOperations", + "WorkflowRunActionsOperations", + "WorkflowRunActionRepetitionsOperations", + "WorkflowRunActionRepetitionsRequestHistoriesOperations", + "WorkflowRunActionRequestHistoriesOperations", + "WorkflowRunActionScopeRepetitionsOperations", + "WorkflowRunOperationsOperations", + "IntegrationAccountsOperations", + "IntegrationAccountAssembliesOperations", + "IntegrationAccountBatchConfigurationsOperations", + "IntegrationAccountSchemasOperations", + "IntegrationAccountMapsOperations", + "IntegrationAccountPartnersOperations", + "IntegrationAccountAgreementsOperations", + "IntegrationAccountCertificatesOperations", + "IntegrationAccountSessionsOperations", + "IntegrationServiceEnvironmentsOperations", + "IntegrationServiceEnvironmentSkusOperations", + "IntegrationServiceEnvironmentNetworkHealthOperations", + "IntegrationServiceEnvironmentManagedApisOperations", + "IntegrationServiceEnvironmentManagedApiOperationsOperations", + "Operations", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() 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..5914e58955b2 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 @@ -6,258 +6,229 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - agreement_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, agreement_name: str, subscription_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/integrationAccounts/{integrationAccountName}/agreements/{agreementName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "agreementName": _SERIALIZER.url("agreement_name", agreement_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "agreementName": _SERIALIZER.url("agreement_name", agreement_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - agreement_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, agreement_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "agreementName": _SERIALIZER.url("agreement_name", agreement_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "agreementName": _SERIALIZER.url("agreement_name", agreement_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - agreement_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, agreement_name: str, subscription_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/integrationAccounts/{integrationAccountName}/agreements/{agreementName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "agreementName": _SERIALIZER.url("agreement_name", agreement_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "agreementName": _SERIALIZER.url("agreement_name", agreement_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_content_callback_url_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - agreement_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, agreement_name: str, subscription_id: str, **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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "agreementName": _SERIALIZER.url("agreement_name", agreement_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "agreementName": _SERIALIZER.url("agreement_name", agreement_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - 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. - - :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. + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountAgreementsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,12 +238,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountAgreementListResult"]: + ) -> Iterable["_models.IntegrationAccountAgreement"]: """Gets a list of integration account agreements. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -280,47 +251,50 @@ def list( AgreementType. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountAgreementListResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountAgreementListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccountAgreement or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountAgreement] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -334,10 +308,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -348,58 +320,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - integration_account_name: str, - agreement_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountAgreement": + self, resource_group_name: str, integration_account_name: str, agreement_name: str, **kwargs: Any + ) -> _models.IntegrationAccountAgreement: """Gets an integration account agreement. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param agreement_name: The integration account agreement name. + :param agreement_name: The integration account agreement name. Required. :type agreement_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountAgreement, or the result of cls(response) + :return: IntegrationAccountAgreement or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreement"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountAgreement] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, agreement_name=agreement_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -407,15 +379,74 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + deserialized = self._deserialize("IntegrationAccountAgreement", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + agreement: _models.IntegrationAccountAgreement, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountAgreement: + """Creates or updates an integration account agreement. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. Required. + :type agreement_name: str + :param agreement: The integration account agreement. Required. + :type agreement: ~azure.mgmt.logic.models.IntegrationAccountAgreement + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreement or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + agreement: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountAgreement: + """Creates or updates an integration account agreement. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. Required. + :type agreement_name: str + :param agreement: The integration account agreement. Required. + :type agreement: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountAgreement or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( @@ -423,53 +454,71 @@ def create_or_update( resource_group_name: str, integration_account_name: str, agreement_name: str, - agreement: "_models.IntegrationAccountAgreement", + agreement: Union[_models.IntegrationAccountAgreement, IO], **kwargs: Any - ) -> "_models.IntegrationAccountAgreement": + ) -> _models.IntegrationAccountAgreement: """Creates or updates an integration account agreement. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param agreement_name: The integration account agreement name. + :param agreement_name: The integration account agreement name. Required. :type agreement_name: str - :param agreement: The integration account agreement. - :type agreement: ~azure.mgmt.logic.models.IntegrationAccountAgreement + :param agreement: The integration account agreement. Is either a model type or a IO type. + Required. + :type agreement: ~azure.mgmt.logic.models.IntegrationAccountAgreement or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountAgreement, or the result of cls(response) + :return: IntegrationAccountAgreement or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountAgreement - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountAgreement"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountAgreement] - _json = self._serialize.body(agreement, 'IntegrationAccountAgreement') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(agreement, (IO, bytes)): + _content = agreement + else: + _json = self._serialize.body(agreement, "IntegrationAccountAgreement") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, agreement_name=agreement_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -478,65 +527,66 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + deserialized = self._deserialize("IntegrationAccountAgreement", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountAgreement', pipeline_response) + deserialized = self._deserialize("IntegrationAccountAgreement", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - agreement_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, agreement_name: str, **kwargs: Any ) -> None: """Deletes an integration account agreement. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param agreement_name: The integration account agreement name. + :param agreement_name: The integration account agreement name. Required. :type agreement_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, agreement_name=agreement_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -547,8 +597,67 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"} # type: ignore + + @overload + def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + list_content_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. Required. + :type agreement_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + agreement_name: str, + list_content_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param agreement_name: The integration account agreement name. Required. + :type agreement_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def list_content_callback_url( @@ -556,53 +665,70 @@ 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: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param agreement_name: The integration account agreement name. + :param agreement_name: The integration account agreement name. Required. :type agreement_name: str - :param list_content_callback_url: - :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_content_callback_url: Is either a model type or a IO type. Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_content_callback_url, (IO, bytes)): + _content = list_content_callback_url + else: + _json = self._serialize.body(list_content_callback_url, "GetCallbackUrlParameters") request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, agreement_name=agreement_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_content_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -610,12 +736,11 @@ def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}/listContentCallbackUrl"} # type: ignore 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..b026d35b4cfc 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 @@ -6,293 +6,285 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_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/integrationAccounts/{integrationAccountName}/assemblies") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, + subscription_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/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "assemblyArtifactName": _SERIALIZER.url("assembly_artifact_name", assembly_artifact_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "assemblyArtifactName": _SERIALIZER.url("assembly_artifact_name", assembly_artifact_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, - *, - json: JSONType = None, - content: Any = None, + subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "assemblyArtifactName": _SERIALIZER.url("assembly_artifact_name", assembly_artifact_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "assemblyArtifactName": _SERIALIZER.url("assembly_artifact_name", assembly_artifact_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, + subscription_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/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "assemblyArtifactName": _SERIALIZER.url("assembly_artifact_name", assembly_artifact_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "assemblyArtifactName": _SERIALIZER.url("assembly_artifact_name", assembly_artifact_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_content_callback_url_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, + subscription_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/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "assemblyArtifactName": _SERIALIZER.url("assembly_artifact_name", assembly_artifact_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "assemblyArtifactName": _SERIALIZER.url("assembly_artifact_name", assembly_artifact_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountAssembliesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any - ) -> Iterable["_models.AssemblyCollection"]: + self, resource_group_name: str, integration_account_name: str, **kwargs: Any + ) -> Iterable["_models.AssemblyDefinition"]: """List the assemblies for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AssemblyCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.AssemblyCollection] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either AssemblyDefinition or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.AssemblyDefinition] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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,10 +298,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -320,58 +310,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - integration_account_name: str, - assembly_artifact_name: str, - **kwargs: Any - ) -> "_models.AssemblyDefinition": + self, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, **kwargs: Any + ) -> _models.AssemblyDefinition: """Get an assembly for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param assembly_artifact_name: The assembly artifact name. + :param assembly_artifact_name: The assembly artifact name. Required. :type assembly_artifact_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AssemblyDefinition, or the result of cls(response) + :return: AssemblyDefinition or the result of cls(response) :rtype: ~azure.mgmt.logic.models.AssemblyDefinition - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AssemblyDefinition] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, assembly_artifact_name=assembly_artifact_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -379,15 +369,74 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + deserialized = self._deserialize("AssemblyDefinition", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + assembly_artifact_name: str, + assembly_artifact: _models.AssemblyDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AssemblyDefinition: + """Create or update an assembly for an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. Required. + :type assembly_artifact_name: str + :param assembly_artifact: The assembly artifact. Required. + :type assembly_artifact: ~azure.mgmt.logic.models.AssemblyDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyDefinition or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.AssemblyDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + assembly_artifact_name: str, + assembly_artifact: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AssemblyDefinition: + """Create or update an assembly for an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param assembly_artifact_name: The assembly artifact name. Required. + :type assembly_artifact_name: str + :param assembly_artifact: The assembly artifact. Required. + :type assembly_artifact: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AssemblyDefinition or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.AssemblyDefinition + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( @@ -395,53 +444,70 @@ def create_or_update( resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, - assembly_artifact: "_models.AssemblyDefinition", + assembly_artifact: Union[_models.AssemblyDefinition, IO], **kwargs: Any - ) -> "_models.AssemblyDefinition": + ) -> _models.AssemblyDefinition: """Create or update an assembly for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param assembly_artifact_name: The assembly artifact name. + :param assembly_artifact_name: The assembly artifact name. Required. :type assembly_artifact_name: str - :param assembly_artifact: The assembly artifact. - :type assembly_artifact: ~azure.mgmt.logic.models.AssemblyDefinition + :param assembly_artifact: The assembly artifact. Is either a model type or a IO type. Required. + :type assembly_artifact: ~azure.mgmt.logic.models.AssemblyDefinition or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: AssemblyDefinition, or the result of cls(response) + :return: AssemblyDefinition or the result of cls(response) :rtype: ~azure.mgmt.logic.models.AssemblyDefinition - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AssemblyDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AssemblyDefinition] - _json = self._serialize.body(assembly_artifact, 'AssemblyDefinition') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(assembly_artifact, (IO, bytes)): + _content = assembly_artifact + else: + _json = self._serialize.body(assembly_artifact, "AssemblyDefinition") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, assembly_artifact_name=assembly_artifact_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -450,65 +516,66 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + deserialized = self._deserialize("AssemblyDefinition", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('AssemblyDefinition', pipeline_response) + deserialized = self._deserialize("AssemblyDefinition", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - assembly_artifact_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, **kwargs: Any ) -> None: """Delete an assembly for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param assembly_artifact_name: The assembly artifact name. + :param assembly_artifact_name: The assembly artifact name. Required. :type assembly_artifact_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, assembly_artifact_name=assembly_artifact_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -519,55 +586,56 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}"} # type: ignore @distributed_trace def list_content_callback_url( - self, - resource_group_name: str, - integration_account_name: str, - assembly_artifact_name: str, - **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + self, resource_group_name: str, integration_account_name: str, assembly_artifact_name: str, **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url for an integration account assembly. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param assembly_artifact_name: The assembly artifact name. + :param assembly_artifact_name: The assembly artifact name. Required. :type assembly_artifact_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, assembly_artifact_name=assembly_artifact_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_content_callback_url.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -575,12 +643,11 @@ def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/assemblies/{assemblyArtifactName}/listContentCallbackUrl"} # type: ignore 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..c616dea0b188 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 @@ -6,256 +6,249 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_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/integrationAccounts/{integrationAccountName}/batchConfigurations") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, batch_configuration_name: str, + subscription_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/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "batchConfigurationName": _SERIALIZER.url("batch_configuration_name", batch_configuration_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "batchConfigurationName": _SERIALIZER.url("batch_configuration_name", batch_configuration_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, batch_configuration_name: str, - *, - json: JSONType = None, - content: Any = None, + subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "batchConfigurationName": _SERIALIZER.url("batch_configuration_name", batch_configuration_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "batchConfigurationName": _SERIALIZER.url("batch_configuration_name", batch_configuration_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, batch_configuration_name: str, + subscription_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/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "batchConfigurationName": _SERIALIZER.url("batch_configuration_name", batch_configuration_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "batchConfigurationName": _SERIALIZER.url("batch_configuration_name", batch_configuration_name, "str"), } _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountBatchConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any - ) -> Iterable["_models.BatchConfigurationCollection"]: + self, resource_group_name: str, integration_account_name: str, **kwargs: Any + ) -> Iterable["_models.BatchConfiguration"]: """List the batch configurations for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either BatchConfigurationCollection or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.BatchConfigurationCollection] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either BatchConfiguration or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.BatchConfiguration] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -269,10 +262,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -283,58 +274,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - integration_account_name: str, - batch_configuration_name: str, - **kwargs: Any - ) -> "_models.BatchConfiguration": + self, resource_group_name: str, integration_account_name: str, batch_configuration_name: str, **kwargs: Any + ) -> _models.BatchConfiguration: """Get a batch configuration for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param batch_configuration_name: The batch configuration name. + :param batch_configuration_name: The batch configuration name. Required. :type batch_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchConfiguration, or the result of cls(response) + :return: BatchConfiguration or the result of cls(response) :rtype: ~azure.mgmt.logic.models.BatchConfiguration - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfiguration"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.BatchConfiguration] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, batch_configuration_name=batch_configuration_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -342,15 +333,74 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('BatchConfiguration', pipeline_response) + deserialized = self._deserialize("BatchConfiguration", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + batch_configuration_name: str, + batch_configuration: _models.BatchConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.BatchConfiguration: + """Create or update a batch configuration for an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. Required. + :type batch_configuration_name: str + :param batch_configuration: The batch configuration. Required. + :type batch_configuration: ~azure.mgmt.logic.models.BatchConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.BatchConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + batch_configuration_name: str, + batch_configuration: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.BatchConfiguration: + """Create or update a batch configuration for an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param batch_configuration_name: The batch configuration name. Required. + :type batch_configuration_name: str + :param batch_configuration: The batch configuration. Required. + :type batch_configuration: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: BatchConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.BatchConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( @@ -358,53 +408,71 @@ def create_or_update( resource_group_name: str, integration_account_name: str, batch_configuration_name: str, - batch_configuration: "_models.BatchConfiguration", + batch_configuration: Union[_models.BatchConfiguration, IO], **kwargs: Any - ) -> "_models.BatchConfiguration": + ) -> _models.BatchConfiguration: """Create or update a batch configuration for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param batch_configuration_name: The batch configuration name. + :param batch_configuration_name: The batch configuration name. Required. :type batch_configuration_name: str - :param batch_configuration: The batch configuration. - :type batch_configuration: ~azure.mgmt.logic.models.BatchConfiguration + :param batch_configuration: The batch configuration. Is either a model type or a IO type. + Required. + :type batch_configuration: ~azure.mgmt.logic.models.BatchConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: BatchConfiguration, or the result of cls(response) + :return: BatchConfiguration or the result of cls(response) :rtype: ~azure.mgmt.logic.models.BatchConfiguration - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.BatchConfiguration"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.BatchConfiguration] - _json = self._serialize.body(batch_configuration, 'BatchConfiguration') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(batch_configuration, (IO, bytes)): + _content = batch_configuration + else: + _json = self._serialize.body(batch_configuration, "BatchConfiguration") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, batch_configuration_name=batch_configuration_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -413,65 +481,66 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('BatchConfiguration', pipeline_response) + deserialized = self._deserialize("BatchConfiguration", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('BatchConfiguration', pipeline_response) + deserialized = self._deserialize("BatchConfiguration", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - batch_configuration_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, batch_configuration_name: str, **kwargs: Any ) -> None: """Delete a batch configuration for an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param batch_configuration_name: The batch configuration name. + :param batch_configuration_name: The batch configuration name. Required. :type batch_configuration_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, batch_configuration_name=batch_configuration_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -482,5 +551,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/batchConfigurations/{batchConfigurationName}"} # type: ignore 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..fefb60e158fa 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 @@ -6,266 +6,248 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, + subscription_id: str, *, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - certificate_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, certificate_name: str, subscription_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/integrationAccounts/{integrationAccountName}/certificates/{certificateName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "certificateName": _SERIALIZER.url("certificate_name", certificate_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - certificate_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, certificate_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "certificateName": _SERIALIZER.url("certificate_name", certificate_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - certificate_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, certificate_name: str, subscription_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/integrationAccounts/{integrationAccountName}/certificates/{certificateName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "certificateName": _SERIALIZER.url("certificate_name", certificate_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), } _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group_name: str, - integration_account_name: str, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.IntegrationAccountCertificateListResult"]: + self, resource_group_name: str, integration_account_name: str, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.IntegrationAccountCertificate"]: """Gets a list of integration account certificates. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountCertificateListResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountCertificateListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccountCertificate or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountCertificate] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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,10 +261,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -293,58 +273,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - integration_account_name: str, - certificate_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountCertificate": + self, resource_group_name: str, integration_account_name: str, certificate_name: str, **kwargs: Any + ) -> _models.IntegrationAccountCertificate: """Gets an integration account certificate. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param certificate_name: The integration account certificate name. + :param certificate_name: The integration account certificate name. Required. :type certificate_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountCertificate, or the result of cls(response) + :return: IntegrationAccountCertificate or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificate"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountCertificate] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, certificate_name=certificate_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -352,15 +332,74 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + deserialized = self._deserialize("IntegrationAccountCertificate", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + certificate_name: str, + certificate: _models.IntegrationAccountCertificate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountCertificate: + """Creates or updates an integration account certificate. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. Required. + :type certificate_name: str + :param certificate: The integration account certificate. Required. + :type certificate: ~azure.mgmt.logic.models.IntegrationAccountCertificate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificate or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + certificate_name: str, + certificate: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountCertificate: + """Creates or updates an integration account certificate. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param certificate_name: The integration account certificate name. Required. + :type certificate_name: str + :param certificate: The integration account certificate. Required. + :type certificate: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountCertificate or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( @@ -368,53 +407,71 @@ def create_or_update( resource_group_name: str, integration_account_name: str, certificate_name: str, - certificate: "_models.IntegrationAccountCertificate", + certificate: Union[_models.IntegrationAccountCertificate, IO], **kwargs: Any - ) -> "_models.IntegrationAccountCertificate": + ) -> _models.IntegrationAccountCertificate: """Creates or updates an integration account certificate. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param certificate_name: The integration account certificate name. + :param certificate_name: The integration account certificate name. Required. :type certificate_name: str - :param certificate: The integration account certificate. - :type certificate: ~azure.mgmt.logic.models.IntegrationAccountCertificate + :param certificate: The integration account certificate. Is either a model type or a IO type. + Required. + :type certificate: ~azure.mgmt.logic.models.IntegrationAccountCertificate or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountCertificate, or the result of cls(response) + :return: IntegrationAccountCertificate or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountCertificate - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountCertificate"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(certificate, 'IntegrationAccountCertificate') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountCertificate] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(certificate, (IO, bytes)): + _content = certificate + else: + _json = self._serialize.body(certificate, "IntegrationAccountCertificate") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, certificate_name=certificate_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -423,65 +480,66 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + deserialized = self._deserialize("IntegrationAccountCertificate", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountCertificate', pipeline_response) + deserialized = self._deserialize("IntegrationAccountCertificate", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - certificate_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, certificate_name: str, **kwargs: Any ) -> None: """Deletes an integration account certificate. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param certificate_name: The integration account certificate name. + :param certificate_name: The integration account certificate name. Required. :type certificate_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, certificate_name=certificate_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -492,5 +550,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"} # type: ignore 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..4f027c1db5c4 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 @@ -6,258 +6,229 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - map_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, map_name: str, subscription_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/integrationAccounts/{integrationAccountName}/maps/{mapName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "mapName": _SERIALIZER.url("map_name", map_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "mapName": _SERIALIZER.url("map_name", map_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - map_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, map_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "mapName": _SERIALIZER.url("map_name", map_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "mapName": _SERIALIZER.url("map_name", map_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - map_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, map_name: str, subscription_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/integrationAccounts/{integrationAccountName}/maps/{mapName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "mapName": _SERIALIZER.url("map_name", map_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "mapName": _SERIALIZER.url("map_name", map_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_content_callback_url_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - map_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, map_name: str, subscription_id: str, **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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "mapName": _SERIALIZER.url("map_name", map_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "mapName": _SERIALIZER.url("map_name", map_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - 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. - - :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. + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountMapsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,12 +238,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountMapListResult"]: + ) -> Iterable["_models.IntegrationAccountMap"]: """Gets a list of integration account maps. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -280,46 +251,50 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountMapListResult or the result of + :return: An iterator like instance of either IntegrationAccountMap or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountMapListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountMap] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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,10 +308,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -347,58 +320,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - integration_account_name: str, - map_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountMap": + self, resource_group_name: str, integration_account_name: str, map_name: str, **kwargs: Any + ) -> _models.IntegrationAccountMap: """Gets an integration account map. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param map_name: The integration account map name. + :param map_name: The integration account map name. Required. :type map_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountMap, or the result of cls(response) + :return: IntegrationAccountMap or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMap"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountMap] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, map_name=map_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -406,15 +379,78 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + deserialized = self._deserialize("IntegrationAccountMap", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + map: _models.IntegrationAccountMap, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param map_name: The integration account map name. Required. + :type map_name: str + :param map: The integration account map. Required. + :type map: ~azure.mgmt.logic.models.IntegrationAccountMap + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMap or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + map: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param map_name: The integration account map name. Required. + :type map_name: str + :param map: The integration account map. Required. + :type map: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountMap or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( @@ -422,55 +458,72 @@ def create_or_update( resource_group_name: str, integration_account_name: str, map_name: str, - map: "_models.IntegrationAccountMap", + map: Union[_models.IntegrationAccountMap, IO], **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. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param map_name: The integration account map name. + :param map_name: The integration account map name. Required. :type map_name: str - :param map: The integration account map. - :type map: ~azure.mgmt.logic.models.IntegrationAccountMap + :param map: The integration account map. Is either a model type or a IO type. Required. + :type map: ~azure.mgmt.logic.models.IntegrationAccountMap or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountMap, or the result of cls(response) + :return: IntegrationAccountMap or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountMap - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountMap"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(map, 'IntegrationAccountMap') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountMap] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(map, (IO, bytes)): + _content = map + else: + _json = self._serialize.body(map, "IntegrationAccountMap") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, map_name=map_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -479,65 +532,66 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + deserialized = self._deserialize("IntegrationAccountMap", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountMap', pipeline_response) + deserialized = self._deserialize("IntegrationAccountMap", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - map_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, map_name: str, **kwargs: Any ) -> None: """Deletes an integration account map. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param map_name: The integration account map name. + :param map_name: The integration account map name. Required. :type map_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, map_name=map_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -548,8 +602,67 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"} # type: ignore + @overload + def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + list_content_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param map_name: The integration account map name. Required. + :type map_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + map_name: str, + list_content_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param map_name: The integration account map name. Required. + :type map_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def list_content_callback_url( @@ -557,53 +670,70 @@ 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: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param map_name: The integration account map name. + :param map_name: The integration account map name. Required. :type map_name: str - :param list_content_callback_url: - :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_content_callback_url: Is either a model type or a IO type. Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_content_callback_url, (IO, bytes)): + _content = list_content_callback_url + else: + _json = self._serialize.body(list_content_callback_url, "GetCallbackUrlParameters") request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, map_name=map_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_content_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -611,12 +741,11 @@ def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}/listContentCallbackUrl"} # type: ignore 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..e7e2214ef63e 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 @@ -6,258 +6,229 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - partner_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, partner_name: str, subscription_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/integrationAccounts/{integrationAccountName}/partners/{partnerName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "partnerName": _SERIALIZER.url("partner_name", partner_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "partnerName": _SERIALIZER.url("partner_name", partner_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - partner_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, partner_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "partnerName": _SERIALIZER.url("partner_name", partner_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "partnerName": _SERIALIZER.url("partner_name", partner_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - partner_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, partner_name: str, subscription_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/integrationAccounts/{integrationAccountName}/partners/{partnerName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "partnerName": _SERIALIZER.url("partner_name", partner_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "partnerName": _SERIALIZER.url("partner_name", partner_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_content_callback_url_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - partner_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, partner_name: str, subscription_id: str, **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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "partnerName": _SERIALIZER.url("partner_name", partner_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "partnerName": _SERIALIZER.url("partner_name", partner_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - 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. - - :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. + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountPartnersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,12 +238,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountPartnerListResult"]: + ) -> Iterable["_models.IntegrationAccountPartner"]: """Gets a list of integration account partners. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -280,47 +251,50 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountPartnerListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountPartnerListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccountPartner or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountPartner] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -334,10 +308,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -348,58 +320,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - integration_account_name: str, - partner_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountPartner": + self, resource_group_name: str, integration_account_name: str, partner_name: str, **kwargs: Any + ) -> _models.IntegrationAccountPartner: """Gets an integration account partner. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param partner_name: The integration account partner name. + :param partner_name: The integration account partner name. Required. :type partner_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountPartner, or the result of cls(response) + :return: IntegrationAccountPartner or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartner"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountPartner] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, partner_name=partner_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -407,15 +379,74 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + deserialized = self._deserialize("IntegrationAccountPartner", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + partner: _models.IntegrationAccountPartner, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountPartner: + """Creates or updates an integration account partner. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param partner_name: The integration account partner name. Required. + :type partner_name: str + :param partner: The integration account partner. Required. + :type partner: ~azure.mgmt.logic.models.IntegrationAccountPartner + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartner or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + partner: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountPartner: + """Creates or updates an integration account partner. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param partner_name: The integration account partner name. Required. + :type partner_name: str + :param partner: The integration account partner. Required. + :type partner: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountPartner or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( @@ -423,53 +454,70 @@ def create_or_update( resource_group_name: str, integration_account_name: str, partner_name: str, - partner: "_models.IntegrationAccountPartner", + partner: Union[_models.IntegrationAccountPartner, IO], **kwargs: Any - ) -> "_models.IntegrationAccountPartner": + ) -> _models.IntegrationAccountPartner: """Creates or updates an integration account partner. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param partner_name: The integration account partner name. + :param partner_name: The integration account partner name. Required. :type partner_name: str - :param partner: The integration account partner. - :type partner: ~azure.mgmt.logic.models.IntegrationAccountPartner + :param partner: The integration account partner. Is either a model type or a IO type. Required. + :type partner: ~azure.mgmt.logic.models.IntegrationAccountPartner or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountPartner, or the result of cls(response) + :return: IntegrationAccountPartner or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountPartner - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountPartner"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountPartner] - _json = self._serialize.body(partner, 'IntegrationAccountPartner') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(partner, (IO, bytes)): + _content = partner + else: + _json = self._serialize.body(partner, "IntegrationAccountPartner") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, partner_name=partner_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -478,65 +526,66 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + deserialized = self._deserialize("IntegrationAccountPartner", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountPartner', pipeline_response) + deserialized = self._deserialize("IntegrationAccountPartner", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - partner_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, partner_name: str, **kwargs: Any ) -> None: """Deletes an integration account partner. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param partner_name: The integration account partner name. + :param partner_name: The integration account partner name. Required. :type partner_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, partner_name=partner_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -547,8 +596,67 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}"} # type: ignore + @overload + def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + list_content_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param partner_name: The integration account partner name. Required. + :type partner_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + partner_name: str, + list_content_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param partner_name: The integration account partner name. Required. + :type partner_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def list_content_callback_url( @@ -556,53 +664,70 @@ 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: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param partner_name: The integration account partner name. + :param partner_name: The integration account partner name. Required. :type partner_name: str - :param list_content_callback_url: - :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_content_callback_url: Is either a model type or a IO type. Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_content_callback_url, (IO, bytes)): + _content = list_content_callback_url + else: + _json = self._serialize.body(list_content_callback_url, "GetCallbackUrlParameters") request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, partner_name=partner_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_content_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -610,12 +735,11 @@ def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/partners/{partnerName}/listContentCallbackUrl"} # type: ignore 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..515b18bff169 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 @@ -6,258 +6,229 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - schema_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, schema_name: str, subscription_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/integrationAccounts/{integrationAccountName}/schemas/{schemaName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "schemaName": _SERIALIZER.url("schema_name", schema_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - schema_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, schema_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "schemaName": _SERIALIZER.url("schema_name", schema_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - schema_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, schema_name: str, subscription_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/integrationAccounts/{integrationAccountName}/schemas/{schemaName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "schemaName": _SERIALIZER.url("schema_name", schema_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_content_callback_url_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - schema_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, schema_name: str, subscription_id: str, **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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "schemaName": _SERIALIZER.url("schema_name", schema_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - 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. - - :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. + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountSchemasOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,12 +238,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountSchemaListResult"]: + ) -> Iterable["_models.IntegrationAccountSchema"]: """Gets a list of integration account schemas. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -280,47 +251,50 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountSchemaListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountSchemaListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccountSchema or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountSchema] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -334,10 +308,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -348,58 +320,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - integration_account_name: str, - schema_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountSchema": + self, resource_group_name: str, integration_account_name: str, schema_name: str, **kwargs: Any + ) -> _models.IntegrationAccountSchema: """Gets an integration account schema. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param schema_name: The integration account schema name. + :param schema_name: The integration account schema name. Required. :type schema_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountSchema, or the result of cls(response) + :return: IntegrationAccountSchema or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchema"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountSchema] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, schema_name=schema_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -407,15 +379,74 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSchema", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + schema: _models.IntegrationAccountSchema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountSchema: + """Creates or updates an integration account schema. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param schema_name: The integration account schema name. Required. + :type schema_name: str + :param schema: The integration account schema. Required. + :type schema: ~azure.mgmt.logic.models.IntegrationAccountSchema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchema or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + schema: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountSchema: + """Creates or updates an integration account schema. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param schema_name: The integration account schema name. Required. + :type schema_name: str + :param schema: The integration account schema. Required. + :type schema: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSchema or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( @@ -423,53 +454,70 @@ def create_or_update( resource_group_name: str, integration_account_name: str, schema_name: str, - schema: "_models.IntegrationAccountSchema", + schema: Union[_models.IntegrationAccountSchema, IO], **kwargs: Any - ) -> "_models.IntegrationAccountSchema": + ) -> _models.IntegrationAccountSchema: """Creates or updates an integration account schema. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param schema_name: The integration account schema name. + :param schema_name: The integration account schema name. Required. :type schema_name: str - :param schema: The integration account schema. - :type schema: ~azure.mgmt.logic.models.IntegrationAccountSchema + :param schema: The integration account schema. Is either a model type or a IO type. Required. + :type schema: ~azure.mgmt.logic.models.IntegrationAccountSchema or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountSchema, or the result of cls(response) + :return: IntegrationAccountSchema or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountSchema - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSchema"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountSchema] - _json = self._serialize.body(schema, 'IntegrationAccountSchema') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(schema, (IO, bytes)): + _content = schema + else: + _json = self._serialize.body(schema, "IntegrationAccountSchema") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, schema_name=schema_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -478,65 +526,66 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSchema", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountSchema', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSchema", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - schema_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, schema_name: str, **kwargs: Any ) -> None: """Deletes an integration account schema. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param schema_name: The integration account schema name. + :param schema_name: The integration account schema name. Required. :type schema_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, schema_name=schema_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -547,8 +596,67 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}"} # type: ignore + @overload + def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + list_content_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param schema_name: The integration account schema name. Required. + :type schema_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_content_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + schema_name: str, + list_content_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the content callback url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param schema_name: The integration account schema name. Required. + :type schema_name: str + :param list_content_callback_url: Required. + :type list_content_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def list_content_callback_url( @@ -556,53 +664,70 @@ 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: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the content callback url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param schema_name: The integration account schema name. + :param schema_name: The integration account schema name. Required. :type schema_name: str - :param list_content_callback_url: - :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_content_callback_url: Is either a model type or a IO type. Required. + :type list_content_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - _json = self._serialize.body(list_content_callback_url, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_content_callback_url, (IO, bytes)): + _content = list_content_callback_url + else: + _json = self._serialize.body(list_content_callback_url, "GetCallbackUrlParameters") request = build_list_content_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, schema_name=schema_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_content_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -610,12 +735,11 @@ def list_content_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_content_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}/listContentCallbackUrl"} # type: ignore - + list_content_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/schemas/{schemaName}/listContentCallbackUrl"} # type: ignore 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..6849bebdf03f 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 @@ -6,212 +6,194 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, integration_account_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - session_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, session_name: str, subscription_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/integrationAccounts/{integrationAccountName}/sessions/{sessionName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "sessionName": _SERIALIZER.url("session_name", session_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "sessionName": _SERIALIZER.url("session_name", session_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - session_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, session_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "sessionName": _SERIALIZER.url("session_name", session_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "sessionName": _SERIALIZER.url("session_name", session_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - session_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, session_name: str, subscription_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/integrationAccounts/{integrationAccountName}/sessions/{sessionName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), - "sessionName": _SERIALIZER.url("session_name", session_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), + "sessionName": _SERIALIZER.url("session_name", session_name, "str"), } _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountSessionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,12 +203,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.IntegrationAccountSessionListResult"]: + ) -> Iterable["_models.IntegrationAccountSession"]: """Gets a list of integration account sessions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -234,47 +216,50 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountSessionListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountSessionListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccountSession or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountSession] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -288,10 +273,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -302,58 +285,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - integration_account_name: str, - session_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccountSession": + self, resource_group_name: str, integration_account_name: str, session_name: str, **kwargs: Any + ) -> _models.IntegrationAccountSession: """Gets an integration account session. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param session_name: The integration account session name. + :param session_name: The integration account session name. Required. :type session_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountSession, or the result of cls(response) + :return: IntegrationAccountSession or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSession"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountSession] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, session_name=session_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -361,15 +344,74 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSession", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + session_name: str, + session: _models.IntegrationAccountSession, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountSession: + """Creates or updates an integration account session. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param session_name: The integration account session name. Required. + :type session_name: str + :param session: The integration account session. Required. + :type session: ~azure.mgmt.logic.models.IntegrationAccountSession + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSession or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + session_name: str, + session: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccountSession: + """Creates or updates an integration account session. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param session_name: The integration account session name. Required. + :type session_name: str + :param session: The integration account session. Required. + :type session: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccountSession or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( @@ -377,53 +419,70 @@ def create_or_update( resource_group_name: str, integration_account_name: str, session_name: str, - session: "_models.IntegrationAccountSession", + session: Union[_models.IntegrationAccountSession, IO], **kwargs: Any - ) -> "_models.IntegrationAccountSession": + ) -> _models.IntegrationAccountSession: """Creates or updates an integration account session. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param session_name: The integration account session name. + :param session_name: The integration account session name. Required. :type session_name: str - :param session: The integration account session. - :type session: ~azure.mgmt.logic.models.IntegrationAccountSession + :param session: The integration account session. Is either a model type or a IO type. Required. + :type session: ~azure.mgmt.logic.models.IntegrationAccountSession or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccountSession, or the result of cls(response) + :return: IntegrationAccountSession or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccountSession - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccountSession"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(session, 'IntegrationAccountSession') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccountSession] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(session, (IO, bytes)): + _content = session + else: + _json = self._serialize.body(session, "IntegrationAccountSession") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, session_name=session_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -432,65 +491,66 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSession", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccountSession', pipeline_response) + deserialized = self._deserialize("IntegrationAccountSession", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - session_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, session_name: str, **kwargs: Any ) -> None: """Deletes an integration account session. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param session_name: The integration account session name. + :param session_name: The integration account session name. Required. :type session_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, session_name=session_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -501,5 +561,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/sessions/{sessionName}"} # type: ignore 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..c767a8fed7e4 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 @@ -6,503 +6,428 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_by_subscription_request( - subscription_id: str, - *, - top: Optional[int] = None, - **kwargs: Any + subscription_id: str, *, 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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_list_by_resource_group_request( - subscription_id: str, - resource_group_name: str, - *, - top: Optional[int] = None, - **kwargs: Any + resource_group_name: str, subscription_id: str, *, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_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/integrationAccounts/{integrationAccountName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_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/integrationAccounts/{integrationAccountName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_callback_url_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_list_key_vault_keys_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_log_tracking_events_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_regenerate_access_key_request( - subscription_id: str, - resource_group_name: str, - integration_account_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, integration_account_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "integrationAccountName": _SERIALIZER.url("integration_account_name", integration_account_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - 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. - - :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. + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationAccountsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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"]: + def list_by_subscription(self, top: Optional[int] = None, **kwargs: Any) -> Iterable["_models.IntegrationAccount"]: """Gets a list of integration accounts by subscription. :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccount or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccount] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_subscription_request( subscription_id=self._config.subscription_id, - api_version=api_version, top=top, - template_url=self.list_by_subscription.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -516,10 +441,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -530,62 +453,62 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.IntegrationAccountListResult"]: + self, resource_group_name: str, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.IntegrationAccount"]: """Gets a list of integration accounts by resource group. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationAccountListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccountListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationAccount or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationAccount] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, - template_url=self.list_by_resource_group.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -599,10 +522,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -613,54 +534,53 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts"} # type: ignore @distributed_trace - def get( - self, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any - ) -> "_models.IntegrationAccount": + def get(self, resource_group_name: str, integration_account_name: str, **kwargs: Any) -> _models.IntegrationAccount: """Gets an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccount, or the result of cls(response) + :return: IntegrationAccount or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccount - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccount] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -668,65 +588,136 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + integration_account: _models.IntegrationAccount, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Creates or updates an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param integration_account: The integration account. Required. + :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + integration_account_name: str, + integration_account: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Creates or updates an integration account. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param integration_account: The integration account. Required. + :type integration_account: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def create_or_update( self, resource_group_name: str, integration_account_name: str, - integration_account: "_models.IntegrationAccount", + integration_account: Union[_models.IntegrationAccount, IO], **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Creates or updates an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param integration_account: The integration account. - :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount + :param integration_account: The integration account. Is either a model type or a IO type. + Required. + :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccount, or the result of cls(response) + :return: IntegrationAccount or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccount - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccount] - _json = self._serialize.body(integration_account, 'IntegrationAccount') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_account, (IO, bytes)): + _content = integration_account + else: + _json = self._serialize.body(integration_account, "IntegrationAccount") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -735,68 +726,139 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + + @overload + def update( + self, + resource_group_name: str, + integration_account_name: str, + integration_account: _models.IntegrationAccount, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Updates an integration account. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param integration_account: The integration account. Required. + :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + integration_account_name: str, + integration_account: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Updates an integration account. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param integration_account: The integration account. Required. + :type integration_account: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def update( self, resource_group_name: str, integration_account_name: str, - integration_account: "_models.IntegrationAccount", + integration_account: Union[_models.IntegrationAccount, IO], **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Updates an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param integration_account: The integration account. - :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount + :param integration_account: The integration account. Is either a model type or a IO type. + Required. + :type integration_account: ~azure.mgmt.logic.models.IntegrationAccount or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccount, or the result of cls(response) + :return: IntegrationAccount or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccount - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccount] - _json = self._serialize.body(integration_account, 'IntegrationAccount') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_account, (IO, bytes)): + _content = integration_account + else: + _json = self._serialize.body(integration_account, "IntegrationAccount") request = build_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -804,58 +866,60 @@ def update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - integration_account_name: str, - **kwargs: Any + self, resource_group_name: str, integration_account_name: str, **kwargs: Any ) -> None: """Deletes an integration account. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -866,58 +930,128 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"} # type: ignore + + @overload + def list_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + parameters: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CallbackUrl: + """Gets the integration account callback URL. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param parameters: The callback URL parameters. Required. + :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.CallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload + def list_callback_url( + self, + resource_group_name: str, + integration_account_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.CallbackUrl: + """Gets the integration account callback URL. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param parameters: The callback URL parameters. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.CallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def list_callback_url( self, resource_group_name: str, integration_account_name: str, - parameters: "_models.GetCallbackUrlParameters", + parameters: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.CallbackUrl": + ) -> _models.CallbackUrl: """Gets the integration account callback URL. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param parameters: The callback URL parameters. - :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param parameters: The callback URL parameters. Is either a model type or a IO type. Required. + :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: CallbackUrl, or the result of cls(response) + :return: CallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.CallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.CallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(parameters, 'GetCallbackUrlParameters') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.CallbackUrl] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "GetCallbackUrlParameters") request = build_list_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -925,76 +1059,142 @@ def list_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('CallbackUrl', pipeline_response) + deserialized = self._deserialize("CallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl"} # type: ignore + list_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl"} # type: ignore + + @overload + def list_key_vault_keys( + self, + resource_group_name: str, + integration_account_name: str, + list_key_vault_keys: _models.ListKeyVaultKeysDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.KeyVaultKey"]: + """Gets the integration account's Key Vault keys. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param list_key_vault_keys: The key vault parameters. Required. + :type list_key_vault_keys: ~azure.mgmt.logic.models.ListKeyVaultKeysDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KeyVaultKey or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.KeyVaultKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload + def list_key_vault_keys( + self, + resource_group_name: str, + integration_account_name: str, + list_key_vault_keys: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Iterable["_models.KeyVaultKey"]: + """Gets the integration account's Key Vault keys. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param list_key_vault_keys: The key vault parameters. Required. + :type list_key_vault_keys: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either KeyVaultKey or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.KeyVaultKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def list_key_vault_keys( self, resource_group_name: str, integration_account_name: str, - list_key_vault_keys: "_models.ListKeyVaultKeysDefinition", + list_key_vault_keys: Union[_models.ListKeyVaultKeysDefinition, IO], **kwargs: Any - ) -> Iterable["_models.KeyVaultKeyCollection"]: + ) -> Iterable["_models.KeyVaultKey"]: """Gets the integration account's Key Vault keys. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param list_key_vault_keys: The key vault parameters. - :type list_key_vault_keys: ~azure.mgmt.logic.models.ListKeyVaultKeysDefinition + :param list_key_vault_keys: The key vault parameters. Is either a model type or a IO type. + Required. + :type list_key_vault_keys: ~azure.mgmt.logic.models.ListKeyVaultKeysDefinition or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either KeyVaultKeyCollection or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.KeyVaultKeyCollection] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either KeyVaultKey or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.KeyVaultKey] + :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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {}) or {}) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_key_vault_keys, (IO, bytes)): + _content = list_key_vault_keys + else: + _json = self._serialize.body(list_key_vault_keys, "ListKeyVaultKeysDefinition") + def prepare_request(next_link=None): if not next_link: - _json = self._serialize.body(list_key_vault_keys, 'ListKeyVaultKeysDefinition') - + request = build_list_key_vault_keys_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_key_vault_keys.metadata['url'], + content=_content, + 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') - - request = build_list_key_vault_keys_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - integration_account_name=integration_account_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -1008,10 +1208,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1022,61 +1220,131 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_key_vault_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys"} # type: ignore + list_key_vault_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listKeyVaultKeys"} # type: ignore - @distributed_trace + @overload 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, + *, + content_type: str = "application/json", **kwargs: Any ) -> None: """Logs the integration account's tracking events. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param log_tracking_events: The callback URL parameters. + :param log_tracking_events: The callback URL parameters. Required. :type log_tracking_events: ~azure.mgmt.logic.models.TrackingEventsDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def log_tracking_events( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + integration_account_name: str, + log_tracking_events: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Logs the integration account's tracking events. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param log_tracking_events: The callback URL parameters. Required. + :type log_tracking_events: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def log_tracking_events( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + integration_account_name: str, + log_tracking_events: Union[_models.TrackingEventsDefinition, IO], + **kwargs: Any + ) -> None: + """Logs the integration account's tracking events. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param log_tracking_events: The callback URL parameters. Is either a model type or a IO type. + Required. + :type log_tracking_events: ~azure.mgmt.logic.models.TrackingEventsDefinition or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] - _json = self._serialize.body(log_tracking_events, 'TrackingEventsDefinition') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(log_tracking_events, (IO, bytes)): + _content = log_tracking_events + else: + _json = self._serialize.body(log_tracking_events, "TrackingEventsDefinition") request = build_log_tracking_events_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.log_tracking_events.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1087,58 +1355,129 @@ def log_tracking_events( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - log_tracking_events.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents"} # type: ignore + log_tracking_events.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/logTrackingEvents"} # type: ignore + @overload + def regenerate_access_key( + self, + resource_group_name: str, + integration_account_name: str, + regenerate_access_key: _models.RegenerateActionParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Regenerates the integration account access key. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param regenerate_access_key: The access key type. Required. + :type regenerate_access_key: ~azure.mgmt.logic.models.RegenerateActionParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def regenerate_access_key( + self, + resource_group_name: str, + integration_account_name: str, + regenerate_access_key: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IntegrationAccount: + """Regenerates the integration account access key. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param integration_account_name: The integration account name. Required. + :type integration_account_name: str + :param regenerate_access_key: The access key type. Required. + :type regenerate_access_key: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: IntegrationAccount or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.IntegrationAccount + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def regenerate_access_key( self, resource_group_name: str, integration_account_name: str, - regenerate_access_key: "_models.RegenerateActionParameter", + regenerate_access_key: Union[_models.RegenerateActionParameter, IO], **kwargs: Any - ) -> "_models.IntegrationAccount": + ) -> _models.IntegrationAccount: """Regenerates the integration account access key. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param integration_account_name: The integration account name. + :param integration_account_name: The integration account name. Required. :type integration_account_name: str - :param regenerate_access_key: The access key type. - :type regenerate_access_key: ~azure.mgmt.logic.models.RegenerateActionParameter + :param regenerate_access_key: The access key type. Is either a model type or a IO type. + Required. + :type regenerate_access_key: ~azure.mgmt.logic.models.RegenerateActionParameter or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationAccount, or the result of cls(response) + :return: IntegrationAccount or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationAccount - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationAccount"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationAccount] - _json = self._serialize.body(regenerate_access_key, 'RegenerateActionParameter') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(regenerate_access_key, (IO, bytes)): + _content = regenerate_access_key + else: + _json = self._serialize.body(regenerate_access_key, "RegenerateActionParameter") request = build_regenerate_access_key_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, integration_account_name=integration_account_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.regenerate_access_key.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1146,12 +1485,11 @@ def regenerate_access_key( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationAccount', pipeline_response) + deserialized = self._deserialize("IntegrationAccount", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - regenerate_access_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey"} # type: ignore - + regenerate_access_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/regenerateAccessKey"} # type: ignore 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..bceffb2ddc47 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 @@ -7,139 +7,144 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any + resource_group: str, integration_service_environment_name: str, api_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), - "apiName": _SERIALIZER.url("api_name", api_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), + "apiName": _SERIALIZER.url("api_name", api_name, "str"), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationServiceEnvironmentManagedApiOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any - ) -> Iterable["_models.ApiOperationListResult"]: + self, resource_group: str, integration_service_environment_name: str, api_name: str, **kwargs: Any + ) -> Iterable["_models.ApiOperation"]: """Gets the managed Api operations. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param api_name: The api name. + :param api_name: The api name. Required. :type api_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApiOperationListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ApiOperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ApiOperation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ApiOperation] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group=resource_group, - integration_service_environment_name=integration_service_environment_name, - api_name=api_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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,10 +158,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -167,8 +170,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}/apiOperations"} # type: ignore 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..20b8225fdeb8 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,259 +6,250 @@ # 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 msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + resource_group: str, integration_service_environment_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any + resource_group: str, integration_service_environment_name: str, api_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), - "apiName": _SERIALIZER.url("api_name", api_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), + "apiName": _SERIALIZER.url("api_name", api_name, "str"), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_put_request_initial( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_put_request( + resource_group: str, integration_service_environment_name: str, api_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), - "apiName": _SERIALIZER.url("api_name", api_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), + "apiName": _SERIALIZER.url("api_name", api_name, "str"), } _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_request( + resource_group: str, integration_service_environment_name: str, api_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), - "apiName": _SERIALIZER.url("api_name", api_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), + "apiName": _SERIALIZER.url("api_name", api_name, "str"), } _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') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationServiceEnvironmentManagedApisOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any - ) -> Iterable["_models.IntegrationServiceEnvironmentManagedApiListResult"]: + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any + ) -> Iterable["_models.IntegrationServiceEnvironmentManagedApi"]: """Gets the integration service environment managed Apis. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationServiceEnvironmentManagedApiListResult - or the result of cls(response) + :return: An iterator like instance of either IntegrationServiceEnvironmentManagedApi or the + result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApiListResult] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group=resource_group, - integration_service_environment_name=integration_service_environment_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -272,10 +263,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -286,58 +275,59 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis"} # type: ignore @distributed_trace def get( - self, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any - ) -> "_models.IntegrationServiceEnvironmentManagedApi": + self, resource_group: str, integration_service_environment_name: str, api_name: str, **kwargs: Any + ) -> _models.IntegrationServiceEnvironmentManagedApi: """Gets the integration service environment managed Api. - :param resource_group: The resource group name. + :param resource_group: The resource group name. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param api_name: The api name. + :param api_name: The api name. Required. :type api_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationServiceEnvironmentManagedApi, or the result of cls(response) + :return: IntegrationServiceEnvironmentManagedApi or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -345,72 +335,170 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironmentManagedApi", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore def _put_initial( self, resource_group: str, integration_service_environment_name: str, api_name: str, - integration_service_environment_managed_api: "_models.IntegrationServiceEnvironmentManagedApi", + integration_service_environment_managed_api: Union[_models.IntegrationServiceEnvironmentManagedApi, IO], **kwargs: Any - ) -> "_models.IntegrationServiceEnvironmentManagedApi": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironmentManagedApi"] + ) -> _models.IntegrationServiceEnvironmentManagedApi: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(integration_service_environment_managed_api, 'IntegrationServiceEnvironmentManagedApi') + 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", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_service_environment_managed_api, (IO, bytes)): + _content = integration_service_environment_managed_api + else: + _json = self._serialize.body( + integration_service_environment_managed_api, "IntegrationServiceEnvironmentManagedApi" + ) - request = build_put_request_initial( - subscription_id=self._config.subscription_id, + request = build_put_request( resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._put_initial.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironmentManagedApi", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironmentManagedApi", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _put_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore + _put_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore + + @overload + def begin_put( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + integration_service_environment_managed_api: _models.IntegrationServiceEnvironmentManagedApi, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IntegrationServiceEnvironmentManagedApi]: + """Puts the integration service environment managed Api. + + :param resource_group: The resource group name. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param api_name: The api name. Required. + :type api_name: str + :param integration_service_environment_managed_api: The integration service environment managed + api. Required. + :type integration_service_environment_managed_api: + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IntegrationServiceEnvironmentManagedApi + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_put( + self, + resource_group: str, + integration_service_environment_name: str, + api_name: str, + integration_service_environment_managed_api: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IntegrationServiceEnvironmentManagedApi]: + """Puts the integration service environment managed Api. + :param resource_group: The resource group name. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param api_name: The api name. Required. + :type api_name: str + :param integration_service_environment_managed_api: The integration service environment managed + api. Required. + :type integration_service_environment_managed_api: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IntegrationServiceEnvironmentManagedApi + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def begin_put( @@ -418,21 +506,25 @@ 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: Union[_models.IntegrationServiceEnvironmentManagedApi, IO], **kwargs: Any - ) -> LROPoller["_models.IntegrationServiceEnvironmentManagedApi"]: + ) -> LROPoller[_models.IntegrationServiceEnvironmentManagedApi]: """Puts the integration service environment managed Api. - :param resource_group: The resource group name. + :param resource_group: The resource group name. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param api_name: The api name. + :param api_name: The api name. Required. :type api_name: str :param integration_service_environment_managed_api: The integration service environment managed - api. + api. Is either a model type or a IO type. Required. :type integration_service_environment_managed_api: - ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi + ~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -445,111 +537,113 @@ def begin_put( or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironmentManagedApi] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - 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] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironmentManagedApi] + 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._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, integration_service_environment_managed_api=integration_service_environment_managed_api, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('IntegrationServiceEnvironmentManagedApi', pipeline_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() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_put.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore + begin_put.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any + self, resource_group: str, integration_service_environment_name: str, api_name: str, **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + + request = build_delete_request( resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, api_name=api_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group: str, - integration_service_environment_name: str, - api_name: str, - **kwargs: Any + def begin_delete( + self, resource_group: str, integration_service_environment_name: str, api_name: str, **kwargs: Any ) -> LROPoller[None]: """Deletes the integration service environment managed Api. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param api_name: The api name. + :param api_name: The api name. Required. :type api_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -561,42 +655,46 @@ def begin_delete( # pylint: disable=inconsistent-return-statements Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + 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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/managedApis/{apiName}"} # type: ignore 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..a3e9bd59add5 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 @@ -8,123 +8,133 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_get_request( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + resource_group: str, integration_service_environment_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationServiceEnvironmentNetworkHealthOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any - ) -> Dict[str, "_models.IntegrationServiceEnvironmentSubnetNetworkHealth"]: + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any + ) -> Dict[str, _models.IntegrationServiceEnvironmentSubnetNetworkHealth]: """Gets the integration service environment network health. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: dict mapping str to IntegrationServiceEnvironmentSubnetNetworkHealth, or the result of + :return: dict mapping str to IntegrationServiceEnvironmentSubnetNetworkHealth or the result of cls(response) :rtype: dict[str, ~azure.mgmt.logic.models.IntegrationServiceEnvironmentSubnetNetworkHealth] - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[Dict[str, "_models.IntegrationServiceEnvironmentSubnetNetworkHealth"]] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop( + "cls", None + ) # type: ClsType[Dict[str, _models.IntegrationServiceEnvironmentSubnetNetworkHealth]] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -132,12 +142,11 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('{IntegrationServiceEnvironmentSubnetNetworkHealth}', pipeline_response) + deserialized = self._deserialize("{IntegrationServiceEnvironmentSubnetNetworkHealth}", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/health/network"} # type: ignore 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..8a5e9ce82f3b 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 @@ -7,133 +7,142 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + resource_group: str, integration_service_environment_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationServiceEnvironmentSkusOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any - ) -> Iterable["_models.IntegrationServiceEnvironmentSkuList"]: + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any + ) -> Iterable["_models.IntegrationServiceEnvironmentSkuDefinition"]: """Gets a list of integration service environment Skus. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationServiceEnvironmentSkuList or the result - of cls(response) + :return: An iterator like instance of either IntegrationServiceEnvironmentSkuDefinition or the + result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuList] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentSkuDefinition] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group=resource_group, - integration_service_environment_name=integration_service_environment_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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,10 +156,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -161,8 +168,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/skus"} # type: ignore 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..33cc2a4381e8 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,366 +6,340 @@ # 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 msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_by_subscription_request( - subscription_id: str, - *, - top: Optional[int] = None, - **kwargs: Any + subscription_id: str, *, 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 + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments" + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_list_by_resource_group_request( - subscription_id: str, - resource_group: str, - *, - top: Optional[int] = None, - **kwargs: Any + resource_group: str, subscription_id: str, *, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + resource_group: str, integration_service_environment_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_or_update_request( + resource_group: str, integration_service_environment_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), } _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') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - json=json, - content=content, - **kwargs - ) - - -def build_update_request_initial( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_update_request( + resource_group: str, integration_service_environment_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + resource_group: str, integration_service_environment_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), } _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, - **kwargs - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_restart_request( - subscription_id: str, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + resource_group: str, integration_service_environment_name: str, subscription_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/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroup": _SERIALIZER.url("resource_group", resource_group, 'str'), - "integrationServiceEnvironmentName": _SERIALIZER.url("integration_service_environment_name", integration_service_environment_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroup": _SERIALIZER.url("resource_group", resource_group, "str"), + "integrationServiceEnvironmentName": _SERIALIZER.url( + "integration_service_environment_name", integration_service_environment_name, "str" + ), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class IntegrationServiceEnvironmentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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"]: + self, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.IntegrationServiceEnvironment"]: """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. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationServiceEnvironmentListResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationServiceEnvironment or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_subscription_request( subscription_id=self._config.subscription_id, - api_version=api_version, top=top, - template_url=self.list_by_subscription.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -379,10 +353,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -393,63 +365,63 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationServiceEnvironments"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group: str, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.IntegrationServiceEnvironmentListResult"]: + self, resource_group: str, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.IntegrationServiceEnvironment"]: """Gets a list of integration service environments by resource group. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either IntegrationServiceEnvironmentListResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironmentListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either IntegrationServiceEnvironment or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, - template_url=self.list_by_resource_group.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group=resource_group, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -463,10 +435,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -477,54 +447,56 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments"} # type: ignore @distributed_trace def get( - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any + ) -> _models.IntegrationServiceEnvironment: """Gets an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: IntegrationServiceEnvironment, or the result of cls(response) + :return: IntegrationServiceEnvironment or the result of cls(response) :rtype: ~azure.mgmt.logic.models.IntegrationServiceEnvironment - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -532,87 +504,178 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore def _create_or_update_initial( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: Union[_models.IntegrationServiceEnvironment, IO], **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] + ) -> _models.IntegrationServiceEnvironment: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(integration_service_environment, 'IntegrationServiceEnvironment') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_service_environment, (IO, bytes)): + _content = integration_service_environment + else: + _json = self._serialize.body(integration_service_environment, "IntegrationServiceEnvironment") + + request = build_create_or_update_request( resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._create_or_update_initial.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironment", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group: str, + integration_service_environment_name: str, + integration_service_environment: _models.IntegrationServiceEnvironment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IntegrationServiceEnvironment]: + """Creates or updates an integration service environment. + :param resource_group: The resource group. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param integration_service_environment: The integration service environment. Required. + :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IntegrationServiceEnvironment or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group: str, + integration_service_environment_name: str, + integration_service_environment: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IntegrationServiceEnvironment]: + """Creates or updates an integration service environment. + + :param resource_group: The resource group. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param integration_service_environment: The integration service environment. Required. + :type integration_service_environment: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IntegrationServiceEnvironment or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def begin_create_or_update( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: Union[_models.IntegrationServiceEnvironment, IO], **kwargs: Any - ) -> LROPoller["_models.IntegrationServiceEnvironment"]: + ) -> LROPoller[_models.IntegrationServiceEnvironment]: """Creates or updates an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param integration_service_environment: The integration service environment. + :param integration_service_environment: The integration service environment. Is either a model + type or a IO type. Required. :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -624,118 +687,213 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either IntegrationServiceEnvironment or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - 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] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] + 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._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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_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() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore def _update_initial( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: Union[_models.IntegrationServiceEnvironment, IO], **kwargs: Any - ) -> "_models.IntegrationServiceEnvironment": - cls = kwargs.pop('cls', None) # type: ClsType["_models.IntegrationServiceEnvironment"] + ) -> _models.IntegrationServiceEnvironment: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(integration_service_environment, 'IntegrationServiceEnvironment') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] - request = build_update_request_initial( - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(integration_service_environment, (IO, bytes)): + _content = integration_service_environment + else: + _json = self._serialize.body(integration_service_environment, "IntegrationServiceEnvironment") + + request = build_update_request( resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._update_initial.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_response) + deserialized = self._deserialize("IntegrationServiceEnvironment", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + _update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + + @overload + def begin_update( + self, + resource_group: str, + integration_service_environment_name: str, + integration_service_environment: _models.IntegrationServiceEnvironment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IntegrationServiceEnvironment]: + """Updates an integration service environment. + + :param resource_group: The resource group. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param integration_service_environment: The integration service environment. Required. + :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IntegrationServiceEnvironment or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group: str, + integration_service_environment_name: str, + integration_service_environment: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IntegrationServiceEnvironment]: + """Updates an integration service environment. + :param resource_group: The resource group. Required. + :type resource_group: str + :param integration_service_environment_name: The integration service environment name. + Required. + :type integration_service_environment_name: str + :param integration_service_environment: The integration service environment. Required. + :type integration_service_environment: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either IntegrationServiceEnvironment or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def begin_update( self, resource_group: str, integration_service_environment_name: str, - integration_service_environment: "_models.IntegrationServiceEnvironment", + integration_service_environment: Union[_models.IntegrationServiceEnvironment, IO], **kwargs: Any - ) -> LROPoller["_models.IntegrationServiceEnvironment"]: + ) -> LROPoller[_models.IntegrationServiceEnvironment]: """Updates an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str - :param integration_service_environment: The integration service environment. + :param integration_service_environment: The integration service environment. Is either a model + type or a IO type. Required. :type integration_service_environment: ~azure.mgmt.logic.models.IntegrationServiceEnvironment + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -747,93 +905,100 @@ def begin_update( :return: An instance of LROPoller that returns either IntegrationServiceEnvironment or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.logic.models.IntegrationServiceEnvironment] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - 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] + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.IntegrationServiceEnvironment] + 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._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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('IntegrationServiceEnvironment', pipeline_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() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore + begin_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any ) -> None: """Deletes an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -844,51 +1009,54 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}"} # type: ignore @distributed_trace def restart( # pylint: disable=inconsistent-return-statements - self, - resource_group: str, - integration_service_environment_name: str, - **kwargs: Any + self, resource_group: str, integration_service_environment_name: str, **kwargs: Any ) -> None: """Restarts an integration service environment. - :param resource_group: The resource group. + :param resource_group: The resource group. Required. :type resource_group: str :param integration_service_environment_name: The integration service environment name. + Required. :type integration_service_environment_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_restart_request( - subscription_id=self._config.subscription_id, resource_group=resource_group, integration_service_environment_name=integration_service_environment_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.restart.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -899,5 +1067,4 @@ def restart( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - restart.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart"} # type: ignore - + restart.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Logic/integrationServiceEnvironments/{integrationServiceEnvironmentName}/restart"} # type: ignore 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..8aeebec8f57f 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 @@ -7,109 +7,116 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request( - **kwargs: Any -) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str - accept = "application/json" +def build_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-05-01")) # type: str + accept = _headers.pop("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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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"]: + def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: """Lists all of the available Logic REST API operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Operation or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.Operation] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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'], + 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, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -123,10 +130,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -137,8 +142,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.Logic/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.Logic/operations"} # type: ignore 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..f7dd32510333 --- /dev/null +++ b/sdk/logic/azure-mgmt-logic/azure/mgmt/logic/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# 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..52dc387cc20f 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 @@ -7,231 +7,227 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, run_name: str, action_name: str, subscription_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}/actions/{actionName}/repetitions") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, repetition_name: str, + subscription_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}/actions/{actionName}/repetitions/{repetitionName}") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), - "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), + "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_list_expression_traces_request( - subscription_id: str, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, repetition_name: str, + subscription_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}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), - "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), + "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowRunActionRepetitionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> Iterable["_models.WorkflowRunActionRepetitionDefinitionCollection"]: + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> Iterable["_models.WorkflowRunActionRepetitionDefinition"]: """Get all of a workflow run action repetitions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowRunActionRepetitionDefinitionCollection or - the result of cls(response) + :return: An iterator like instance of either WorkflowRunActionRepetitionDefinition or the + result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinitionCollection] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -245,10 +241,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -259,11 +253,9 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions"} # type: ignore @distributed_trace def get( @@ -274,51 +266,57 @@ 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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRunActionRepetitionDefinition, or the result of cls(response) + :return: WorkflowRunActionRepetitionDefinition or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinition] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -326,15 +324,14 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRunActionRepetitionDefinition', pipeline_response) + deserialized = self._deserialize("WorkflowRunActionRepetitionDefinition", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}"} # type: ignore @distributed_trace def list_expression_traces( @@ -345,61 +342,64 @@ def list_expression_traces( action_name: str, repetition_name: str, **kwargs: Any - ) -> Iterable["_models.ExpressionTraces"]: + ) -> Iterable["_models.ExpressionRoot"]: """Lists a workflow run expression trace. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressionTraces or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ExpressionTraces] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ExpressionRoot or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ExpressionRoot] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_expression_traces_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_expression_traces.metadata['url'], + 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: - - request = build_list_expression_traces_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - repetition_name=repetition_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -413,10 +413,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -427,8 +425,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_expression_traces.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces"} # type: ignore + list_expression_traces.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/listExpressionTraces"} # type: ignore 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..4add6f60fe4e 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 @@ -7,131 +7,135 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, repetition_name: str, + subscription_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}/actions/{actionName}/repetitions/{repetitionName}/requestHistories") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), - "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), + "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, repetition_name: str, request_history_name: str, + subscription_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}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), - "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, 'str'), - "requestHistoryName": _SERIALIZER.url("request_history_name", request_history_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), + "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, "str"), + "requestHistoryName": _SERIALIZER.url("request_history_name", request_history_name, "str"), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowRunActionRepetitionsRequestHistoriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,62 +146,64 @@ def list( action_name: str, repetition_name: str, **kwargs: Any - ) -> Iterable["_models.RequestHistoryListResult"]: + ) -> Iterable["_models.RequestHistory"]: """List a workflow run repetition request history. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RequestHistoryListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.RequestHistoryListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either RequestHistory or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.RequestHistory] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - repetition_name=repetition_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -211,10 +217,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -225,11 +229,9 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories"} # type: ignore @distributed_trace def get( @@ -241,54 +243,60 @@ 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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str - :param request_history_name: The request history name. + :param request_history_name: The request history name. Required. :type request_history_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RequestHistory, or the result of cls(response) + :return: RequestHistory or the result of cls(response) :rtype: ~azure.mgmt.logic.models.RequestHistory - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistory"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.RequestHistory] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, request_history_name=request_history_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -296,12 +304,11 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('RequestHistory', pipeline_response) + deserialized = self._deserialize("RequestHistory", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/repetitions/{repetitionName}/requestHistories/{requestHistoryName}"} # type: ignore 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..4702644e8192 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 @@ -7,188 +7,185 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, run_name: str, action_name: str, subscription_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}/actions/{actionName}/requestHistories") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, request_history_name: str, + subscription_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}/actions/{actionName}/requestHistories/{requestHistoryName}") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), - "requestHistoryName": _SERIALIZER.url("request_history_name", request_history_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), + "requestHistoryName": _SERIALIZER.url("request_history_name", request_history_name, "str"), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowRunActionRequestHistoriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> Iterable["_models.RequestHistoryListResult"]: + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> Iterable["_models.RequestHistory"]: """List a workflow run request history. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either RequestHistoryListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.RequestHistoryListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either RequestHistory or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.RequestHistory] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -202,10 +199,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -216,11 +211,9 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories"} # type: ignore @distributed_trace def get( @@ -231,51 +224,57 @@ 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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param request_history_name: The request history name. + :param request_history_name: The request history name. Required. :type request_history_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: RequestHistory, or the result of cls(response) + :return: RequestHistory or the result of cls(response) :rtype: ~azure.mgmt.logic.models.RequestHistory - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestHistory"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.RequestHistory] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, request_history_name=request_history_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -283,12 +282,11 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('RequestHistory', pipeline_response) + deserialized = self._deserialize("RequestHistory", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/requestHistories/{requestHistoryName}"} # type: ignore 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..3ceaee88e223 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 @@ -7,189 +7,187 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, run_name: str, action_name: str, subscription_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}/actions/{actionName}/scopeRepetitions") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, repetition_name: str, + subscription_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}/actions/{actionName}/scopeRepetitions/{repetitionName}") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), - "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), + "repetitionName": _SERIALIZER.url("repetition_name", repetition_name, "str"), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowRunActionScopeRepetitionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> Iterable["_models.WorkflowRunActionRepetitionDefinitionCollection"]: + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> Iterable["_models.WorkflowRunActionRepetitionDefinition"]: """List the workflow run action scoped repetitions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowRunActionRepetitionDefinitionCollection or - the result of cls(response) + :return: An iterator like instance of either WorkflowRunActionRepetitionDefinition or the + result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinitionCollection] - :raises: ~azure.core.exceptions.HttpResponseError + ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -203,10 +201,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -217,11 +213,9 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions"} # type: ignore @distributed_trace def get( @@ -232,51 +226,57 @@ 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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str - :param repetition_name: The workflow repetition. + :param repetition_name: The workflow repetition. Required. :type repetition_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRunActionRepetitionDefinition, or the result of cls(response) + :return: WorkflowRunActionRepetitionDefinition or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRunActionRepetitionDefinition - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunActionRepetitionDefinition"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRunActionRepetitionDefinition] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, repetition_name=repetition_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -284,12 +284,11 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRunActionRepetitionDefinition', pipeline_response) + deserialized = self._deserialize("WorkflowRunActionRepetitionDefinition", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions/{repetitionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/scopeRepetitions/{repetitionName}"} # type: ignore 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..c4061468f0a8 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 @@ -7,170 +7,162 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, workflow_name: str, run_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, run_name: str, action_name: str, subscription_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}/actions/{actionName}") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_list_expression_traces_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, run_name: str, action_name: str, subscription_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}/actions/{actionName}/listExpressionTraces") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "actionName": _SERIALIZER.url("action_name", action_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "actionName": _SERIALIZER.url("action_name", action_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowRunActionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,14 +173,14 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowRunActionListResult"]: + ) -> Iterable["_models.WorkflowRunAction"]: """Gets a list of workflow run actions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -196,48 +188,50 @@ def list( Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowRunActionListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunActionListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either WorkflowRunAction or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunAction] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -251,10 +245,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -265,62 +257,61 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> "_models.WorkflowRunAction": + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> _models.WorkflowRunAction: """Gets a workflow run action. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRunAction, or the result of cls(response) + :return: WorkflowRunAction or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRunAction - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRunAction"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRunAction] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -328,75 +319,73 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRunAction', pipeline_response) + deserialized = self._deserialize("WorkflowRunAction", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}"} # type: ignore @distributed_trace def list_expression_traces( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - action_name: str, - **kwargs: Any - ) -> Iterable["_models.ExpressionTraces"]: + self, resource_group_name: str, workflow_name: str, run_name: str, action_name: str, **kwargs: Any + ) -> Iterable["_models.ExpressionRoot"]: """Lists a workflow run expression trace. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param action_name: The workflow action name. + :param action_name: The workflow action name. Required. :type action_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ExpressionTraces or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ExpressionTraces] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either ExpressionRoot or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.ExpressionRoot] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_expression_traces_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, action_name=action_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_expression_traces.metadata['url'], + 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: - - request = build_list_expression_traces_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - run_name=run_name, - action_name=action_name, - api_version=api_version, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -410,10 +399,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -424,8 +411,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_expression_traces.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/listExpressionTraces"} # type: ignore + list_expression_traces.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions/{actionName}/listExpressionTraces"} # type: ignore 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..7e123767396b 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 @@ -8,134 +8,135 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_get_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - run_name: str, - operation_id: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, run_name: str, operation_id: str, subscription_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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), - "operationId": _SERIALIZER.url("operation_id", operation_id, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowRunOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - operation_id: str, - **kwargs: Any - ) -> "_models.WorkflowRun": + self, resource_group_name: str, workflow_name: str, run_name: str, operation_id: str, **kwargs: Any + ) -> _models.WorkflowRun: """Gets an operation for a run. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str - :param operation_id: The workflow operation id. + :param operation_id: The workflow operation id. Required. :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRun, or the result of cls(response) + :return: WorkflowRun or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRun - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRun"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRun] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, operation_id=operation_id, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -143,12 +144,11 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRun', pipeline_response) + deserialized = self._deserialize("WorkflowRun", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/operations/{operationId}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/operations/{operationId}"} # type: ignore 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..f87d203fb4c3 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 @@ -7,164 +7,158 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, workflow_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - run_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, run_name: str, subscription_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}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_cancel_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - run_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, run_name: str, subscription_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}/cancel") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "runName": _SERIALIZER.url("run_name", run_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "runName": _SERIALIZER.url("run_name", run_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowRunsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,12 +168,12 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowRunListResult"]: + ) -> Iterable["_models.WorkflowRun"]: """Gets a list of workflow runs. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -187,46 +181,49 @@ def list( StartTime, and ClientTrackingId. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowRunListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRunListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either WorkflowRun or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowRun] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -240,10 +237,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -254,58 +249,56 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs"} # type: ignore @distributed_trace - def get( - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - **kwargs: Any - ) -> "_models.WorkflowRun": + def get(self, resource_group_name: str, workflow_name: str, run_name: str, **kwargs: Any) -> _models.WorkflowRun: """Gets a workflow run. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowRun, or the result of cls(response) + :return: WorkflowRun or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowRun - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowRun"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowRun] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -313,62 +306,63 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowRun', pipeline_response) + deserialized = self._deserialize("WorkflowRun", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}"} # type: ignore @distributed_trace def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - run_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, run_name: str, **kwargs: Any ) -> None: """Cancels a workflow run. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param run_name: The workflow run name. + :param run_name: The workflow run name. Required. :type run_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_cancel_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, run_name=run_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.cancel.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -379,5 +373,4 @@ def cancel( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - cancel.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel"} # type: ignore - + cancel.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/cancel"} # type: ignore 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..be6c41349c5e 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 @@ -7,170 +7,172 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, workflow_name: str, trigger_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, resource_group_name: str, workflow_name: str, trigger_name: str, history_name: str, + subscription_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}/triggers/{triggerName}/histories/{historyName}") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), - "historyName": _SERIALIZER.url("history_name", history_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), + "historyName": _SERIALIZER.url("history_name", history_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_resubmit_request( - subscription_id: str, resource_group_name: str, workflow_name: str, trigger_name: str, history_name: str, + subscription_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}/triggers/{triggerName}/histories/{historyName}/resubmit") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), - "historyName": _SERIALIZER.url("history_name", history_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), + "historyName": _SERIALIZER.url("history_name", history_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowTriggerHistoriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,14 +183,14 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowTriggerHistoryListResult"]: + ) -> Iterable["_models.WorkflowTriggerHistory"]: """Gets a list of workflow trigger histories. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -196,48 +198,51 @@ def list( StartTime, and ClientTrackingId. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowTriggerHistoryListResult or the result of + :return: An iterator like instance of either WorkflowTriggerHistory or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowTriggerHistoryListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowTriggerHistory] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - trigger_name=trigger_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -251,10 +256,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -265,63 +268,62 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - history_name: str, - **kwargs: Any - ) -> "_models.WorkflowTriggerHistory": + self, resource_group_name: str, workflow_name: str, trigger_name: str, history_name: str, **kwargs: Any + ) -> _models.WorkflowTriggerHistory: """Gets a workflow trigger history. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :param history_name: The workflow trigger history name. Corresponds to the run name for - triggers that resulted in a run. + triggers that resulted in a run. Required. :type history_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerHistory, or the result of cls(response) + :return: WorkflowTriggerHistory or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerHistory - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerHistory"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerHistory] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, history_name=history_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -329,67 +331,67 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerHistory', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerHistory", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}"} # type: ignore @distributed_trace def resubmit( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - history_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, trigger_name: str, history_name: str, **kwargs: Any ) -> None: """Resubmits a workflow run based on the trigger history. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :param history_name: The workflow trigger history name. Corresponds to the run name for - triggers that resulted in a run. + triggers that resulted in a run. Required. :type history_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_resubmit_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, history_name=history_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.resubmit.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [202]: @@ -400,5 +402,4 @@ def resubmit( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - resubmit.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit"} # type: ignore - + resubmit.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit"} # type: ignore 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..ec9375384c2f 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 @@ -6,326 +6,290 @@ # 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 - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, resource_group_name: str, workflow_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, trigger_name: str, subscription_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}/triggers/{triggerName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_reset_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, trigger_name: str, subscription_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}/triggers/{triggerName}/reset") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_run_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, trigger_name: str, subscription_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}/triggers/{triggerName}/run") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_get_schema_json_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, trigger_name: str, subscription_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}/triggers/{triggerName}/schemas/json") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_set_state_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, workflow_name: str, trigger_name: str, subscription_id: str, **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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_list_callback_url_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, trigger_name: str, subscription_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}/triggers/{triggerName}/listCallbackUrl") # pylint: disable=line-too-long + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowTriggersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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,58 +299,61 @@ def list( top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.WorkflowTriggerListResult"]: + ) -> Iterable["_models.WorkflowTrigger"]: """Gets a list of workflow triggers. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int :param filter: The filter to apply on the operation. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowTriggerListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowTriggerListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either WorkflowTrigger or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowTrigger] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -400,10 +367,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -414,58 +379,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any - ) -> "_models.WorkflowTrigger": + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any + ) -> _models.WorkflowTrigger: """Gets a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTrigger, or the result of cls(response) + :return: WorkflowTrigger or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTrigger - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTrigger"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTrigger] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -473,62 +438,63 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTrigger', pipeline_response) + deserialized = self._deserialize("WorkflowTrigger", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}"} # type: ignore @distributed_trace def reset( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any ) -> None: """Resets a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_reset_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.reset.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -539,55 +505,56 @@ def reset( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - reset.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/reset"} # type: ignore - + reset.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/reset"} # type: ignore @distributed_trace def run( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any ) -> None: """Runs a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_run_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.run.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -598,55 +565,56 @@ def run( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - run.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run"} # type: ignore - + run.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run"} # type: ignore @distributed_trace def get_schema_json( - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any - ) -> "_models.JsonSchema": + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any + ) -> _models.JsonSchema: """Get the trigger schema as JSON. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: JsonSchema, or the result of cls(response) + :return: JsonSchema or the result of cls(response) :rtype: ~azure.mgmt.logic.models.JsonSchema - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JsonSchema"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.JsonSchema] - request = build_get_schema_json_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get_schema_json.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -654,15 +622,74 @@ def get_schema_json( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('JsonSchema', pipeline_response) + deserialized = self._deserialize("JsonSchema", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_schema_json.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/schemas/json"} # type: ignore + get_schema_json.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/schemas/json"} # type: ignore + @overload + def set_state( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + set_state: _models.SetTriggerStateActionDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets the state of a workflow trigger. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param trigger_name: The workflow trigger name. Required. + :type trigger_name: str + :param set_state: The workflow trigger state. Required. + :type set_state: ~azure.mgmt.logic.models.SetTriggerStateActionDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def set_state( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + trigger_name: str, + set_state: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets the state of a workflow trigger. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param trigger_name: The workflow trigger name. Required. + :type trigger_name: str + :param set_state: The workflow trigger state. Required. + :type set_state: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def set_state( # pylint: disable=inconsistent-return-statements @@ -670,53 +697,70 @@ def set_state( # pylint: disable=inconsistent-return-statements resource_group_name: str, workflow_name: str, trigger_name: str, - set_state: "_models.SetTriggerStateActionDefinition", + set_state: Union[_models.SetTriggerStateActionDefinition, IO], **kwargs: Any ) -> None: """Sets the state of a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str - :param set_state: The workflow trigger state. - :type set_state: ~azure.mgmt.logic.models.SetTriggerStateActionDefinition + :param set_state: The workflow trigger state. Is either a model type or a IO type. Required. + :type set_state: ~azure.mgmt.logic.models.SetTriggerStateActionDefinition or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(set_state, 'SetTriggerStateActionDefinition') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(set_state, (IO, bytes)): + _content = set_state + else: + _json = self._serialize.body(set_state, "SetTriggerStateActionDefinition") request = build_set_state_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.set_state.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -727,55 +771,56 @@ def set_state( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - set_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/setState"} # type: ignore - + set_state.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/setState"} # type: ignore @distributed_trace def list_callback_url( - self, - resource_group_name: str, - workflow_name: str, - trigger_name: str, - **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + self, resource_group_name: str, workflow_name: str, trigger_name: str, **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: """Get the callback URL for a workflow trigger. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - request = build_list_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_callback_url.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -783,12 +828,11 @@ def list_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl"} # type: ignore - + list_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl"} # type: ignore 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..88bc05e2b56a 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 @@ -6,155 +6,238 @@ # 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, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_callback_url_request( - subscription_id: str, resource_group_name: str, workflow_name: str, version_id: str, trigger_name: str, - *, - json: JSONType = None, - content: Any = None, + subscription_id: str, **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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "versionId": _SERIALIZER.url("version_id", version_id, 'str'), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "versionId": _SERIALIZER.url("version_id", version_id, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - 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. - - :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. + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowVersionTriggersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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 + @overload def list_callback_url( self, resource_group_name: str, workflow_name: str, version_id: str, trigger_name: str, - parameters: Optional["_models.GetCallbackUrlParameters"] = None, + parameters: Optional[_models.GetCallbackUrlParameters] = None, + *, + content_type: str = "application/json", **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. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param version_id: The workflow versionId. + :param version_id: The workflow versionId. Required. :type version_id: str - :param trigger_name: The workflow trigger name. + :param trigger_name: The workflow trigger name. Required. :type trigger_name: str :param parameters: The callback URL parameters. Default value is None. :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + version_id: str, + trigger_name: str, + parameters: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the callback url for a trigger of a workflow version. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param version_id: The workflow versionId. Required. + :type version_id: str + :param trigger_name: The workflow trigger name. Required. + :type trigger_name: str + :param parameters: The callback URL parameters. Default value is None. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + version_id: str, + trigger_name: str, + parameters: Optional[Union[_models.GetCallbackUrlParameters, IO]] = None, + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the callback url for a trigger of a workflow version. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param version_id: The workflow versionId. Required. + :type version_id: str + :param trigger_name: The workflow trigger name. Required. + :type trigger_name: str + :param parameters: The callback URL parameters. Is either a model type or a IO type. Default + value is None. + :type parameters: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - if parameters is not None: - _json = self._serialize.body(parameters, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, bytes)): + _content = parameters else: - _json = None + if parameters is not None: + _json = self._serialize.body(parameters, "GetCallbackUrlParameters") + else: + _json = None request = build_list_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, version_id=version_id, trigger_name=trigger_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -162,12 +245,11 @@ def list_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl"} # type: ignore - + list_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl"} # type: ignore 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..fb1795cb8827 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 @@ -7,179 +7,174 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - *, - top: Optional[int] = None, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_id: str, *, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - version_id: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, version_id: str, subscription_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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), - "versionId": _SERIALIZER.url("version_id", version_id, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), + "versionId": _SERIALIZER.url("version_id", version_id, "str"), } _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') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **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. - - :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. + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - resource_group_name: str, - workflow_name: str, - top: Optional[int] = None, - **kwargs: Any - ) -> Iterable["_models.WorkflowVersionListResult"]: + self, resource_group_name: str, workflow_name: str, top: Optional[int] = None, **kwargs: Any + ) -> Iterable["_models.WorkflowVersion"]: """Gets a list of workflow versions. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowVersionListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowVersionListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either WorkflowVersion or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowVersion] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, - template_url=self.list.metadata['url'], + 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( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - workflow_name=workflow_name, - api_version=api_version, - top=top, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -193,10 +188,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -207,58 +200,58 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - workflow_name: str, - version_id: str, - **kwargs: Any - ) -> "_models.WorkflowVersion": + self, resource_group_name: str, workflow_name: str, version_id: str, **kwargs: Any + ) -> _models.WorkflowVersion: """Gets a workflow version. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param version_id: The workflow versionId. + :param version_id: The workflow versionId. Required. :type version_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowVersion, or the result of cls(response) + :return: WorkflowVersion or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowVersion - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowVersion"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowVersion] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, version_id=version_id, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -266,12 +259,11 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowVersion', pipeline_response) + deserialized = self._deserialize("WorkflowVersion", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}"} # type: ignore 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..16441fdc8cc8 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,663 +6,559 @@ # 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 msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +import sys +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse 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 .._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') -JSONType = Any + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False + def build_list_by_subscription_request( - subscription_id: str, - *, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any + subscription_id: str, *, top: Optional[int] = None, 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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_list_by_resource_group_request( - subscription_id: str, resource_group_name: str, + subscription_id: str, *, top: Optional[int] = None, 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - **kwargs: Any -) -> HttpRequest: - api_version = kwargs.pop('api_version', "2019-05-01") # type: str +def build_get_request(resource_group_name: str, workflow_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = 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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_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}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_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}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_disable_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_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}/disable") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_enable_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_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}/enable") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_generate_upgraded_definition_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/generateUpgradedDefinition", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_list_callback_url_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listCallbackUrl", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_list_swagger_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_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}/listSwagger") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listSwagger", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_move_request_initial( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any +def build_move_request( + resource_group_name: str, workflow_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_regenerate_access_key_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_validate_by_resource_group_request( - subscription_id: str, - resource_group_name: str, - workflow_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, workflow_name: str, subscription_id: str, **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 + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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, - json=json, - content=content, - **kwargs - ) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_validate_by_location_request( - subscription_id: str, - resource_group_name: str, - location: str, - workflow_name: str, - *, - json: JSONType = None, - content: Any = None, - **kwargs: Any + resource_group_name: str, location: str, workflow_name: str, subscription_id: str, **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 + _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 = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), - "location": _SERIALIZER.url("location", location, 'str'), - "workflowName": _SERIALIZER.url("workflow_name", workflow_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "workflowName": _SERIALIZER.url("workflow_name", workflow_name, "str"), } _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') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - 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. - - :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. + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +class WorkflowsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + 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( - self, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.WorkflowListResult"]: + self, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.Workflow"]: """Gets a list of workflows by subscription. :param top: The number of items to be included in the result. Default value is None. @@ -671,41 +567,47 @@ def list_by_subscription( Trigger, and ReferencedResourceId. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Workflow or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.Workflow] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_subscription_request( subscription_id=self._config.subscription_id, - api_version=api_version, top=top, filter=filter, - template_url=self.list_by_subscription.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -719,10 +621,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -733,23 +633,17 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/workflows"} # type: ignore + list_by_subscription.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/workflows"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> Iterable["_models.WorkflowListResult"]: + self, resource_group_name: str, top: Optional[int] = None, filter: Optional[str] = None, **kwargs: Any + ) -> Iterable["_models.Workflow"]: """Gets a list of workflows by resource group. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str :param top: The number of items to be included in the result. Default value is None. :type top: int @@ -757,43 +651,48 @@ def list_by_resource_group( Trigger, and ReferencedResourceId. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WorkflowListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.WorkflowListResult] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of either Workflow or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.logic.models.Workflow] + :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", self._config.api_version)) # 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 + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, - api_version=api_version, + subscription_id=self._config.subscription_id, top=top, filter=filter, - template_url=self.list_by_resource_group.metadata['url'], + api_version=api_version, + 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: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - top=top, - filter=filter, - template_url=next_link, - ) + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_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 @@ -807,10 +706,8 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -821,54 +718,53 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows"} # type: ignore @distributed_trace - def get( - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any - ) -> "_models.Workflow": + def get(self, resource_group_name: str, workflow_name: str, **kwargs: Any) -> _models.Workflow: """Gets a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workflow, or the result of cls(response) + :return: Workflow or the result of cls(response) :rtype: ~azure.mgmt.logic.models.Workflow - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Workflow] - request = build_get_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -876,65 +772,131 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('Workflow', pipeline_response) + deserialized = self._deserialize("Workflow", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore - - @distributed_trace + @overload def create_or_update( self, resource_group_name: str, workflow_name: str, - workflow: "_models.Workflow", + workflow: _models.Workflow, + *, + content_type: str = "application/json", **kwargs: Any - ) -> "_models.Workflow": + ) -> _models.Workflow: """Creates or updates a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param workflow: The workflow. + :param workflow: The workflow. Required. :type workflow: ~azure.mgmt.logic.models.Workflow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.Workflow + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + workflow_name: str, + workflow: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Workflow: + """Creates or updates a workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param workflow: The workflow. Required. + :type workflow: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workflow or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.Workflow + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, resource_group_name: str, workflow_name: str, workflow: Union[_models.Workflow, IO], **kwargs: Any + ) -> _models.Workflow: + """Creates or updates a workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param workflow: The workflow. Is either a model type or a IO type. Required. + :type workflow: ~azure.mgmt.logic.models.Workflow or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workflow, or the result of cls(response) + :return: Workflow or the result of cls(response) :rtype: ~azure.mgmt.logic.models.Workflow - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Workflow] - _json = self._serialize.body(workflow, 'Workflow') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(workflow, (IO, bytes)): + _content = workflow + else: + _json = self._serialize.body(workflow, "Workflow") request = build_create_or_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.create_or_update.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -943,61 +905,61 @@ def create_or_update( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('Workflow', pipeline_response) + deserialized = self._deserialize("Workflow", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Workflow', pipeline_response) + deserialized = self._deserialize("Workflow", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore @distributed_trace - def update( - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any - ) -> "_models.Workflow": + def update(self, resource_group_name: str, workflow_name: str, **kwargs: Any) -> _models.Workflow: """Updates a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: Workflow, or the result of cls(response) + :return: Workflow or the result of cls(response) :rtype: ~azure.mgmt.logic.models.Workflow - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Workflow"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Workflow] - request = build_update_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.update.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1005,58 +967,60 @@ def update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('Workflow', pipeline_response) + deserialized = self._deserialize("Workflow", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, **kwargs: Any ) -> None: """Deletes a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.delete.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -1067,51 +1031,53 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}"} # type: ignore @distributed_trace def disable( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, **kwargs: Any ) -> None: """Disables a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_disable_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.disable.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1122,51 +1088,53 @@ def disable( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - disable.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable"} # type: ignore - + disable.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/disable"} # type: ignore @distributed_trace def enable( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any + self, resource_group_name: str, workflow_name: str, **kwargs: Any ) -> None: """Enables a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_enable_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.enable.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1177,58 +1145,129 @@ def enable( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - enable.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable"} # type: ignore + enable.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/enable"} # type: ignore + @overload + def generate_upgraded_definition( + self, + resource_group_name: str, + workflow_name: str, + parameters: _models.GenerateUpgradedDefinitionParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + """Generates the upgraded definition for a workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param parameters: Parameters for generating an upgraded definition. Required. + :type parameters: ~azure.mgmt.logic.models.GenerateUpgradedDefinitionParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def generate_upgraded_definition( + self, + resource_group_name: str, + workflow_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> JSON: + """Generates the upgraded definition for a workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param parameters: Parameters for generating an upgraded definition. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def generate_upgraded_definition( self, resource_group_name: str, workflow_name: str, - parameters: "_models.GenerateUpgradedDefinitionParameters", + parameters: Union[_models.GenerateUpgradedDefinitionParameters, IO], **kwargs: Any - ) -> Any: + ) -> JSON: """Generates the upgraded definition for a workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param parameters: Parameters for generating an upgraded definition. - :type parameters: ~azure.mgmt.logic.models.GenerateUpgradedDefinitionParameters + :param parameters: Parameters for generating an upgraded definition. Is either a model type or + a IO type. Required. + :type parameters: ~azure.mgmt.logic.models.GenerateUpgradedDefinitionParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: any, or the result of cls(response) - :rtype: any - :raises: ~azure.core.exceptions.HttpResponseError + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(parameters, 'GenerateUpgradedDefinitionParameters') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[JSON] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "GenerateUpgradedDefinitionParameters") request = build_generate_upgraded_definition_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.generate_upgraded_definition.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1236,65 +1275,136 @@ def generate_upgraded_definition( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - generate_upgraded_definition.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/generateUpgradedDefinition"} # type: ignore + generate_upgraded_definition.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/generateUpgradedDefinition"} # type: ignore + + @overload + def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + list_callback_url: _models.GetCallbackUrlParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the workflow callback Url. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param list_callback_url: Which callback url to list. Required. + :type list_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_callback_url( + self, + resource_group_name: str, + workflow_name: str, + list_callback_url: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.WorkflowTriggerCallbackUrl: + """Get the workflow callback Url. + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param list_callback_url: Which callback url to list. Required. + :type list_callback_url: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkflowTriggerCallbackUrl or the result of cls(response) + :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def list_callback_url( self, resource_group_name: str, workflow_name: str, - list_callback_url: "_models.GetCallbackUrlParameters", + list_callback_url: Union[_models.GetCallbackUrlParameters, IO], **kwargs: Any - ) -> "_models.WorkflowTriggerCallbackUrl": + ) -> _models.WorkflowTriggerCallbackUrl: """Get the workflow callback Url. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param list_callback_url: Which callback url to list. - :type list_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters + :param list_callback_url: Which callback url to list. Is either a model type or a IO type. + Required. + :type list_callback_url: ~azure.mgmt.logic.models.GetCallbackUrlParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkflowTriggerCallbackUrl, or the result of cls(response) + :return: WorkflowTriggerCallbackUrl or the result of cls(response) :rtype: ~azure.mgmt.logic.models.WorkflowTriggerCallbackUrl - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkflowTriggerCallbackUrl"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.WorkflowTriggerCallbackUrl] - _json = self._serialize.body(list_callback_url, 'GetCallbackUrlParameters') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(list_callback_url, (IO, bytes)): + _content = list_callback_url + else: + _json = self._serialize.body(list_callback_url, "GetCallbackUrlParameters") request = build_list_callback_url_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.list_callback_url.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1302,58 +1412,58 @@ def list_callback_url( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('WorkflowTriggerCallbackUrl', pipeline_response) + deserialized = self._deserialize("WorkflowTriggerCallbackUrl", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_callback_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listCallbackUrl"} # type: ignore - + list_callback_url.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listCallbackUrl"} # type: ignore @distributed_trace - def list_swagger( - self, - resource_group_name: str, - workflow_name: str, - **kwargs: Any - ) -> Any: + def list_swagger(self, resource_group_name: str, workflow_name: str, **kwargs: Any) -> JSON: """Gets an OpenAPI definition for the workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: any, or the result of cls(response) - :rtype: any - :raises: ~azure.core.exceptions.HttpResponseError + :return: JSON or the result of cls(response) + :rtype: JSON + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[Any] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[JSON] - request = build_list_swagger_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_swagger.metadata['url'], + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1361,79 +1471,93 @@ def list_swagger( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('object', pipeline_response) + deserialized = self._deserialize("object", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_swagger.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listSwagger"} # type: ignore - + list_swagger.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/listSwagger"} # type: ignore def _move_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - workflow_name: str, - move: "_models.WorkflowReference", - **kwargs: Any + self, resource_group_name: str, workflow_name: str, move: Union[_models.WorkflowReference, IO], **kwargs: Any ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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 {}) - _json = self._serialize.body(move, 'WorkflowReference') + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_move_request_initial( - subscription_id=self._config.subscription_id, + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(move, (IO, bytes)): + _content = move + else: + _json = self._serialize.body(move, "WorkflowReference") + + request = build_move_request( resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self._move_initial.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) - _move_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move"} # type: ignore + _move_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move"} # type: ignore - - @distributed_trace - def begin_move( # pylint: disable=inconsistent-return-statements + @overload + def begin_move( self, resource_group_name: str, workflow_name: str, - move: "_models.WorkflowReference", + move: _models.WorkflowReference, + *, + content_type: str = "application/json", **kwargs: Any ) -> LROPoller[None]: """Moves an existing workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param move: The workflow to move. + :param move: The workflow to move. Required. :type move: ~azure.mgmt.logic.models.WorkflowReference + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1444,97 +1568,234 @@ def begin_move( # pylint: disable=inconsistent-return-statements Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError + :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] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + + @overload + def begin_move( + self, + resource_group_name: str, + workflow_name: str, + move: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Moves an existing workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param move: The workflow to move. Required. + :type move: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_move( + self, resource_group_name: str, workflow_name: str, move: Union[_models.WorkflowReference, IO], **kwargs: Any + ) -> LROPoller[None]: + """Moves an existing workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param move: The workflow to move. Is either a model type or a IO type. Required. + :type move: ~azure.mgmt.logic.models.WorkflowReference or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + 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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - - if polling is True: polling_method = ARMPolling(lro_delay, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling + 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( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_move.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move"} # type: ignore + begin_move.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/move"} # type: ignore - @distributed_trace + @overload 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, + *, + content_type: str = "application/json", **kwargs: Any ) -> None: """Regenerates the callback URL access key for request triggers. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param key_type: The access key type. + :param key_type: The access key type. Required. :type key_type: ~azure.mgmt.logic.models.RegenerateActionParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def regenerate_access_key( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + key_type: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Regenerates the callback URL access key for request triggers. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param key_type: The access key type. Required. + :type key_type: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def regenerate_access_key( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + key_type: Union[_models.RegenerateActionParameter, IO], + **kwargs: Any + ) -> None: + """Regenerates the callback URL access key for request triggers. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param key_type: The access key type. Is either a model type or a IO type. Required. + :type key_type: ~azure.mgmt.logic.models.RegenerateActionParameter or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] - _json = self._serialize.body(key_type, 'RegenerateActionParameter') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(key_type, (IO, bytes)): + _content = key_type + else: + _json = self._serialize.body(key_type, "RegenerateActionParameter") request = build_regenerate_access_key_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.regenerate_access_key.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1545,58 +1806,124 @@ def regenerate_access_key( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - regenerate_access_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey"} # type: ignore + regenerate_access_key.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/regenerateAccessKey"} # type: ignore - - @distributed_trace + @overload def validate_by_resource_group( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, workflow_name: str, - validate: "_models.Workflow", + validate: _models.Workflow, + *, + content_type: str = "application/json", **kwargs: Any ) -> None: """Validates the workflow. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param validate: The workflow. + :param validate: The workflow. Required. :type validate: ~azure.mgmt.logic.models.Workflow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_by_resource_group( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workflow_name: str, + validate: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Validates the workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param validate: The workflow. Required. + :type validate: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def validate_by_resource_group( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, workflow_name: str, validate: Union[_models.Workflow, IO], **kwargs: Any + ) -> None: + """Validates the workflow. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param validate: The workflow. Is either a model type or a IO type. Required. + :type validate: ~azure.mgmt.logic.models.Workflow or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] - _json = self._serialize.body(validate, 'Workflow') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate, (IO, bytes)): + _content = validate + else: + _json = self._serialize.body(validate, "Workflow") request = build_validate_by_resource_group_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.validate_by_resource_group.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1607,8 +1934,67 @@ def validate_by_resource_group( # pylint: disable=inconsistent-return-statement if cls: return cls(pipeline_response, None, {}) - validate_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate"} # type: ignore + validate_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/validate"} # type: ignore + @overload + def validate_by_location( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + location: str, + workflow_name: str, + validate: _models.Workflow, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Validates the workflow definition. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param location: The workflow location. Required. + :type location: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param validate: The workflow. Required. + :type validate: ~azure.mgmt.logic.models.Workflow + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def validate_by_location( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + location: str, + workflow_name: str, + validate: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Validates the workflow definition. + + :param resource_group_name: The resource group name. Required. + :type resource_group_name: str + :param location: The workflow location. Required. + :type location: str + :param workflow_name: The workflow name. Required. + :type workflow_name: str + :param validate: The workflow. Required. + :type validate: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ @distributed_trace def validate_by_location( # pylint: disable=inconsistent-return-statements @@ -1616,53 +2002,70 @@ def validate_by_location( # pylint: disable=inconsistent-return-statements resource_group_name: str, location: str, workflow_name: str, - validate: "_models.Workflow", + validate: Union[_models.Workflow, IO], **kwargs: Any ) -> None: """Validates the workflow definition. - :param resource_group_name: The resource group name. + :param resource_group_name: The resource group name. Required. :type resource_group_name: str - :param location: The workflow location. + :param location: The workflow location. Required. :type location: str - :param workflow_name: The workflow name. + :param workflow_name: The workflow name. Required. :type workflow_name: str - :param validate: The workflow. - :type validate: ~azure.mgmt.logic.models.Workflow + :param validate: The workflow. Is either a model type or a IO type. Required. + :type validate: ~azure.mgmt.logic.models.Workflow or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) + :return: None or the result of cls(response) :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError + :raises ~azure.core.exceptions.HttpResponseError: """ - cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - 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", self._config.api_version)) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] - _json = self._serialize.body(validate, 'Workflow') + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(validate, (IO, bytes)): + _content = validate + else: + _json = self._serialize.body(validate, "Workflow") request = build_validate_by_location_request( - subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, location=location, workflow_name=workflow_name, + subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, - template_url=self.validate_by_location.metadata['url'], + content=_content, + 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 - request, - stream=False, - **kwargs + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs ) + response = pipeline_response.http_response if response.status_code not in [200]: @@ -1673,5 +2076,4 @@ def validate_by_location( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - validate_by_location.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate"} # type: ignore - + validate_by_location.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/locations/{location}/workflows/{workflowName}/validate"} # type: ignore