diff --git a/sdk/automation/azure-mgmt-automation/_meta.json b/sdk/automation/azure-mgmt-automation/_meta.json index 7bf91d868f55..3396f09d4589 100644 --- a/sdk/automation/azure-mgmt-automation/_meta.json +++ b/sdk/automation/azure-mgmt-automation/_meta.json @@ -1,11 +1,11 @@ { - "commit": "23b62d4e4dab07dccda851cfe50f6c6afb705a3b", + "commit": "268735c24abc723606b185d5fe71e443b928179d", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.9.2", + "autorest": "3.9.7", "use": [ - "@autorest/python@6.2.7", - "@autorest/modelerfour@4.24.3" + "@autorest/python@6.7.1", + "@autorest/modelerfour@4.26.2" ], - "autorest_command": "autorest specification/automation/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/automation/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False", "readme": "specification/automation/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py index 04362ae49337..4192a63df8b7 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_automation_client.py @@ -201,7 +201,7 @@ def __init__( **kwargs: Any ) -> None: self._config = AutomationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -321,5 +321,5 @@ def __enter__(self) -> "AutomationClient": self._client.__enter__() return self - def __exit__(self, *exc_details) -> None: + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_serialization.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_serialization.py index 2c170e28dbca..4bae2292227b 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_serialization.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_serialization.py @@ -38,7 +38,22 @@ import re import sys import codecs -from typing import Optional, Union, AnyStr, IO, Mapping +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) try: from urllib import quote # type: ignore @@ -48,12 +63,14 @@ import isodate # type: ignore -from typing import Dict, Any, cast - from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + class RawDeserializer: @@ -277,8 +294,8 @@ class Model(object): _attribute_map: Dict[str, Dict[str, Any]] = {} _validation: Dict[str, Dict[str, Any]] = {} - def __init__(self, **kwargs): - self.additional_properties = {} + def __init__(self, **kwargs: Any) -> None: + self.additional_properties: Dict[str, Any] = {} for k in kwargs: if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -287,25 +304,25 @@ def __init__(self, **kwargs): else: setattr(self, k, kwargs[k]) - def __eq__(self, other): + def __eq__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False - def __ne__(self, other): + def __ne__(self, other: Any) -> bool: """Compare objects by comparing all attributes.""" return not self.__eq__(other) - def __str__(self): + def __str__(self) -> str: return str(self.__dict__) @classmethod - def enable_additional_properties_sending(cls): + def enable_additional_properties_sending(cls) -> None: cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} @classmethod - def is_xml_model(cls): + def is_xml_model(cls) -> bool: try: cls._xml_map # type: ignore except AttributeError: @@ -322,7 +339,7 @@ def _create_xml_node(cls): return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) - def serialize(self, keep_readonly=False, **kwargs): + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: """Return the JSON that would be sent to azure from this model. This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. @@ -336,8 +353,13 @@ def serialize(self, keep_readonly=False, **kwargs): serializer = Serializer(self._infer_class_models()) return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) - def as_dict(self, keep_readonly=True, key_transformer=attribute_transformer, **kwargs): - """Return a dict that can be JSONify using json.dump. + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. Advanced usage might optionally use a callback as parameter: @@ -384,7 +406,7 @@ def _infer_class_models(cls): return client_models @classmethod - def deserialize(cls, data, content_type=None): + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: """Parse a str using the RestAPI syntax and return a model. :param str data: A str using RestAPI structure. JSON by default. @@ -396,7 +418,12 @@ def deserialize(cls, data, content_type=None): return deserializer(cls.__name__, data, content_type=content_type) @classmethod - def from_dict(cls, data, key_extractors=None, content_type=None): + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: """Parse a dict using given key extractor return a model. By default consider key @@ -409,8 +436,8 @@ def from_dict(cls, data, key_extractors=None, content_type=None): :raises: DeserializationError if something went wrong """ deserializer = Deserializer(cls._infer_class_models()) - deserializer.key_extractors = ( - [ + deserializer.key_extractors = ( # type: ignore + [ # type: ignore attribute_key_case_insensitive_extractor, rest_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, @@ -518,7 +545,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes=None): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -534,7 +561,7 @@ def __init__(self, classes=None): "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -602,7 +629,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if xml_desc.get("attr", False): if xml_ns: ET.register_namespace(xml_prefix, xml_ns) - xml_name = "{}{}".format(xml_ns, xml_name) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) serialized.set(xml_name, new_attr) # type: ignore continue if xml_desc.get("text", False): @@ -626,8 +653,7 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized.append(local_node) # type: ignore else: # JSON for k in reversed(keys): # type: ignore - unflattened = {k: new_attr} - new_attr = unflattened + new_attr = {k: new_attr} _new_attr = new_attr _serialized = serialized @@ -636,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs): _serialized.update(_new_attr) # type: ignore _new_attr = _new_attr[k] # type: ignore _serialized = _serialized[k] - except ValueError: - continue + except ValueError as err: + if isinstance(err, SerializationError): + raise except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) @@ -656,8 +683,8 @@ def body(self, data, data_type, **kwargs): """ # Just in case this is a dict - internal_data_type = data_type.strip("[]{}") - internal_data_type = self.dependencies.get(internal_data_type, None) + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) try: is_xml_model_serialization = kwargs["is_xml"] except KeyError: @@ -715,6 +742,8 @@ def query(self, name, data, data_type, **kwargs): :param data: The data to be serialized. :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None @@ -723,10 +752,8 @@ def query(self, name, data, data_type, **kwargs): # 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)) + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) # Not a list, regular serialization output = self.serialize_data(data, data_type, **kwargs) @@ -777,6 +804,8 @@ def serialize_data(self, data, data_type, **kwargs): raise ValueError("No value for given attribute") try: + if data is AzureCoreNull: + return None if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) @@ -863,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): 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'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. :rtype: list, str """ if isinstance(data, str): @@ -875,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): for d in data: try: serialized.append(self.serialize_data(d, iter_type, **kwargs)) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized.append(None) + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + if div: serialized = ["" if s is None else str(s) for s in serialized] serialized = div.join(serialized) @@ -922,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs): for key, value in attr.items(): try: serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) - except ValueError: + except ValueError as err: + if isinstance(err, SerializationError): + raise serialized[self.serialize_unicode(key)] = None if "xml" in serialization_ctxt: @@ -1161,7 +1199,8 @@ def rest_key_extractor(attr, attr_desc, data): working_data = data while "." in key: - dict_keys = _FLATTEN.split(key) + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1242,7 +1281,7 @@ def _extract_name_from_internal_type(internal_type): 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) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) return xml_name @@ -1266,7 +1305,7 @@ def xml_key_extractor(attr, attr_desc, data): # 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) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) # If it's an attribute, that's simple if xml_desc.get("attr", False): @@ -1332,7 +1371,7 @@ class Deserializer(object): 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): + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1352,7 +1391,7 @@ def __init__(self, classes=None): "duration": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } - self.dependencies = dict(classes) if classes else {} + self.dependencies: Dict[str, Type[ModelType]] = 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 @@ -1471,7 +1510,7 @@ def _classify_target(self, target, data): 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. + :param str/dict data: The response data to deserialize. """ if target is None: return None, None @@ -1486,7 +1525,7 @@ def _classify_target(self, target, data): target = target._classify(data, self.dependencies) except AttributeError: pass # Target is not a Model, no classify - return target, target.__class__.__name__ + return target, target.__class__.__name__ # type: ignore def failsafe_deserialize(self, target_obj, data, content_type=None): """Ignores any errors encountered in deserialization, @@ -1496,7 +1535,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): 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/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. """ try: diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_vendor.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_vendor.py index 2bd6526d54d6..f452f3670eb3 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_vendor.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_vendor.py @@ -27,17 +27,6 @@ def _convert_request(request, files=None): return request -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - 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] - template = "/".join(components) - - class AutomationClientMixinABC(ABC): """DO NOT use this class. It is for internal typing use only.""" diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_version.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_version.py index 73aef742777f..e5754a47ce68 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_version.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.1.0b3" +VERSION = "1.0.0b1" diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/_automation_client.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/_automation_client.py index 4a916016e428..2247d9dc9d96 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/_automation_client.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/_automation_client.py @@ -201,7 +201,7 @@ def __init__( **kwargs: Any ) -> None: self._config = AutomationClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -321,5 +321,5 @@ async def __aenter__(self) -> "AutomationClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_activity_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_activity_operations.py index 48d5318457f7..a3a5307cc9d0 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_activity_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_activity_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,10 +30,6 @@ from ...operations._activity_operations import build_get_request, build_list_by_module_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,6 +64,9 @@ async def get( ) -> _models.Activity: """Retrieve the activity in the module identified by module name and activity name. + .. seealso:: + - http://aka.ms/azureautomationsdk/activityoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -93,7 +91,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Activity] = kwargs.pop("cls", None) request = build_get_request( @@ -110,8 +108,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -138,6 +137,9 @@ def list_by_module( ) -> AsyncIterable["_models.Activity"]: """Retrieve a list of activities in the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/activityoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -152,7 +154,7 @@ def list_by_module( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ActivityListResult] = kwargs.pop("cls", None) error_map = { @@ -196,8 +198,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_agent_registration_information_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_agent_registration_information_operations.py index 3615ea66bc8f..817e99ae4efc 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_agent_registration_information_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_agent_registration_information_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from ...operations._agent_registration_information_operations import build_get_request, build_regenerate_key_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,6 +58,9 @@ async def get( ) -> _models.AgentRegistration: """Retrieve the automation agent registration information. + .. seealso:: + - http://aka.ms/azureautomationsdk/agentregistrationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -82,9 +81,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.AgentRegistration] = kwargs.pop("cls", None) request = build_get_request( @@ -99,8 +96,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,6 +131,9 @@ async def regenerate_key( ) -> _models.AgentRegistration: """Regenerate a primary or secondary agent registration key. + .. seealso:: + - http://aka.ms/azureautomationsdk/agentregistrationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -160,6 +161,9 @@ async def regenerate_key( ) -> _models.AgentRegistration: """Regenerate a primary or secondary agent registration key. + .. seealso:: + - http://aka.ms/azureautomationsdk/agentregistrationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -185,12 +189,15 @@ async def regenerate_key( ) -> _models.AgentRegistration: """Regenerate a primary or secondary agent registration key. + .. seealso:: + - http://aka.ms/azureautomationsdk/agentregistrationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str - :param parameters: The name of the agent registration key to be regenerated. Is either a model - type or a IO type. Required. + :param parameters: The name of the agent registration key to be regenerated. Is either a + AgentRegistrationRegenerateKeyParameter type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.AgentRegistrationRegenerateKeyParameter or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -211,16 +218,14 @@ async def regenerate_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentRegistration] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "AgentRegistrationRegenerateKeyParameter") @@ -240,8 +245,9 @@ async def regenerate_key( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_automation_account_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_automation_account_operations.py index d6ddc08bfb00..8ccad5a5a0b2 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_automation_account_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_automation_account_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,6 +73,9 @@ async def update( ) -> _models.AutomationAccount: """Update an automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -104,6 +103,9 @@ async def update( ) -> _models.AutomationAccount: """Update an automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -129,12 +131,15 @@ async def update( ) -> _models.AutomationAccount: """Update an automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str - :param parameters: Parameters supplied to the update automation account. Is either a model type - or a IO type. Required. + :param parameters: Parameters supplied to the update automation account. Is either a + AutomationAccountUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.AutomationAccountUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -155,14 +160,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AutomationAccount] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "AutomationAccountUpdateParameters") @@ -182,8 +187,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -216,6 +222,9 @@ async def create_or_update( ) -> _models.AutomationAccount: """Create or update automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -243,6 +252,9 @@ async def create_or_update( ) -> _models.AutomationAccount: """Create or update automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -268,12 +280,15 @@ async def create_or_update( ) -> _models.AutomationAccount: """Create or update automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param parameters: Parameters supplied to the create or update automation account. Is either a - model type or a IO type. Required. + AutomationAccountCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.AutomationAccountCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -294,14 +309,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AutomationAccount] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "AutomationAccountCreateOrUpdateParameters") @@ -321,8 +336,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -353,6 +369,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete an automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -373,7 +392,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -388,8 +407,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -412,6 +432,9 @@ async def get( ) -> _models.AutomationAccount: """Get information about an Automation Account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -432,7 +455,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.AutomationAccount] = kwargs.pop("cls", None) request = build_get_request( @@ -447,8 +470,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -475,6 +499,9 @@ def list_by_resource_group( ) -> AsyncIterable["_models.AutomationAccount"]: """Retrieve a list of accounts within a given resource group. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -486,7 +513,7 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.AutomationAccountListResult] = kwargs.pop("cls", None) error_map = { @@ -528,8 +555,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -561,7 +589,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.AutomationAccount"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.AutomationAccountListResult] = kwargs.pop("cls", None) error_map = { @@ -602,8 +630,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_automation_client_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_automation_client_operations.py index ef0c01c9f234..4dc29190b2db 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_automation_client_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_automation_client_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -29,10 +29,6 @@ from ...operations._automation_client_operations import build_convert_graph_runbook_content_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -106,8 +102,8 @@ async def convert_graph_runbook_content( :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str - :param parameters: Input data describing the graphical runbook. Is either a model type or a IO - type. Required. + :param parameters: Input data describing the graphical runbook. Is either a + GraphicalRunbookContent type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.GraphicalRunbookContent or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -128,14 +124,14 @@ async def convert_graph_runbook_content( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GraphicalRunbookContent] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "GraphicalRunbookContent") @@ -155,8 +151,9 @@ async def convert_graph_runbook_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_certificate_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_certificate_operations.py index 5379dc31ca25..40e3f62804da 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_certificate_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_certificate_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +66,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -92,7 +91,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -108,8 +107,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,6 +132,9 @@ async def get( ) -> _models.Certificate: """Retrieve the certificate identified by certificate name. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -154,7 +157,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Certificate] = kwargs.pop("cls", None) request = build_get_request( @@ -170,8 +173,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,6 +209,9 @@ async def create_or_update( ) -> _models.Certificate: """Create a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -237,6 +244,9 @@ async def create_or_update( ) -> _models.Certificate: """Create a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -267,6 +277,9 @@ async def create_or_update( ) -> _models.Certificate: """Create a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -275,7 +288,7 @@ async def create_or_update( Required. :type certificate_name: str :param parameters: The parameters supplied to the create or update certificate operation. Is - either a model type or a IO type. Required. + either a CertificateCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.CertificateCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -296,14 +309,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Certificate] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CertificateCreateOrUpdateParameters") @@ -324,8 +337,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -363,6 +377,9 @@ async def update( ) -> _models.Certificate: """Update a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -393,6 +410,9 @@ async def update( ) -> _models.Certificate: """Update a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -421,6 +441,9 @@ async def update( ) -> _models.Certificate: """Update a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -428,7 +451,7 @@ async def update( :param certificate_name: The parameters supplied to the update certificate operation. Required. :type certificate_name: str :param parameters: The parameters supplied to the update certificate operation. Is either a - model type or a IO type. Required. + CertificateUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.CertificateUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -449,14 +472,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Certificate] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CertificateUpdateParameters") @@ -477,8 +500,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -505,6 +529,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Certificate"]: """Retrieve a list of certificates. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -517,7 +544,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.CertificateListResult] = kwargs.pop("cls", None) error_map = { @@ -560,8 +587,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_connection_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_connection_operations.py index 2a8289659e0f..faf24f5b195a 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_connection_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_connection_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +66,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -92,7 +91,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -108,8 +107,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,6 +132,9 @@ async def get( ) -> _models.Connection: """Retrieve the connection identified by connection name. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -154,7 +157,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Connection] = kwargs.pop("cls", None) request = build_get_request( @@ -170,8 +173,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,6 +209,9 @@ async def create_or_update( ) -> _models.Connection: """Create or update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -237,6 +244,9 @@ async def create_or_update( ) -> _models.Connection: """Create or update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -267,6 +277,9 @@ async def create_or_update( ) -> _models.Connection: """Create or update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -275,7 +288,7 @@ async def create_or_update( Required. :type connection_name: str :param parameters: The parameters supplied to the create or update connection operation. Is - either a model type or a IO type. Required. + either a ConnectionCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ConnectionCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -296,14 +309,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Connection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ConnectionCreateOrUpdateParameters") @@ -324,8 +337,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -363,6 +377,9 @@ async def update( ) -> _models.Connection: """Update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -393,6 +410,9 @@ async def update( ) -> _models.Connection: """Update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -421,6 +441,9 @@ async def update( ) -> _models.Connection: """Update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -428,7 +451,7 @@ async def update( :param connection_name: The parameters supplied to the update a connection operation. Required. :type connection_name: str :param parameters: The parameters supplied to the update a connection operation. Is either a - model type or a IO type. Required. + ConnectionUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ConnectionUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -449,14 +472,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Connection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ConnectionUpdateParameters") @@ -477,8 +500,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -505,6 +529,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Connection"]: """Retrieve a list of connections. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -517,7 +544,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ConnectionListResult] = kwargs.pop("cls", None) error_map = { @@ -560,8 +587,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_connection_type_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_connection_type_operations.py index e51ac98d5238..12bf1e9689e1 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_connection_type_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_connection_type_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,6 +65,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the connection type. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -91,7 +90,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -107,8 +106,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -131,6 +131,9 @@ async def get( ) -> _models.ConnectionType: """Retrieve the connection type identified by connection type name. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -153,7 +156,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ConnectionType] = kwargs.pop("cls", None) request = build_get_request( @@ -169,8 +172,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,6 +208,9 @@ async def create_or_update( ) -> _models.ConnectionType: """Create a connection type. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -236,6 +243,9 @@ async def create_or_update( ) -> _models.ConnectionType: """Create a connection type. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -266,6 +276,9 @@ async def create_or_update( ) -> _models.ConnectionType: """Create a connection type. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -274,7 +287,7 @@ async def create_or_update( operation. Required. :type connection_type_name: str :param parameters: The parameters supplied to the create or update connection type operation. - Is either a model type or a IO type. Required. + Is either a ConnectionTypeCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ConnectionTypeCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -295,14 +308,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ConnectionType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ConnectionTypeCreateOrUpdateParameters") @@ -323,8 +336,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -351,6 +365,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.ConnectionType"]: """Retrieve a list of connection types. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -363,7 +380,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ConnectionTypeListResult] = kwargs.pop("cls", None) error_map = { @@ -406,8 +423,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_credential_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_credential_operations.py index 75800d5637d1..6205000c7665 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_credential_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_credential_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +66,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -92,7 +91,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -108,8 +107,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,6 +132,9 @@ async def get( ) -> _models.Credential: """Retrieve the credential identified by credential name. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -154,7 +157,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Credential] = kwargs.pop("cls", None) request = build_get_request( @@ -170,8 +173,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,6 +209,9 @@ async def create_or_update( ) -> _models.Credential: """Create a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -237,6 +244,9 @@ async def create_or_update( ) -> _models.Credential: """Create a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -267,6 +277,9 @@ async def create_or_update( ) -> _models.Credential: """Create a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -275,7 +288,7 @@ async def create_or_update( Required. :type credential_name: str :param parameters: The parameters supplied to the create or update credential operation. Is - either a model type or a IO type. Required. + either a CredentialCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.CredentialCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -296,14 +309,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Credential] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CredentialCreateOrUpdateParameters") @@ -324,8 +337,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -363,6 +377,9 @@ async def update( ) -> _models.Credential: """Update a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -393,6 +410,9 @@ async def update( ) -> _models.Credential: """Update a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -421,6 +441,9 @@ async def update( ) -> _models.Credential: """Update a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -428,7 +451,7 @@ async def update( :param credential_name: The parameters supplied to the Update credential operation. Required. :type credential_name: str :param parameters: The parameters supplied to the Update credential operation. Is either a - model type or a IO type. Required. + CredentialUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.CredentialUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -449,14 +472,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Credential] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CredentialUpdateParameters") @@ -477,8 +500,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -505,6 +529,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Credential"]: """Retrieve a list of credentials. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -517,7 +544,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.CredentialListResult] = kwargs.pop("cls", None) error_map = { @@ -560,8 +587,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_deleted_automation_accounts_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_deleted_automation_accounts_operations.py index 1035080d3af2..c0ddf73062a3 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_deleted_automation_accounts_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_deleted_automation_accounts_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from ...operations._deleted_automation_accounts_operations import build_list_by_subscription_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +71,7 @@ async def list_by_subscription(self, **kwargs: Any) -> _models.DeletedAutomation _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-01-31"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-01-31")) cls: ClsType[_models.DeletedAutomationAccountListResult] = kwargs.pop("cls", None) request = build_list_by_subscription_request( @@ -89,8 +84,9 @@ async def list_by_subscription(self, **kwargs: Any) -> _models.DeletedAutomation request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_compilation_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_compilation_job_operations.py index 46bf8b413117..57be4f534901 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_compilation_job_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_compilation_job_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -84,16 +80,14 @@ async def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscCompilationJob] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DscCompilationJobCreateParameters") @@ -114,8 +108,9 @@ async def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -149,6 +144,9 @@ async def begin_create( ) -> AsyncLROPoller[_models.DscCompilationJob]: """Creates the Dsc compilation job of the configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscconfigurationcompilejoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -187,6 +185,9 @@ async def begin_create( ) -> AsyncLROPoller[_models.DscCompilationJob]: """Creates the Dsc compilation job of the configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscconfigurationcompilejoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -223,6 +224,9 @@ async def begin_create( ) -> AsyncLROPoller[_models.DscCompilationJob]: """Creates the Dsc compilation job of the configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscconfigurationcompilejoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -230,7 +234,7 @@ async def begin_create( :param compilation_job_name: The DSC configuration Id. Required. :type compilation_job_name: str :param parameters: The parameters supplied to the create compilation job operation. Is either a - model type or a IO type. Required. + DscCompilationJobCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.DscCompilationJobCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -251,9 +255,7 @@ async def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscCompilationJob] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -305,6 +307,9 @@ async def get( ) -> _models.DscCompilationJob: """Retrieve the Dsc configuration compilation job identified by job id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dsccompilationjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -327,9 +332,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscCompilationJob] = kwargs.pop("cls", None) request = build_get_request( @@ -345,8 +348,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -373,6 +377,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.DscCompilationJob"]: """Retrieve a list of dsc compilation jobs. + .. seealso:: + - http://aka.ms/azureautomationsdk/compilationjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -388,9 +395,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscCompilationJobListResult] = kwargs.pop("cls", None) error_map = { @@ -434,8 +439,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -458,6 +464,9 @@ async def get_stream( ) -> _models.JobStream: """Retrieve the job stream identified by job stream id. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -482,9 +491,7 @@ async def get_stream( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.JobStream] = kwargs.pop("cls", None) request = build_get_stream_request( @@ -501,8 +508,9 @@ async def get_stream( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_compilation_job_stream_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_compilation_job_stream_operations.py index cf2858b8ec2c..796255b03c74 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_compilation_job_stream_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_compilation_job_stream_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from ...operations._dsc_compilation_job_stream_operations import build_list_by_job_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,6 +57,9 @@ async def list_by_job( ) -> _models.JobStreamListResult: """Retrieve all the job streams for the compilation Job. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -84,9 +82,7 @@ async def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.JobStreamListResult] = kwargs.pop("cls", None) request = build_list_by_job_request( @@ -102,8 +98,9 @@ async def list_by_job( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_configuration_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_configuration_operations.py index 8235b0d6417f..024e3b85437b 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_configuration_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_configuration_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,6 +66,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the dsc configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -93,7 +91,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -109,8 +107,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,6 +132,9 @@ async def get( ) -> _models.DscConfiguration: """Retrieve the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -155,7 +157,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.DscConfiguration] = kwargs.pop("cls", None) request = build_get_request( @@ -171,8 +173,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -206,6 +209,9 @@ async def create_or_update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -236,6 +242,9 @@ async def create_or_update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -264,14 +273,17 @@ async def create_or_update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param configuration_name: The create or update parameters for configuration. Required. :type configuration_name: str - :param parameters: The create or update parameters for configuration. Is either a model type or - a string type. Required. + :param parameters: The create or update parameters for configuration. Is either a + DscConfigurationCreateOrUpdateParameters type or a str type. Required. :type parameters: ~azure.mgmt.automation.models.DscConfigurationCreateOrUpdateParameters or str :keyword content_type: Body Parameter content-type. Known values are: 'application/json', 'text/plain; charset=utf-8'. Default value is None. @@ -292,7 +304,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscConfiguration] = kwargs.pop("cls", None) @@ -320,8 +332,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -359,6 +372,9 @@ async def update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -389,6 +405,9 @@ async def update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -417,14 +436,17 @@ async def update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param configuration_name: The create or update parameters for configuration. Required. :type configuration_name: str - :param parameters: The create or update parameters for configuration. Is either a model type or - a string type. Default value is None. + :param parameters: The create or update parameters for configuration. Is either a + DscConfigurationUpdateParameters type or a str type. Default value is None. :type parameters: ~azure.mgmt.automation.models.DscConfigurationUpdateParameters or str :keyword content_type: Body Parameter content-type. Known values are: 'application/json', 'text/plain; charset=utf-8'. Default value is None. @@ -445,7 +467,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscConfiguration] = kwargs.pop("cls", None) @@ -479,8 +501,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -507,6 +530,9 @@ async def get_content( ) -> AsyncIterator[bytes]: """Retrieve the configuration script identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -529,7 +555,7 @@ async def get_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) request = build_get_content_request( @@ -545,8 +571,9 @@ async def get_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=True, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -579,6 +606,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.DscConfiguration"]: """Retrieve a list of configurations. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -599,7 +629,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.DscConfigurationListResult] = kwargs.pop("cls", None) error_map = { @@ -646,8 +676,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_node_configuration_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_node_configuration_operations.py index 9f8e09ce19bf..62ca7fc910b7 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_node_configuration_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_node_configuration_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -71,6 +67,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the Dsc node configurations by node configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -93,7 +92,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -109,8 +108,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,6 +133,9 @@ async def get( ) -> _models.DscNodeConfiguration: """Retrieve the Dsc node configurations by node configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -155,7 +158,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.DscNodeConfiguration] = kwargs.pop("cls", None) request = build_get_request( @@ -171,8 +174,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -212,14 +216,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DscNodeConfiguration]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DscNodeConfigurationCreateOrUpdateParameters") @@ -240,8 +244,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -274,9 +279,12 @@ async def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: + ) -> AsyncLROPoller[_models.DscNodeConfiguration]: """Create the node configuration identified by node configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -312,9 +320,12 @@ async def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: + ) -> AsyncLROPoller[_models.DscNodeConfiguration]: """Create the node configuration identified by node configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -348,17 +359,20 @@ async def begin_create_or_update( node_configuration_name: str, parameters: Union[_models.DscNodeConfigurationCreateOrUpdateParameters, IO], **kwargs: Any - ) -> AsyncLROPoller[None]: + ) -> AsyncLROPoller[_models.DscNodeConfiguration]: """Create the node configuration identified by node configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param node_configuration_name: The Dsc node configuration name. Required. :type node_configuration_name: str - :param parameters: The create or update parameters for configuration. Is either a model type or - a IO type. Required. + :param parameters: The create or update parameters for configuration. Is either a + DscNodeConfigurationCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.DscNodeConfigurationCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -380,7 +394,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -439,6 +453,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.DscNodeConfiguration"]: """Retrieve a list of dsc node configurations. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -461,7 +478,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.DscNodeConfigurationListResult] = kwargs.pop("cls", None) error_map = { @@ -508,8 +525,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_node_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_node_operations.py index 90db769927b8..9bd508c665e2 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_node_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_dsc_node_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,6 +65,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the dsc node identified by node id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -91,9 +90,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -109,8 +106,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -133,6 +131,9 @@ async def get( ) -> _models.DscNode: """Retrieve the dsc node identified by node id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -155,9 +156,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscNode] = kwargs.pop("cls", None) request = build_get_request( @@ -173,8 +172,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -208,6 +208,9 @@ async def update( ) -> _models.DscNode: """Update the dsc node. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -238,6 +241,9 @@ async def update( ) -> _models.DscNode: """Update the dsc node. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -266,6 +272,9 @@ async def update( ) -> _models.DscNode: """Update the dsc node. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -273,7 +282,7 @@ async def update( :param node_id: Parameters supplied to the update dsc node. Required. :type node_id: str :param dsc_node_update_parameters: Parameters supplied to the update dsc node. Is either a - model type or a IO type. Required. + DscNodeUpdateParameters type or a IO type. Required. :type dsc_node_update_parameters: ~azure.mgmt.automation.models.DscNodeUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -294,16 +303,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscNode] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(dsc_node_update_parameters, (IO, bytes)): + if isinstance(dsc_node_update_parameters, (IOBase, bytes)): _content = dsc_node_update_parameters else: _json = self._serialize.body(dsc_node_update_parameters, "DscNodeUpdateParameters") @@ -324,8 +331,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -359,6 +367,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.DscNode"]: """Retrieve a list of dsc nodes. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -379,9 +390,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscNodeListResult] = kwargs.pop("cls", None) error_map = { @@ -428,8 +437,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_fields_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_fields_operations.py index bf24b786c68e..7c316ced632b 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_fields_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_fields_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ...operations._fields_operations import build_list_by_type_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,6 +58,9 @@ def list_by_type( ) -> AsyncIterable["_models.TypeField"]: """Retrieve a list of fields of a given type identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/typefieldoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -79,7 +77,7 @@ def list_by_type( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.TypeFieldListResult] = kwargs.pop("cls", None) error_map = { @@ -124,8 +122,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_hybrid_runbook_worker_group_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_hybrid_runbook_worker_group_operations.py index f806c6b894b2..f6fe174513e7 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_hybrid_runbook_worker_group_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_hybrid_runbook_worker_group_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,6 +70,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -96,7 +95,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -112,8 +111,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -140,6 +140,9 @@ async def get( ) -> _models.HybridRunbookWorkerGroup: """Retrieve a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -162,7 +165,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.HybridRunbookWorkerGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -178,8 +181,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -213,6 +217,9 @@ async def create( ) -> _models.HybridRunbookWorkerGroup: """Create a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -245,6 +252,9 @@ async def create( ) -> _models.HybridRunbookWorkerGroup: """Create a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -276,6 +286,9 @@ async def create( ) -> _models.HybridRunbookWorkerGroup: """Create a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -283,7 +296,8 @@ async def create( :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. Required. :type hybrid_runbook_worker_group_name: str :param hybrid_runbook_worker_group_creation_parameters: The create or update parameters for - hybrid runbook worker group. Is either a model type or a IO type. Required. + hybrid runbook worker group. Is either a HybridRunbookWorkerGroupCreateOrUpdateParameters type + or a IO type. Required. :type hybrid_runbook_worker_group_creation_parameters: ~azure.mgmt.automation.models.HybridRunbookWorkerGroupCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -305,14 +319,14 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.HybridRunbookWorkerGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hybrid_runbook_worker_group_creation_parameters, (IO, bytes)): + if isinstance(hybrid_runbook_worker_group_creation_parameters, (IOBase, bytes)): _content = hybrid_runbook_worker_group_creation_parameters else: _json = self._serialize.body( @@ -335,8 +349,9 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -374,6 +389,9 @@ async def update( ) -> _models.HybridRunbookWorkerGroup: """Update a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -406,6 +424,9 @@ async def update( ) -> _models.HybridRunbookWorkerGroup: """Update a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -437,6 +458,9 @@ async def update( ) -> _models.HybridRunbookWorkerGroup: """Update a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -444,7 +468,7 @@ async def update( :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. Required. :type hybrid_runbook_worker_group_name: str :param hybrid_runbook_worker_group_updation_parameters: The hybrid runbook worker group. Is - either a model type or a IO type. Required. + either a HybridRunbookWorkerGroupCreateOrUpdateParameters type or a IO type. Required. :type hybrid_runbook_worker_group_updation_parameters: ~azure.mgmt.automation.models.HybridRunbookWorkerGroupCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -466,14 +490,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.HybridRunbookWorkerGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hybrid_runbook_worker_group_updation_parameters, (IO, bytes)): + if isinstance(hybrid_runbook_worker_group_updation_parameters, (IOBase, bytes)): _content = hybrid_runbook_worker_group_updation_parameters else: _json = self._serialize.body( @@ -496,8 +520,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -524,6 +549,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.HybridRunbookWorkerGroup"]: """Retrieve a list of hybrid runbook worker groups. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -540,7 +568,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.HybridRunbookWorkerGroupsListResult] = kwargs.pop("cls", None) error_map = { @@ -584,8 +612,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_hybrid_runbook_workers_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_hybrid_runbook_workers_operations.py index 250602e6afec..1d77519806f4 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_hybrid_runbook_workers_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_hybrid_runbook_workers_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,6 +71,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -99,7 +98,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -116,8 +115,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -145,6 +145,9 @@ async def get( ) -> _models.HybridRunbookWorker: """Retrieve a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -169,7 +172,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.HybridRunbookWorker] = kwargs.pop("cls", None) request = build_get_request( @@ -186,8 +189,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -222,6 +226,9 @@ async def create( ) -> _models.HybridRunbookWorker: """Create a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -257,6 +264,9 @@ async def create( ) -> _models.HybridRunbookWorker: """Create a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -289,6 +299,9 @@ async def create( ) -> _models.HybridRunbookWorker: """Create a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -298,7 +311,7 @@ async def create( :param hybrid_runbook_worker_id: The hybrid runbook worker id. Required. :type hybrid_runbook_worker_id: str :param hybrid_runbook_worker_creation_parameters: The create or update parameters for hybrid - runbook worker. Is either a model type or a IO type. Required. + runbook worker. Is either a HybridRunbookWorkerCreateParameters type or a IO type. Required. :type hybrid_runbook_worker_creation_parameters: ~azure.mgmt.automation.models.HybridRunbookWorkerCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -320,14 +333,14 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.HybridRunbookWorker] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hybrid_runbook_worker_creation_parameters, (IO, bytes)): + if isinstance(hybrid_runbook_worker_creation_parameters, (IOBase, bytes)): _content = hybrid_runbook_worker_creation_parameters else: _json = self._serialize.body( @@ -351,8 +364,9 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -391,6 +405,9 @@ async def move( # pylint: disable=inconsistent-return-statements ) -> None: """Move a hybrid worker to a different group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -426,6 +443,9 @@ async def move( # pylint: disable=inconsistent-return-statements ) -> None: """Move a hybrid worker to a different group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -458,6 +478,9 @@ async def move( # pylint: disable=inconsistent-return-statements ) -> None: """Move a hybrid worker to a different group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -467,7 +490,7 @@ async def move( # pylint: disable=inconsistent-return-statements :param hybrid_runbook_worker_id: The hybrid runbook worker id. Required. :type hybrid_runbook_worker_id: str :param hybrid_runbook_worker_move_parameters: The hybrid runbook worker move parameters. Is - either a model type or a IO type. Required. + either a HybridRunbookWorkerMoveParameters type or a IO type. Required. :type hybrid_runbook_worker_move_parameters: ~azure.mgmt.automation.models.HybridRunbookWorkerMoveParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -489,14 +512,14 @@ async def move( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hybrid_runbook_worker_move_parameters, (IO, bytes)): + if isinstance(hybrid_runbook_worker_move_parameters, (IOBase, bytes)): _content = hybrid_runbook_worker_move_parameters else: _json = self._serialize.body(hybrid_runbook_worker_move_parameters, "HybridRunbookWorkerMoveParameters") @@ -518,8 +541,9 @@ async def move( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -547,6 +571,9 @@ def list_by_hybrid_runbook_worker_group( ) -> AsyncIterable["_models.HybridRunbookWorker"]: """Retrieve a list of hybrid runbook workers. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -564,7 +591,7 @@ def list_by_hybrid_runbook_worker_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.HybridRunbookWorkersListResult] = kwargs.pop("cls", None) error_map = { @@ -609,8 +636,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_operations.py index 294a6b54fe5f..fba6919b3fc2 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -40,10 +40,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,6 +74,9 @@ async def get_output( ) -> str: """Retrieve the job output identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -102,7 +101,7 @@ async def get_output( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[str] = kwargs.pop("cls", None) request = build_get_output_request( @@ -119,8 +118,9 @@ async def get_output( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,6 +151,9 @@ async def get_runbook_content( ) -> str: """Retrieve the runbook content of the job identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -175,7 +178,7 @@ async def get_runbook_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[str] = kwargs.pop("cls", None) request = build_get_runbook_content_request( @@ -192,8 +195,9 @@ async def get_runbook_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,6 +228,9 @@ async def suspend( # pylint: disable=inconsistent-return-statements ) -> None: """Suspend the job identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -248,7 +255,7 @@ async def suspend( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_suspend_request( @@ -265,8 +272,9 @@ async def suspend( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -294,6 +302,9 @@ async def stop( # pylint: disable=inconsistent-return-statements ) -> None: """Stop the job identified by jobName. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -318,7 +329,7 @@ async def stop( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -335,8 +346,9 @@ async def stop( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -364,6 +376,9 @@ async def get( ) -> _models.Job: """Retrieve the job identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -388,7 +403,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Job] = kwargs.pop("cls", None) request = build_get_request( @@ -405,8 +420,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -441,6 +457,9 @@ async def create( ) -> _models.Job: """Create a job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -474,6 +493,9 @@ async def create( ) -> _models.Job: """Create a job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -505,14 +527,17 @@ async def create( ) -> _models.Job: """Create a job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param job_name: The job name. Required. :type job_name: str - :param parameters: The parameters supplied to the create job operation. Is either a model type - or a IO type. Required. + :param parameters: The parameters supplied to the create job operation. Is either a + JobCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.JobCreateParameters or IO :param client_request_id: Identifies this specific client request. Default value is None. :type client_request_id: str @@ -535,14 +560,14 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobCreateParameters") @@ -564,8 +589,9 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -597,6 +623,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.JobCollectionItem"]: """Retrieve a list of jobs. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -614,7 +643,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobListResultV2] = kwargs.pop("cls", None) error_map = { @@ -659,8 +688,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -688,6 +718,9 @@ async def resume( # pylint: disable=inconsistent-return-statements ) -> None: """Resume the job identified by jobName. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -712,7 +745,7 @@ async def resume( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resume_request( @@ -729,8 +762,9 @@ async def resume( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_schedule_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_schedule_operations.py index 1b87fe2cc35c..ff63e37dc7da 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_schedule_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_schedule_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,10 +36,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,6 +65,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the job schedule identified by job schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -91,7 +90,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -107,8 +106,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -131,6 +131,9 @@ async def get( ) -> _models.JobSchedule: """Retrieve the job schedule identified by job schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -153,7 +156,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobSchedule] = kwargs.pop("cls", None) request = build_get_request( @@ -169,8 +172,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -204,6 +208,9 @@ async def create( ) -> _models.JobSchedule: """Create a job schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -234,6 +241,9 @@ async def create( ) -> _models.JobSchedule: """Create a job schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,6 +272,9 @@ async def create( ) -> _models.JobSchedule: """Create a job schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -269,7 +282,7 @@ async def create( :param job_schedule_id: The job schedule name. Required. :type job_schedule_id: str :param parameters: The parameters supplied to the create job schedule operation. Is either a - model type or a IO type. Required. + JobScheduleCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.JobScheduleCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -290,14 +303,14 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobSchedule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobScheduleCreateParameters") @@ -318,8 +331,9 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -346,6 +360,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.JobSchedule"]: """Retrieve a list of job schedules. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -360,7 +377,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobScheduleListResult] = kwargs.pop("cls", None) error_map = { @@ -404,8 +421,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_stream_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_stream_operations.py index b815bac87793..ee54c65ba8e3 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_stream_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_job_stream_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,10 +30,6 @@ from ...operations._job_stream_operations import build_get_request, build_list_by_job_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +65,9 @@ async def get( ) -> _models.JobStream: """Retrieve the job stream identified by job stream id. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -96,7 +94,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobStream] = kwargs.pop("cls", None) request = build_get_request( @@ -114,8 +112,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -148,6 +147,9 @@ def list_by_job( ) -> AsyncIterable["_models.JobStream"]: """Retrieve a list of jobs streams identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -166,7 +168,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobStreamListResult] = kwargs.pop("cls", None) error_map = { @@ -212,8 +214,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_keys_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_keys_operations.py index 8f4a8d9484f8..eb6ff4ae211b 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_keys_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_keys_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from ...operations._keys_operations import build_list_by_automation_account_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +77,7 @@ async def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.KeyListResult] = kwargs.pop("cls", None) request = build_list_by_automation_account_request( @@ -97,8 +92,9 @@ async def list_by_automation_account( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_linked_workspace_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_linked_workspace_operations.py index c383a374464f..dd26c55dde44 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_linked_workspace_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_linked_workspace_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from ...operations._linked_workspace_operations import build_get_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -62,6 +57,9 @@ async def get( ) -> _models.LinkedWorkspace: """Retrieve the linked workspace for the account id. + .. seealso:: + - http://aka.ms/azureautomationsdk/linkedworkspaceoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -82,7 +80,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.LinkedWorkspace] = kwargs.pop("cls", None) request = build_get_request( @@ -97,8 +95,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_module_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_module_operations.py index f6de70a18d40..f29c6feb1245 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_module_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_module_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +66,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the module by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -92,7 +91,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -108,8 +107,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,6 +132,9 @@ async def get( ) -> _models.Module: """Retrieve the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -154,7 +157,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Module] = kwargs.pop("cls", None) request = build_get_request( @@ -170,8 +173,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,6 +209,9 @@ async def create_or_update( ) -> _models.Module: """Create or Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -235,6 +242,9 @@ async def create_or_update( ) -> _models.Module: """Create or Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -263,14 +273,17 @@ async def create_or_update( ) -> _models.Module: """Create or Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param module_name: The name of module. Required. :type module_name: str - :param parameters: The create or update parameters for module. Is either a model type or a IO - type. Required. + :param parameters: The create or update parameters for module. Is either a + ModuleCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ModuleCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -291,14 +304,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ModuleCreateOrUpdateParameters") @@ -319,8 +332,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -358,6 +372,9 @@ async def update( ) -> _models.Module: """Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -388,6 +405,9 @@ async def update( ) -> _models.Module: """Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -416,14 +436,17 @@ async def update( ) -> _models.Module: """Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param module_name: The name of module. Required. :type module_name: str - :param parameters: The update parameters for module. Is either a model type or a IO type. - Required. + :param parameters: The update parameters for module. Is either a ModuleUpdateParameters type or + a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ModuleUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -444,14 +467,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ModuleUpdateParameters") @@ -472,8 +495,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -500,6 +524,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Module"]: """Retrieve a list of modules. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -512,7 +539,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ModuleListResult] = kwargs.pop("cls", None) error_map = { @@ -555,8 +582,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_node_count_information_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_node_count_information_operations.py index 9c3773f1b89b..bcc54110347d 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_node_count_information_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_node_count_information_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from ...operations._node_count_information_operations import build_get_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,6 +61,9 @@ async def get( ) -> _models.NodeCounts: """Retrieve counts for Dsc Nodes. + .. seealso:: + - http://aka.ms/azureautomationsdk/nodecounts + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -89,9 +87,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.NodeCounts] = kwargs.pop("cls", None) request = build_get_request( @@ -107,8 +103,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_node_reports_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_node_reports_operations.py index f69a5d6d25f4..8651b9434401 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_node_reports_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_node_reports_operations.py @@ -39,10 +39,6 @@ from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,6 +74,9 @@ def list_by_node( ) -> AsyncIterable["_models.DscNodeReport"]: """Retrieve the Dsc node report list by node id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodereportoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -94,9 +93,7 @@ def list_by_node( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscNodeReportListResult] = kwargs.pop("cls", None) error_map = { @@ -141,8 +138,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -165,6 +163,9 @@ async def get( ) -> _models.DscNodeReport: """Retrieve the Dsc node report data by node id and report id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodereportoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -189,9 +190,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscNodeReport] = kwargs.pop("cls", None) request = build_get_request( @@ -208,8 +207,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -236,6 +236,9 @@ async def get_content( ) -> JSON: """Retrieve the Dsc node reports by node id and report id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodereportoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -260,9 +263,7 @@ async def get_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[JSON] = kwargs.pop("cls", None) request = build_get_content_request( @@ -279,8 +280,9 @@ async def get_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_object_data_types_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_object_data_types_operations.py index 2a5725fd5a63..7c08d067db37 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_object_data_types_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_object_data_types_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -33,10 +32,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,6 +61,9 @@ def list_fields_by_module_and_type( ) -> AsyncIterable["_models.TypeField"]: """Retrieve a list of fields of a given type identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/objectdatatypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -82,7 +80,7 @@ def list_fields_by_module_and_type( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.TypeFieldListResult] = kwargs.pop("cls", None) error_map = { @@ -127,8 +125,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -151,6 +150,9 @@ def list_fields_by_type( ) -> AsyncIterable["_models.TypeField"]: """Retrieve a list of fields of a given type across all accessible modules. + .. seealso:: + - http://aka.ms/azureautomationsdk/objectdatatypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -165,7 +167,7 @@ def list_fields_by_type( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.TypeFieldListResult] = kwargs.pop("cls", None) error_map = { @@ -209,8 +211,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_operations.py index 3599d8fec14d..5538301a9500 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ...operations._operations import build_list_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,7 +64,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -109,8 +104,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_private_endpoint_connections_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_private_endpoint_connections_operations.py index 5325585a9f77..8de9d11136b3 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_private_endpoint_connections_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,9 +81,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { @@ -130,8 +124,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -179,9 +174,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( @@ -197,8 +190,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -237,16 +231,14 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PrivateEndpointConnection") @@ -267,8 +259,9 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -386,7 +379,7 @@ async def begin_create_or_update( :type automation_account_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str - :param parameters: Is either a model type or a IO type. Required. + :param parameters: Is either a PrivateEndpointConnection type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -408,9 +401,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -474,9 +465,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -492,8 +481,9 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -541,9 +531,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_private_link_resources_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_private_link_resources_operations.py index b31120697d9a..77a506dc644d 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_private_link_resources_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ...operations._private_link_resources_operations import build_automation_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,9 +71,7 @@ def automation( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -121,8 +114,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_python2_package_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_python2_package_operations.py index 7422ff40e17e..c72ac27b28b5 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_python2_package_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_python2_package_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +66,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the python 2 package by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -92,7 +91,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -108,8 +107,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,6 +132,9 @@ async def get( ) -> _models.Module: """Retrieve the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -154,7 +157,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Module] = kwargs.pop("cls", None) request = build_get_request( @@ -170,8 +173,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -205,6 +209,9 @@ async def create_or_update( ) -> _models.Module: """Create or Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -235,6 +242,9 @@ async def create_or_update( ) -> _models.Module: """Create or Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -263,14 +273,17 @@ async def create_or_update( ) -> _models.Module: """Create or Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param package_name: The name of python package. Required. :type package_name: str - :param parameters: The create or update parameters for python package. Is either a model type - or a IO type. Required. + :param parameters: The create or update parameters for python package. Is either a + PythonPackageCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PythonPackageCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -291,14 +304,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PythonPackageCreateParameters") @@ -319,8 +332,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -358,6 +372,9 @@ async def update( ) -> _models.Module: """Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -388,6 +405,9 @@ async def update( ) -> _models.Module: """Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -416,14 +436,17 @@ async def update( ) -> _models.Module: """Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param package_name: The name of python package. Required. :type package_name: str - :param parameters: The update parameters for python package. Is either a model type or a IO - type. Required. + :param parameters: The update parameters for python package. Is either a + PythonPackageUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PythonPackageUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -444,14 +467,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PythonPackageUpdateParameters") @@ -472,8 +495,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -500,6 +524,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Module"]: """Retrieve a list of python 2 packages. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -512,7 +539,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ModuleListResult] = kwargs.pop("cls", None) error_map = { @@ -555,8 +582,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_python3_package_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_python3_package_operations.py index eb2d17821588..2197ea345616 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_python3_package_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_python3_package_operations.py @@ -6,8 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -20,11 +20,13 @@ ) 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 @@ -37,10 +39,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +68,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the python 3 package by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -92,7 +93,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -108,8 +109,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,6 +134,9 @@ async def get( ) -> _models.Module: """Retrieve the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -154,7 +159,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Module] = kwargs.pop("cls", None) request = build_get_request( @@ -170,8 +175,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -192,8 +198,82 @@ async def get( "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName}" } + async def _create_or_update_initial( + self, + resource_group_name: str, + automation_account_name: str, + package_name: str, + parameters: Union[_models.PythonPackageCreateParameters, IO], + **kwargs: Any + ) -> _models.Module: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Module] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PythonPackageCreateParameters") + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + package_name=package_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + 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) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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("Module", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Module", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName}" + } + @overload - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, automation_account_name: str, @@ -202,9 +282,12 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Module: + ) -> AsyncLROPoller[_models.Module]: """Create or Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -217,13 +300,21 @@ async def create_or_update( 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: Module or the result of cls(response) - :rtype: ~azure.mgmt.automation.models.Module + :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 Module or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.automation.models.Module] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, automation_account_name: str, @@ -232,9 +323,12 @@ async def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Module: + ) -> AsyncLROPoller[_models.Module]: """Create or Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -247,101 +341,106 @@ async def create_or_update( 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: Module or the result of cls(response) - :rtype: ~azure.mgmt.automation.models.Module + :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 Module or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.automation.models.Module] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_or_update( + async def begin_create_or_update( self, resource_group_name: str, automation_account_name: str, package_name: str, parameters: Union[_models.PythonPackageCreateParameters, IO], **kwargs: Any - ) -> _models.Module: + ) -> AsyncLROPoller[_models.Module]: """Create or Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param package_name: The name of python package. Required. :type package_name: str - :param parameters: The create or update parameters for python package. Is either a model type - or a IO type. Required. + :param parameters: The create or update parameters for python package. Is either a + PythonPackageCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PythonPackageCreateParameters 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: Module or the result of cls(response) - :rtype: ~azure.mgmt.automation.models.Module + :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 Module or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.automation.models.Module] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + package_name=package_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IO, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PythonPackageCreateParameters") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - automation_account_name=automation_account_name, - package_name=package_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - 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) - - pipeline_response: PipelineResponse = await self._client._pipeline.run( # 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) - 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("Module", pipeline_response) - - if response.status_code == 201: + def get_long_running_output(pipeline_response): deserialized = self._deserialize("Module", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + 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, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - create_or_update.metadata = { + begin_create_or_update.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName}" } @@ -358,6 +457,9 @@ async def update( ) -> _models.Module: """Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -388,6 +490,9 @@ async def update( ) -> _models.Module: """Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -416,14 +521,17 @@ async def update( ) -> _models.Module: """Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param package_name: The name of python package. Required. :type package_name: str - :param parameters: The update parameters for python package. Is either a model type or a IO - type. Required. + :param parameters: The update parameters for python package. Is either a + PythonPackageUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PythonPackageUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -444,14 +552,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PythonPackageUpdateParameters") @@ -472,8 +580,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -500,6 +609,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Module"]: """Retrieve a list of python 3 packages. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -512,7 +624,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ModuleListResult] = kwargs.pop("cls", None) error_map = { @@ -555,8 +667,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_runbook_draft_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_runbook_draft_operations.py index f2bab4dec2f3..9d79d122de2a 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_runbook_draft_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_runbook_draft_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -36,10 +35,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,6 +64,9 @@ async def get_content( ) -> AsyncIterator[bytes]: """Retrieve the content of runbook draft identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -91,7 +89,7 @@ async def get_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) request = build_get_content_request( @@ -107,8 +105,9 @@ async def get_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=True, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -147,7 +146,7 @@ async def _replace_content_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[AsyncIterator[bytes]]] = kwargs.pop("cls", None) @@ -168,8 +167,9 @@ async def _replace_content_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=True, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -207,6 +207,9 @@ async def begin_replace_content( ) -> AsyncLROPoller[AsyncIterator[bytes]]: """Replaces the runbook draft content. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -231,7 +234,7 @@ async def begin_replace_content( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -286,6 +289,9 @@ async def get( ) -> _models.RunbookDraft: """Retrieve the runbook draft identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -308,7 +314,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.RunbookDraft] = kwargs.pop("cls", None) request = build_get_request( @@ -324,8 +330,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -352,6 +359,9 @@ async def undo_edit( ) -> _models.RunbookDraftUndoEditResult: """Undo draft edit to last known published state identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -374,7 +384,7 @@ async def undo_edit( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.RunbookDraftUndoEditResult] = kwargs.pop("cls", None) request = build_undo_edit_request( @@ -390,8 +400,9 @@ async def undo_edit( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_runbook_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_runbook_operations.py index 055eb0da6ab7..bf800bf97fbe 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_runbook_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_runbook_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -41,10 +41,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -82,7 +78,7 @@ async def _publish_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_publish_request( @@ -98,8 +94,9 @@ async def _publish_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -125,6 +122,9 @@ async def begin_publish( ) -> AsyncLROPoller[None]: """Publish runbook draft. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -146,7 +146,7 @@ async def begin_publish( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -193,6 +193,9 @@ async def get_content( ) -> AsyncIterator[bytes]: """Retrieve the content of runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -215,7 +218,7 @@ async def get_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) request = build_get_content_request( @@ -231,8 +234,9 @@ async def get_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=True, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -258,6 +262,9 @@ async def get( ) -> _models.Runbook: """Retrieve the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -280,7 +287,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Runbook] = kwargs.pop("cls", None) request = build_get_request( @@ -296,8 +303,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -331,6 +339,9 @@ async def create_or_update( ) -> _models.Runbook: """Create the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -362,6 +373,9 @@ async def create_or_update( ) -> _models.Runbook: """Create the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -391,6 +405,9 @@ async def create_or_update( ) -> _models.Runbook: """Create the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -398,7 +415,8 @@ async def create_or_update( :param runbook_name: The runbook name. Required. :type runbook_name: str :param parameters: The create or update parameters for runbook. Provide either content link for - a published runbook or draft, not both. Is either a model type or a IO type. Required. + a published runbook or draft, not both. Is either a RunbookCreateOrUpdateParameters type or a + IO type. Required. :type parameters: ~azure.mgmt.automation.models.RunbookCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -419,14 +437,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Runbook] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RunbookCreateOrUpdateParameters") @@ -447,8 +465,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -486,6 +505,9 @@ async def update( ) -> _models.Runbook: """Update the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -516,6 +538,9 @@ async def update( ) -> _models.Runbook: """Update the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -544,14 +569,17 @@ async def update( ) -> _models.Runbook: """Update the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param runbook_name: The runbook name. Required. :type runbook_name: str - :param parameters: The update parameters for runbook. Is either a model type or a IO type. - Required. + :param parameters: The update parameters for runbook. Is either a RunbookUpdateParameters type + or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.RunbookUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -572,14 +600,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Runbook] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RunbookUpdateParameters") @@ -600,8 +628,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -628,6 +657,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the runbook by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -650,7 +682,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -666,8 +698,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -690,6 +723,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Runbook"]: """Retrieve a list of runbooks. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -702,7 +738,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.RunbookListResult] = kwargs.pop("cls", None) error_map = { @@ -745,8 +781,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_schedule_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_schedule_operations.py index 7a3e4d38c12e..b4896b2aa5a3 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_schedule_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_schedule_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,6 +73,9 @@ async def create_or_update( ) -> Optional[_models.Schedule]: """Create a schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -108,6 +107,9 @@ async def create_or_update( ) -> Optional[_models.Schedule]: """Create a schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -137,6 +139,9 @@ async def create_or_update( ) -> Optional[_models.Schedule]: """Create a schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -144,7 +149,7 @@ async def create_or_update( :param schedule_name: The schedule name. Required. :type schedule_name: str :param parameters: The parameters supplied to the create or update schedule operation. Is - either a model type or a IO type. Required. + either a ScheduleCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ScheduleCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -165,14 +170,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Schedule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ScheduleCreateOrUpdateParameters") @@ -193,8 +198,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -233,6 +239,9 @@ async def update( ) -> _models.Schedule: """Update the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -263,6 +272,9 @@ async def update( ) -> _models.Schedule: """Update the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -291,14 +303,17 @@ async def update( ) -> _models.Schedule: """Update the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param schedule_name: The schedule name. Required. :type schedule_name: str - :param parameters: The parameters supplied to the update schedule operation. Is either a model - type or a IO type. Required. + :param parameters: The parameters supplied to the update schedule operation. Is either a + ScheduleUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ScheduleUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -319,14 +334,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ScheduleUpdateParameters") @@ -347,8 +362,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -375,6 +391,9 @@ async def get( ) -> _models.Schedule: """Retrieve the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -397,7 +416,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) request = build_get_request( @@ -413,8 +432,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -441,6 +461,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -463,7 +486,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -479,8 +502,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -503,6 +527,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Schedule"]: """Retrieve a list of schedules. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -515,7 +542,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ScheduleListResult] = kwargs.pop("cls", None) error_map = { @@ -558,8 +585,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configuration_machine_runs_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configuration_machine_runs_operations.py index 5f715eec7678..2bac4e745d51 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configuration_machine_runs_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configuration_machine_runs_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -32,10 +31,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +65,9 @@ async def get_by_id( ) -> _models.SoftwareUpdateConfigurationMachineRun: """Get a single software update configuration machine run by Id. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -95,7 +93,7 @@ async def get_by_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SoftwareUpdateConfigurationMachineRun] = kwargs.pop("cls", None) request = build_get_by_id_request( @@ -112,8 +110,9 @@ async def get_by_id( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -147,6 +146,9 @@ async def list( ) -> _models.SoftwareUpdateConfigurationMachineRunListResult: """Return list of software update configuration machine runs. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -178,7 +180,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SoftwareUpdateConfigurationMachineRunListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -197,8 +199,9 @@ async def list( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configuration_runs_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configuration_runs_operations.py index 2e5dfb1846ab..1958bb04c584 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configuration_runs_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configuration_runs_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from ...operations._software_update_configuration_runs_operations import build_get_by_id_request, build_list_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -67,6 +62,9 @@ async def get_by_id( ) -> _models.SoftwareUpdateConfigurationRun: """Get a single software update configuration Run by Id. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationrunoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -92,7 +90,7 @@ async def get_by_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SoftwareUpdateConfigurationRun] = kwargs.pop("cls", None) request = build_get_by_id_request( @@ -109,8 +107,9 @@ async def get_by_id( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -144,6 +143,9 @@ async def list( ) -> _models.SoftwareUpdateConfigurationRunListResult: """Return list of software update configuration runs. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -175,7 +177,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SoftwareUpdateConfigurationRunListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -194,8 +196,9 @@ async def list( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configurations_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configurations_operations.py index 38d44d4fb817..eb02ace44071 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configurations_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_software_update_configurations_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -34,10 +34,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,6 +71,9 @@ async def create( ) -> _models.SoftwareUpdateConfiguration: """Create a new software update configuration with the name given in the URI. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -109,6 +108,9 @@ async def create( ) -> _models.SoftwareUpdateConfiguration: """Create a new software update configuration with the name given in the URI. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -141,6 +143,9 @@ async def create( ) -> _models.SoftwareUpdateConfiguration: """Create a new software update configuration with the name given in the URI. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -148,7 +153,8 @@ async def create( :param software_update_configuration_name: The name of the software update configuration to be created. Required. :type software_update_configuration_name: str - :param parameters: Request body. Is either a model type or a IO type. Required. + :param parameters: Request body. Is either a SoftwareUpdateConfiguration type or a IO type. + Required. :type parameters: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or IO :param client_request_id: Identifies this specific client request. Default value is None. :type client_request_id: str @@ -171,14 +177,14 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SoftwareUpdateConfiguration] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SoftwareUpdateConfiguration") @@ -200,8 +206,9 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -237,6 +244,9 @@ async def get_by_name( ) -> _models.SoftwareUpdateConfiguration: """Get a single software update configuration by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,7 +272,7 @@ async def get_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) cls: ClsType[_models.SoftwareUpdateConfiguration] = kwargs.pop("cls", None) request = build_get_by_name_request( @@ -279,8 +289,9 @@ async def get_by_name( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -312,6 +323,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """delete a specific software update configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -337,7 +351,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -354,8 +368,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -383,6 +398,9 @@ async def list( ) -> _models.SoftwareUpdateConfigurationListResult: """Get all software update configurations for the account. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -407,7 +425,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) cls: ClsType[_models.SoftwareUpdateConfigurationListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -424,8 +442,9 @@ async def list( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_operations.py index 4b0b4776ffe5..11cd5e38324d 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,6 +73,9 @@ async def create_or_update( ) -> _models.SourceControl: """Create a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -108,6 +107,9 @@ async def create_or_update( ) -> _models.SourceControl: """Create a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -137,6 +139,9 @@ async def create_or_update( ) -> _models.SourceControl: """Create a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -144,7 +149,7 @@ async def create_or_update( :param source_control_name: The source control name. Required. :type source_control_name: str :param parameters: The parameters supplied to the create or update source control operation. Is - either a model type or a IO type. Required. + either a SourceControlCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.SourceControlCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -165,14 +170,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SourceControlCreateOrUpdateParameters") @@ -193,8 +198,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -232,6 +238,9 @@ async def update( ) -> _models.SourceControl: """Update a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,6 +271,9 @@ async def update( ) -> _models.SourceControl: """Update a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -290,6 +302,9 @@ async def update( ) -> _models.SourceControl: """Update a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -297,7 +312,7 @@ async def update( :param source_control_name: The source control name. Required. :type source_control_name: str :param parameters: The parameters supplied to the update source control operation. Is either a - model type or a IO type. Required. + SourceControlUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.SourceControlUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -318,14 +333,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SourceControlUpdateParameters") @@ -346,8 +361,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -374,6 +390,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -396,7 +415,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -412,8 +431,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -436,6 +456,9 @@ async def get( ) -> _models.SourceControl: """Retrieve the source control identified by source control name. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -458,7 +481,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None) request = build_get_request( @@ -474,8 +497,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,6 +526,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.SourceControl"]: """Retrieve a list of source controls. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -516,7 +543,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlListResult] = kwargs.pop("cls", None) error_map = { @@ -560,8 +587,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_sync_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_sync_job_operations.py index 51cee98812a5..a975239871e4 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_sync_job_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_sync_job_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -35,10 +35,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,6 +72,9 @@ async def create( ) -> _models.SourceControlSyncJob: """Creates the sync job for a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -110,6 +109,9 @@ async def create( ) -> _models.SourceControlSyncJob: """Creates the sync job for a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -142,6 +144,9 @@ async def create( ) -> _models.SourceControlSyncJob: """Creates the sync job for a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -151,7 +156,7 @@ async def create( :param source_control_sync_job_id: The source control sync job id. Required. :type source_control_sync_job_id: str :param parameters: The parameters supplied to the create source control sync job operation. Is - either a model type or a IO type. Required. + either a SourceControlSyncJobCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.SourceControlSyncJobCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -172,14 +177,14 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SourceControlSyncJob] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SourceControlSyncJobCreateParameters") @@ -201,8 +206,9 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -234,6 +240,9 @@ async def get( ) -> _models.SourceControlSyncJobById: """Retrieve the source control sync job identified by job id. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -258,7 +267,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlSyncJobById] = kwargs.pop("cls", None) request = build_get_request( @@ -275,8 +284,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -308,6 +318,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.SourceControlSyncJob"]: """Retrieve a list of source control sync jobs. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -326,7 +339,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlSyncJobListResult] = kwargs.pop("cls", None) error_map = { @@ -371,8 +384,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_sync_job_streams_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_sync_job_streams_operations.py index 42a2a6839152..94c9f5c59112 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_sync_job_streams_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_source_control_sync_job_streams_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,10 +30,6 @@ from ...operations._source_control_sync_job_streams_operations import build_get_request, build_list_by_sync_job_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +65,9 @@ def list_by_sync_job( ) -> AsyncIterable["_models.SourceControlSyncJobStream"]: """Retrieve a list of sync job streams identified by sync job id. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -90,7 +88,7 @@ def list_by_sync_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlSyncJobStreamsListBySyncJob] = kwargs.pop("cls", None) error_map = { @@ -136,8 +134,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -166,6 +165,9 @@ async def get( ) -> _models.SourceControlSyncJobStreamById: """Retrieve a sync job stream identified by stream id. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -192,7 +194,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlSyncJobStreamById] = kwargs.pop("cls", None) request = build_get_request( @@ -210,8 +212,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_statistics_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_statistics_operations.py index 5ef85ee1ce1f..2fa6cdbaed82 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_statistics_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_statistics_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ...operations._statistics_operations import build_list_by_automation_account_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,6 +58,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Statistics"]: """Retrieve the statistics for the account. + .. seealso:: + - http://aka.ms/azureautomationsdk/statisticsoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -77,7 +75,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.StatisticsListResult] = kwargs.pop("cls", None) error_map = { @@ -121,8 +119,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_test_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_test_job_operations.py index fabe9d8f9a29..4cbd10a36482 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_test_job_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_test_job_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -35,10 +35,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,6 +71,9 @@ async def create( ) -> _models.TestJob: """Create a test job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -105,6 +104,9 @@ async def create( ) -> _models.TestJob: """Create a test job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -133,14 +135,17 @@ async def create( ) -> _models.TestJob: """Create a test job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param runbook_name: The parameters supplied to the create test job operation. Required. :type runbook_name: str - :param parameters: The parameters supplied to the create test job operation. Is either a model - type or a IO type. Required. + :param parameters: The parameters supplied to the create test job operation. Is either a + TestJobCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.TestJobCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -161,14 +166,14 @@ async def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TestJob] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TestJobCreateParameters") @@ -189,8 +194,9 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -217,6 +223,9 @@ async def get( ) -> _models.TestJob: """Retrieve the test job for the specified runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -239,7 +248,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.TestJob] = kwargs.pop("cls", None) request = build_get_request( @@ -255,8 +264,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -283,6 +293,9 @@ async def resume( # pylint: disable=inconsistent-return-statements ) -> None: """Resume the test job. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -305,7 +318,7 @@ async def resume( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resume_request( @@ -321,8 +334,9 @@ async def resume( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -345,6 +359,9 @@ async def stop( # pylint: disable=inconsistent-return-statements ) -> None: """Stop the test job. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -367,7 +384,7 @@ async def stop( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -383,8 +400,9 @@ async def stop( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -407,6 +425,9 @@ async def suspend( # pylint: disable=inconsistent-return-statements ) -> None: """Suspend the test job. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -429,7 +450,7 @@ async def suspend( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_suspend_request( @@ -445,8 +466,9 @@ async def suspend( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_test_job_streams_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_test_job_streams_operations.py index 51075a4a0d03..3a55ca87c143 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_test_job_streams_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_test_job_streams_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,10 +30,6 @@ from ...operations._test_job_streams_operations import build_get_request, build_list_by_test_job_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,6 +64,9 @@ async def get( ) -> _models.JobStream: """Retrieve a test job stream of the test job identified by runbook name and stream id. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -93,7 +91,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobStream] = kwargs.pop("cls", None) request = build_get_request( @@ -110,8 +108,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -143,6 +142,9 @@ def list_by_test_job( ) -> AsyncIterable["_models.JobStream"]: """Retrieve a list of test job streams identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -159,7 +161,7 @@ def list_by_test_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobStreamListResult] = kwargs.pop("cls", None) error_map = { @@ -204,8 +206,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_usages_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_usages_operations.py index 52a873ca2ef7..fba06abde76a 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_usages_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -30,10 +29,6 @@ from ...operations._usages_operations import build_list_by_automation_account_request from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -63,6 +58,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Usage"]: """Retrieve the usage for the account id. + .. seealso:: + - http://aka.ms/azureautomationsdk/usageoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -75,7 +73,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map = { @@ -118,8 +116,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_variable_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_variable_operations.py index bb54df1bd302..816ba342c5b6 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_variable_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_variable_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -37,10 +37,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,6 +73,9 @@ async def create_or_update( ) -> _models.Variable: """Create a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -108,6 +107,9 @@ async def create_or_update( ) -> _models.Variable: """Create a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -137,6 +139,9 @@ async def create_or_update( ) -> _models.Variable: """Create a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -144,7 +149,7 @@ async def create_or_update( :param variable_name: The variable name. Required. :type variable_name: str :param parameters: The parameters supplied to the create or update variable operation. Is - either a model type or a IO type. Required. + either a VariableCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.VariableCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -165,14 +170,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VariableCreateOrUpdateParameters") @@ -193,8 +198,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -232,6 +238,9 @@ async def update( ) -> _models.Variable: """Update a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,6 +271,9 @@ async def update( ) -> _models.Variable: """Update a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -290,14 +302,17 @@ async def update( ) -> _models.Variable: """Update a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param variable_name: The variable name. Required. :type variable_name: str - :param parameters: The parameters supplied to the update variable operation. Is either a model - type or a IO type. Required. + :param parameters: The parameters supplied to the update variable operation. Is either a + VariableUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.VariableUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -318,14 +333,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VariableUpdateParameters") @@ -346,8 +361,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -374,6 +390,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -396,7 +415,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -412,8 +431,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -436,6 +456,9 @@ async def get( ) -> _models.Variable: """Retrieve the variable identified by variable name. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -458,7 +481,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) request = build_get_request( @@ -474,8 +497,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -502,6 +526,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Variable"]: """Retrieve a list of variables. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -514,7 +541,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None) error_map = { @@ -557,8 +584,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_watcher_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_watcher_operations.py index 4dea29785374..58b8b8607ea4 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_watcher_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_watcher_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,10 +39,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,6 +75,9 @@ async def create_or_update( ) -> _models.Watcher: """Create the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -109,6 +108,9 @@ async def create_or_update( ) -> _models.Watcher: """Create the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -137,14 +139,17 @@ async def create_or_update( ) -> _models.Watcher: """Create the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param watcher_name: The watcher name. Required. :type watcher_name: str - :param parameters: The create or update parameters for watcher. Is either a model type or a IO - type. Required. + :param parameters: The create or update parameters for watcher. Is either a Watcher type or a + IO type. Required. :type parameters: ~azure.mgmt.automation.models.Watcher or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -165,16 +170,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Watcher] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Watcher") @@ -195,8 +198,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -227,6 +231,9 @@ async def get( ) -> _models.Watcher: """Retrieve the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -249,9 +256,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.Watcher] = kwargs.pop("cls", None) request = build_get_request( @@ -267,8 +272,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,6 +308,9 @@ async def update( ) -> _models.Watcher: """Update the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -332,6 +341,9 @@ async def update( ) -> _models.Watcher: """Update the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -360,14 +372,17 @@ async def update( ) -> _models.Watcher: """Update the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param watcher_name: The watcher name. Required. :type watcher_name: str - :param parameters: The update parameters for watcher. Is either a model type or a IO type. - Required. + :param parameters: The update parameters for watcher. Is either a WatcherUpdateParameters type + or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.WatcherUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -388,16 +403,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Watcher] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WatcherUpdateParameters") @@ -418,8 +431,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -446,6 +460,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the watcher by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -468,9 +485,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -486,8 +501,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -510,6 +526,9 @@ async def start( # pylint: disable=inconsistent-return-statements ) -> None: """Resume the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -532,9 +551,7 @@ async def start( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( @@ -550,8 +567,9 @@ async def start( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -574,6 +592,9 @@ async def stop( # pylint: disable=inconsistent-return-statements ) -> None: """Resume the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -596,9 +617,7 @@ async def stop( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -614,8 +633,9 @@ async def stop( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -638,6 +658,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Watcher"]: """Retrieve a list of watchers. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -652,9 +675,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.WatcherListResult] = kwargs.pop("cls", None) error_map = { @@ -698,8 +719,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_webhook_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_webhook_operations.py index ef4c7b057bff..f38126946b60 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_webhook_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/aio/operations/_webhook_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,10 +38,6 @@ ) from .._vendor import AutomationClientMixinABC -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -69,6 +65,9 @@ def __init__(self, *args, **kwargs) -> None: async def generate_uri(self, resource_group_name: str, automation_account_name: str, **kwargs: Any) -> str: """Generates a Uri for use in creating a webhook. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -89,7 +88,7 @@ async def generate_uri(self, resource_group_name: str, automation_account_name: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) cls: ClsType[str] = kwargs.pop("cls", None) request = build_generate_uri_request( @@ -104,8 +103,9 @@ async def generate_uri(self, resource_group_name: str, automation_account_name: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -132,6 +132,9 @@ async def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the webhook by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -154,7 +157,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -170,8 +173,9 @@ async def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -194,6 +198,9 @@ async def get( ) -> _models.Webhook: """Retrieve the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -216,7 +223,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) cls: ClsType[_models.Webhook] = kwargs.pop("cls", None) request = build_get_request( @@ -232,8 +239,9 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -267,6 +275,9 @@ async def create_or_update( ) -> _models.Webhook: """Create the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -297,6 +308,9 @@ async def create_or_update( ) -> _models.Webhook: """Create the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -325,14 +339,17 @@ async def create_or_update( ) -> _models.Webhook: """Create the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param webhook_name: The webhook name. Required. :type webhook_name: str - :param parameters: The create or update parameters for webhook. Is either a model type or a IO - type. Required. + :param parameters: The create or update parameters for webhook. Is either a + WebhookCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.WebhookCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -353,14 +370,14 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Webhook] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WebhookCreateOrUpdateParameters") @@ -381,8 +398,9 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -420,6 +438,9 @@ async def update( ) -> _models.Webhook: """Update the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -450,6 +471,9 @@ async def update( ) -> _models.Webhook: """Update the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -478,14 +502,17 @@ async def update( ) -> _models.Webhook: """Update the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param webhook_name: The webhook name. Required. :type webhook_name: str - :param parameters: The update parameters for webhook. Is either a model type or a IO type. - Required. + :param parameters: The update parameters for webhook. Is either a WebhookUpdateParameters type + or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.WebhookUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -506,14 +533,14 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Webhook] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WebhookUpdateParameters") @@ -534,8 +561,9 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -562,6 +590,9 @@ def list_by_automation_account( ) -> AsyncIterable["_models.Webhook"]: """Retrieve a list of webhooks. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -576,7 +607,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) cls: ClsType[_models.WebhookListResult] = kwargs.pop("cls", None) error_map = { @@ -620,8 +651,9 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_automation_client_enums.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_automation_client_enums.py index f1305838c80d..d1b234768c1e 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_automation_client_enums.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_automation_client_enums.py @@ -141,6 +141,7 @@ class HttpStatusCode(str, Enum, metaclass=CaseInsensitiveEnumMeta): SERVICE_UNAVAILABLE = "ServiceUnavailable" GATEWAY_TIMEOUT = "GatewayTimeout" HTTP_VERSION_NOT_SUPPORTED = "HttpVersionNotSupported" + CONTINUE_ENUM = "Continue" class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -279,8 +280,8 @@ class ScheduleFrequency(str, Enum, metaclass=CaseInsensitiveEnumMeta): HOUR = "Hour" WEEK = "Week" MONTH = "Month" - #: The minimum allowed interval for Minute schedules is 15 minutes. MINUTE = "Minute" + """The minimum allowed interval for Minute schedules is 15 minutes.""" class SkuNameEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models_py3.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models_py3.py index eab718b16728..55ff5316a54d 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models_py3.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/models/_models_py3.py @@ -76,8 +76,8 @@ def __init__( creation_time: Optional[datetime.datetime] = None, last_modified_time: Optional[datetime.datetime] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Gets or sets the id of the resource. :paramtype id: str @@ -119,7 +119,9 @@ class ActivityListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Activity"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Activity"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of activities. :paramtype value: list[~azure.mgmt.automation.models.Activity] @@ -145,7 +147,7 @@ class ActivityOutputType(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the activity output type. :paramtype name: str @@ -218,8 +220,8 @@ def __init__( value_from_remaining_arguments: Optional[bool] = None, description: Optional[str] = None, validation_set: Optional[List["_models.ActivityParameterValidationSet"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the activity parameter. :paramtype name: str @@ -281,8 +283,12 @@ class ActivityParameterSet(_serialization.Model): } def __init__( - self, *, name: Optional[str] = None, parameters: Optional[List["_models.ActivityParameter"]] = None, **kwargs - ): + self, + *, + name: Optional[str] = None, + parameters: Optional[List["_models.ActivityParameter"]] = None, + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the activity parameter set. :paramtype name: str @@ -305,7 +311,7 @@ class ActivityParameterValidationSet(_serialization.Model): "member_value": {"key": "memberValue", "type": "str"}, } - def __init__(self, *, member_value: Optional[str] = None, **kwargs): + def __init__(self, *, member_value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword member_value: Gets or sets the name of the activity parameter validation set member. :paramtype member_value: str @@ -338,8 +344,8 @@ def __init__( week_days: Optional[List[str]] = None, month_days: Optional[List[int]] = None, monthly_occurrences: Optional[List["_models.AdvancedScheduleMonthlyOccurrence"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword week_days: Days of the week that the job should execute on. :paramtype week_days: list[str] @@ -373,8 +379,12 @@ class AdvancedScheduleMonthlyOccurrence(_serialization.Model): } def __init__( - self, *, occurrence: Optional[int] = None, day: Optional[Union[str, "_models.ScheduleDay"]] = None, **kwargs - ): + self, + *, + occurrence: Optional[int] = None, + day: Optional[Union[str, "_models.ScheduleDay"]] = None, + **kwargs: Any + ) -> None: """ :keyword occurrence: Occurrence of the week within the month. Must be between 1 and 5. :paramtype occurrence: int @@ -415,8 +425,8 @@ def __init__( endpoint: Optional[str] = None, keys: Optional["_models.AgentRegistrationKeys"] = None, id: Optional[str] = None, # pylint: disable=redefined-builtin - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword dsc_meta_configuration: Gets or sets the dsc meta configuration. :paramtype dsc_meta_configuration: str @@ -448,7 +458,7 @@ class AgentRegistrationKeys(_serialization.Model): "secondary": {"key": "secondary", "type": "str"}, } - def __init__(self, *, primary: Optional[str] = None, secondary: Optional[str] = None, **kwargs): + def __init__(self, *, primary: Optional[str] = None, secondary: Optional[str] = None, **kwargs: Any) -> None: """ :keyword primary: Gets or sets the primary key. :paramtype primary: str @@ -478,7 +488,7 @@ class AgentRegistrationRegenerateKeyParameter(_serialization.Model): "key_name": {"key": "keyName", "type": "str"}, } - def __init__(self, *, key_name: Union[str, "_models.AgentRegistrationKeyName"], **kwargs): + def __init__(self, *, key_name: Union[str, "_models.AgentRegistrationKeyName"], **kwargs: Any) -> None: """ :keyword key_name: Gets or sets the agent registration key name - primary or secondary. Required. Known values are: "primary" and "secondary". @@ -513,7 +523,7 @@ class Resource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -552,7 +562,7 @@ class TrackedResource(Resource): "location": {"key": "location", "type": "str"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, **kwargs: Any) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -663,8 +673,8 @@ def __init__( public_network_access: Optional[bool] = None, disable_local_auth: Optional[bool] = None, automation_hybrid_service_url: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -757,8 +767,8 @@ def __init__( encryption: Optional["_models.EncryptionProperties"] = None, public_network_access: Optional[bool] = None, disable_local_auth: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets name of the resource. :paramtype name: str @@ -805,8 +815,12 @@ class AutomationAccountListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.AutomationAccount"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.AutomationAccount"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: Gets or sets list of accounts. :paramtype value: list[~azure.mgmt.automation.models.AutomationAccount] @@ -862,8 +876,8 @@ def __init__( encryption: Optional["_models.EncryptionProperties"] = None, public_network_access: Optional[bool] = None, disable_local_auth: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the resource. :paramtype name: str @@ -918,8 +932,8 @@ def __init__( scope: Optional[List[str]] = None, locations: Optional[List[str]] = None, tag_settings: Optional["_models.TagSettingsProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword scope: List of Subscription or Resource Group ARM Ids. :paramtype scope: list[str] @@ -959,7 +973,7 @@ class ProxyResource(Resource): "type": {"key": "type", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) @@ -1012,7 +1026,7 @@ class Certificate(ProxyResource): "description": {"key": "properties.description", "type": "str"}, } - def __init__(self, *, description: Optional[str] = None, **kwargs): + def __init__(self, *, description: Optional[str] = None, **kwargs: Any) -> None: """ :keyword description: Gets or sets the description. :paramtype description: str @@ -1064,8 +1078,8 @@ def __init__( description: Optional[str] = None, thumbprint: Optional[str] = None, is_exportable: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the certificate. Required. :paramtype name: str @@ -1101,8 +1115,8 @@ class CertificateListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.Certificate"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.Certificate"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of certificates. :paramtype value: list[~azure.mgmt.automation.models.Certificate] @@ -1128,7 +1142,7 @@ class CertificateUpdateParameters(_serialization.Model): "description": {"key": "properties.description", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, description: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the certificate. :paramtype name: str @@ -1188,8 +1202,8 @@ def __init__( *, connection_type: Optional["_models.ConnectionTypeAssociationProperty"] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword connection_type: Gets or sets the connectionType of the connection. :paramtype connection_type: ~azure.mgmt.automation.models.ConnectionTypeAssociationProperty @@ -1238,8 +1252,8 @@ def __init__( connection_type: "_models.ConnectionTypeAssociationProperty", description: Optional[str] = None, field_definition_values: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the connection. Required. :paramtype name: str @@ -1273,8 +1287,8 @@ class ConnectionListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.Connection"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.Connection"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of connection. :paramtype value: list[~azure.mgmt.automation.models.Connection] @@ -1334,8 +1348,8 @@ def __init__( is_global: Optional[bool] = None, last_modified_time: Optional[datetime.datetime] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword is_global: Gets or sets a Boolean value to indicate if the connection type is global. :paramtype is_global: bool @@ -1366,7 +1380,7 @@ class ConnectionTypeAssociationProperty(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the connection type. :paramtype name: str @@ -1405,8 +1419,8 @@ def __init__( name: str, field_definitions: Dict[str, "_models.FieldDefinition"], is_global: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the connection type. Required. :paramtype name: str @@ -1437,8 +1451,8 @@ class ConnectionTypeListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.ConnectionType"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.ConnectionType"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of connection types. :paramtype value: list[~azure.mgmt.automation.models.ConnectionType] @@ -1473,8 +1487,8 @@ def __init__( name: Optional[str] = None, description: Optional[str] = None, field_definition_values: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the connection. :paramtype name: str @@ -1510,7 +1524,7 @@ class ContentHash(_serialization.Model): "value": {"key": "value", "type": "str"}, } - def __init__(self, *, algorithm: str, value: str, **kwargs): + def __init__(self, *, algorithm: str, value: str, **kwargs: Any) -> None: """ :keyword algorithm: Gets or sets the content hash algorithm used to hash the content. Required. :paramtype algorithm: str @@ -1545,8 +1559,8 @@ def __init__( uri: Optional[str] = None, content_hash: Optional["_models.ContentHash"] = None, version: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword uri: Gets or sets the uri of the runbook content. :paramtype uri: str @@ -1589,8 +1603,8 @@ def __init__( type: Optional[Union[str, "_models.ContentSourceType"]] = None, value: Optional[str] = None, version: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword hash: Gets or sets the hash. :paramtype hash: ~azure.mgmt.automation.models.ContentHash @@ -1650,7 +1664,7 @@ class Credential(ProxyResource): "description": {"key": "properties.description", "type": "str"}, } - def __init__(self, *, description: Optional[str] = None, **kwargs): + def __init__(self, *, description: Optional[str] = None, **kwargs: Any) -> None: """ :keyword description: Gets or sets the description. :paramtype description: str @@ -1690,7 +1704,9 @@ class CredentialCreateOrUpdateParameters(_serialization.Model): "description": {"key": "properties.description", "type": "str"}, } - def __init__(self, *, name: str, user_name: str, password: str, description: Optional[str] = None, **kwargs): + def __init__( + self, *, name: str, user_name: str, password: str, description: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the credential. Required. :paramtype name: str @@ -1723,8 +1739,8 @@ class CredentialListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.Credential"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.Credential"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of credentials. :paramtype value: list[~azure.mgmt.automation.models.Credential] @@ -1763,8 +1779,8 @@ def __init__( user_name: Optional[str] = None, password: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the credential. :paramtype name: str @@ -1830,8 +1846,8 @@ def __init__( automation_account_resource_id: Optional[str] = None, automation_account_id: Optional[str] = None, location_properties_location: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The resource id. :paramtype id: str @@ -1870,7 +1886,7 @@ class DeletedAutomationAccountListResult(_serialization.Model): "value": {"key": "value", "type": "[DeletedAutomationAccount]"}, } - def __init__(self, *, value: Optional[List["_models.DeletedAutomationAccount"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.DeletedAutomationAccount"]] = None, **kwargs: Any) -> None: """ :keyword value: Gets or sets the list of deleted automation accounts. :paramtype value: list[~azure.mgmt.automation.models.DeletedAutomationAccount] @@ -1893,7 +1909,7 @@ class Dimension(_serialization.Model): "display_name": {"key": "displayName", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, display_name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, display_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The name of the dimension. :paramtype name: str @@ -1993,8 +2009,8 @@ def __init__( status: Optional[Union[str, "_models.JobStatus"]] = None, status_details: Optional[str] = None, parameters: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword configuration: Gets or sets the configuration. :paramtype configuration: ~azure.mgmt.automation.models.DscConfigurationAssociationProperty @@ -2072,8 +2088,8 @@ def __init__( tags: Optional[Dict[str, str]] = None, parameters: Optional[Dict[str, str]] = None, increment_node_configuration_build: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets name of the resource. :paramtype name: str @@ -2113,8 +2129,12 @@ class DscCompilationJobListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.DscCompilationJob"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.DscCompilationJob"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of Dsc Compilation jobs. :paramtype value: list[~azure.mgmt.automation.models.DscCompilationJob] @@ -2208,8 +2228,8 @@ def __init__( last_modified_time: Optional[datetime.datetime] = None, node_configuration_count: Optional[int] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -2265,7 +2285,7 @@ class DscConfigurationAssociationProperty(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the Dsc configuration. :paramtype name: str @@ -2323,8 +2343,8 @@ def __init__( log_progress: Optional[bool] = None, parameters: Optional[Dict[str, "_models.DscConfigurationParameter"]] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets name of the resource. :paramtype name: str @@ -2377,8 +2397,8 @@ def __init__( value: Optional[List["_models.DscConfiguration"]] = None, next_link: Optional[str] = None, total_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of configurations. :paramtype value: list[~azure.mgmt.automation.models.DscConfiguration] @@ -2421,8 +2441,8 @@ def __init__( is_mandatory: Optional[bool] = None, position: Optional[int] = None, default_value: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: Gets or sets the type of the parameter. :paramtype type: str @@ -2480,8 +2500,8 @@ def __init__( source: Optional["_models.ContentSource"] = None, parameters: Optional[Dict[str, "_models.DscConfigurationParameter"]] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets name of the resource. :paramtype name: str @@ -2551,8 +2571,8 @@ def __init__( certificate_id: Optional[str] = None, refresh_frequency_mins: Optional[int] = None, allow_module_overwrite: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword configuration_mode_frequency_mins: Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. @@ -2658,8 +2678,8 @@ def __init__( total_count: Optional[int] = None, extension_handler: Optional[List["_models.DscNodeExtensionHandlerAssociationProperty"]] = None, name_properties_node_configuration_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword last_seen: Gets or sets the last seen time of the node. :paramtype last_seen: ~datetime.datetime @@ -2750,8 +2770,8 @@ def __init__( source: Optional[str] = None, node_count: Optional[int] = None, increment_node_configuration_build: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword last_modified_time: Gets or sets the last modified time. :paramtype last_modified_time: ~datetime.datetime @@ -2808,8 +2828,8 @@ def __init__( source: Optional["_models.ContentSource"] = None, configuration: Optional["_models.DscConfigurationAssociationProperty"] = None, increment_node_configuration_build: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Name of the node configuration. :paramtype name: str @@ -2854,8 +2874,8 @@ def __init__( value: Optional[List["_models.DscNodeConfiguration"]] = None, next_link: Optional[str] = None, total_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of Dsc node configurations. :paramtype value: list[~azure.mgmt.automation.models.DscNodeConfiguration] @@ -2884,7 +2904,7 @@ class DscNodeExtensionHandlerAssociationProperty(_serialization.Model): "version": {"key": "version", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, version: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, version: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the extension handler. :paramtype name: str @@ -2919,8 +2939,8 @@ def __init__( value: Optional[List["_models.DscNode"]] = None, next_link: Optional[str] = None, total_count: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of dsc nodes. :paramtype value: list[~azure.mgmt.automation.models.DscNode] @@ -3023,8 +3043,8 @@ def __init__( i_pv6_addresses: Optional[List[str]] = None, number_of_resources: Optional[int] = None, raw_errors: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword end_time: Gets or sets the end time of the node report. :paramtype end_time: ~datetime.datetime @@ -3103,8 +3123,8 @@ class DscNodeReportListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.DscNodeReport"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.DscNodeReport"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of dsc node reports. :paramtype value: list[~azure.mgmt.automation.models.DscNodeReport] @@ -3135,8 +3155,8 @@ def __init__( *, node_id: Optional[str] = None, properties: Optional["_models.DscNodeUpdateParametersProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword node_id: Gets or sets the id of the dsc node. :paramtype node_id: str @@ -3159,7 +3179,7 @@ class DscNodeUpdateParametersProperties(_serialization.Model): "name": {"key": "nodeConfiguration.name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the dsc node configuration. :paramtype name: str @@ -3203,8 +3223,8 @@ def __init__( error_message: Optional[str] = None, locale: Optional[str] = None, error_details: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword error_source: Gets or sets the source of the error. :paramtype error_source: str @@ -3280,8 +3300,8 @@ def __init__( status: Optional[str] = None, duration_in_seconds: Optional[float] = None, start_date: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword resource_id: Gets or sets the ID of the resource. :paramtype resource_id: str @@ -3329,7 +3349,7 @@ class DscReportResourceNavigation(_serialization.Model): "resource_id": {"key": "resourceId", "type": "str"}, } - def __init__(self, *, resource_id: Optional[str] = None, **kwargs): + def __init__(self, *, resource_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword resource_id: Gets or sets the ID of the resource to navigate to. :paramtype resource_id: str @@ -3362,8 +3382,8 @@ def __init__( key_vault_properties: Optional["_models.KeyVaultProperties"] = None, key_source: Optional[Union[str, "_models.EncryptionKeySourceType"]] = None, identity: Optional["_models.EncryptionPropertiesIdentity"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword key_vault_properties: Key vault properties. :paramtype key_vault_properties: ~azure.mgmt.automation.models.KeyVaultProperties @@ -3392,7 +3412,7 @@ class EncryptionPropertiesIdentity(_serialization.Model): "user_assigned_identity": {"key": "userAssignedIdentity", "type": "object"}, } - def __init__(self, *, user_assigned_identity: Optional[JSON] = None, **kwargs): + def __init__(self, *, user_assigned_identity: Optional[JSON] = None, **kwargs: Any) -> None: """ :keyword user_assigned_identity: The user identity used for CMK. It will be an ARM resource id in the form: @@ -3417,7 +3437,7 @@ class ErrorResponse(_serialization.Model): "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: Any) -> None: """ :keyword code: Error code. :paramtype code: str @@ -3452,7 +3472,9 @@ class FieldDefinition(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, type: str, is_encrypted: Optional[bool] = None, is_optional: Optional[bool] = None, **kwargs): + def __init__( + self, *, type: str, is_encrypted: Optional[bool] = None, is_optional: Optional[bool] = None, **kwargs: Any + ) -> None: """ :keyword is_encrypted: Gets or sets the isEncrypted flag of the connection field definition. :paramtype is_encrypted: bool @@ -3486,8 +3508,8 @@ def __init__( *, raw_content: Optional["_models.RawGraphicalRunbookContent"] = None, graph_runbook_json: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword raw_content: Raw graphical Runbook content. :paramtype raw_content: ~azure.mgmt.automation.models.RawGraphicalRunbookContent @@ -3555,8 +3577,8 @@ def __init__( vm_resource_id: Optional[str] = None, worker_type: Optional[Union[str, "_models.WorkerType"]] = None, worker_name: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword ip: Gets or sets the assigned machine IP address. :paramtype ip: str @@ -3595,7 +3617,7 @@ class HybridRunbookWorkerCreateParameters(_serialization.Model): "vm_resource_id": {"key": "properties.vmResourceId", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, vm_resource_id: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, vm_resource_id: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the resource. :paramtype name: str @@ -3647,8 +3669,8 @@ def __init__( *, group_type: Optional[Union[str, "_models.GroupTypeEnum"]] = None, credential: Optional["_models.RunAsCredentialAssociationProperty"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword group_type: Type of the HybridWorkerGroup. Known values are: "User" and "System". :paramtype group_type: str or ~azure.mgmt.automation.models.GroupTypeEnum @@ -3680,8 +3702,8 @@ def __init__( *, name: Optional[str] = None, credential: Optional["_models.RunAsCredentialAssociationProperty"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the resource. :paramtype name: str @@ -3712,8 +3734,8 @@ def __init__( *, value: Optional[List["_models.HybridRunbookWorkerGroup"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of hybrid runbook worker groups. :paramtype value: list[~azure.mgmt.automation.models.HybridRunbookWorkerGroup] @@ -3736,7 +3758,7 @@ class HybridRunbookWorkerMoveParameters(_serialization.Model): "hybrid_runbook_worker_group_name": {"key": "hybridRunbookWorkerGroupName", "type": "str"}, } - def __init__(self, *, hybrid_runbook_worker_group_name: Optional[str] = None, **kwargs): + def __init__(self, *, hybrid_runbook_worker_group_name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword hybrid_runbook_worker_group_name: Gets or sets the target hybrid runbook worker group. :paramtype hybrid_runbook_worker_group_name: str @@ -3760,8 +3782,12 @@ class HybridRunbookWorkersListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.HybridRunbookWorker"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.HybridRunbookWorker"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of hybrid runbook workers. :paramtype value: list[~azure.mgmt.automation.models.HybridRunbookWorker] @@ -3809,8 +3835,8 @@ def __init__( *, type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentitiesProperties"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: The identity type. Known values are: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None". @@ -3916,8 +3942,8 @@ def __init__( last_status_modified_time: Optional[datetime.datetime] = None, parameters: Optional[Dict[str, str]] = None, provisioning_state: Optional[Union[str, "_models.JobProvisioningState"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword runbook: Gets or sets the runbook. :paramtype runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty @@ -4031,7 +4057,7 @@ class JobCollectionItem(ProxyResource): # pylint: disable=too-many-instance-att "run_on": {"key": "properties.runOn", "type": "str"}, } - def __init__(self, *, run_on: Optional[str] = None, **kwargs): + def __init__(self, *, run_on: Optional[str] = None, **kwargs: Any) -> None: """ :keyword run_on: Specifies the runOn group name where the job was executed. :paramtype run_on: str @@ -4072,8 +4098,8 @@ def __init__( runbook: Optional["_models.RunbookAssociationProperty"] = None, parameters: Optional[Dict[str, str]] = None, run_on: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword runbook: Gets or sets the runbook. :paramtype runbook: ~azure.mgmt.automation.models.RunbookAssociationProperty @@ -4109,7 +4135,7 @@ class JobListResultV2(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.JobCollectionItem"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.JobCollectionItem"]] = None, **kwargs: Any) -> None: """ :keyword value: List of jobs. :paramtype value: list[~azure.mgmt.automation.models.JobCollectionItem] @@ -4136,7 +4162,7 @@ class JobNavigation(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -4190,8 +4216,8 @@ def __init__( runbook: Optional["_models.RunbookAssociationProperty"] = None, run_on: Optional[str] = None, parameters: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword job_schedule_id: Gets or sets the id of job schedule. :paramtype job_schedule_id: str @@ -4249,8 +4275,8 @@ def __init__( runbook: "_models.RunbookAssociationProperty", run_on: Optional[str] = None, parameters: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword schedule: Gets or sets the schedule. Required. :paramtype schedule: ~azure.mgmt.automation.models.ScheduleAssociationProperty @@ -4283,8 +4309,8 @@ class JobScheduleListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.JobSchedule"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.JobSchedule"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of job schedules. :paramtype value: list[~azure.mgmt.automation.models.JobSchedule] @@ -4336,8 +4362,8 @@ def __init__( stream_text: Optional[str] = None, summary: Optional[str] = None, value: Optional[Dict[str, JSON]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Gets or sets the id of the resource. :paramtype id: str @@ -4379,7 +4405,9 @@ class JobStreamListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.JobStream"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.JobStream"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: A list of job streams. :paramtype value: list[~azure.mgmt.automation.models.JobStream] @@ -4416,7 +4444,7 @@ class Key(_serialization.Model): "value": {"key": "Value", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.key_name = None @@ -4435,7 +4463,7 @@ class KeyListResult(_serialization.Model): "keys": {"key": "keys", "type": "[Key]"}, } - def __init__(self, *, keys: Optional[List["_models.Key"]] = None, **kwargs): + def __init__(self, *, keys: Optional[List["_models.Key"]] = None, **kwargs: Any) -> None: """ :keyword keys: Lists the automation keys. :paramtype keys: list[~azure.mgmt.automation.models.Key] @@ -4467,8 +4495,8 @@ def __init__( keyvault_uri: Optional[str] = None, key_name: Optional[str] = None, key_version: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword keyvault_uri: The URI of the key vault key used to encrypt data. :paramtype keyvault_uri: str @@ -4500,7 +4528,7 @@ class LinkedWorkspace(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.id = None @@ -4535,8 +4563,8 @@ def __init__( excluded_package_name_masks: Optional[List[str]] = None, included_package_name_masks: Optional[List[str]] = None, reboot_setting: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword included_package_classifications: Update classifications included in the software update configuration. Known values are: "Unclassified", "Critical", "Security", and "Other". @@ -4579,8 +4607,8 @@ def __init__( name: Optional[str] = None, display_name: Optional[str] = None, blob_duration: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the specification. :paramtype name: str @@ -4630,8 +4658,8 @@ def __init__( unit: Optional[str] = None, aggregation_type: Optional[str] = None, dimensions: Optional[List["_models.Dimension"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: The name of the metric. :paramtype name: str @@ -4743,8 +4771,8 @@ def __init__( last_modified_time: Optional[datetime.datetime] = None, description: Optional[str] = None, is_composite: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -4827,8 +4855,8 @@ def __init__( name: Optional[str] = None, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets name of the resource. :paramtype name: str @@ -4860,7 +4888,7 @@ class ModuleErrorInfo(_serialization.Model): "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: Any) -> None: """ :keyword code: Gets or sets the error code. :paramtype code: str @@ -4886,7 +4914,9 @@ class ModuleListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Module"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Module"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of modules. :paramtype value: list[~azure.mgmt.automation.models.Module] @@ -4925,8 +4955,8 @@ def __init__( location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, content_link: Optional["_models.ContentLink"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets name of the resource. :paramtype name: str @@ -4959,8 +4989,8 @@ class NodeCount(_serialization.Model): } def __init__( - self, *, name: Optional[str] = None, properties: Optional["_models.NodeCountProperties"] = None, **kwargs - ): + self, *, name: Optional[str] = None, properties: Optional["_models.NodeCountProperties"] = None, **kwargs: Any + ) -> None: """ :keyword name: Gets the name of a count type. :paramtype name: str @@ -4983,7 +5013,7 @@ class NodeCountProperties(_serialization.Model): "count": {"key": "count", "type": "int"}, } - def __init__(self, *, count: Optional[int] = None, **kwargs): + def __init__(self, *, count: Optional[int] = None, **kwargs: Any) -> None: """ :keyword count: Gets the count for the name. :paramtype count: int @@ -5007,8 +5037,8 @@ class NodeCounts(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.NodeCount"]] = None, total_count: Optional[int] = None, **kwargs - ): + self, *, value: Optional[List["_models.NodeCount"]] = None, total_count: Optional[int] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets an array of counts. :paramtype value: list[~azure.mgmt.automation.models.NodeCount] @@ -5034,7 +5064,9 @@ class NonAzureQueryProperties(_serialization.Model): "workspace_id": {"key": "workspaceId", "type": "str"}, } - def __init__(self, *, function_alias: Optional[str] = None, workspace_id: Optional[str] = None, **kwargs): + def __init__( + self, *, function_alias: Optional[str] = None, workspace_id: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword function_alias: Log Analytics Saved Search name. :paramtype function_alias: str @@ -5077,8 +5109,8 @@ def __init__( display: Optional["_models.OperationDisplay"] = None, origin: Optional[str] = None, service_specification: Optional["_models.OperationPropertiesFormatServiceSpecification"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str @@ -5124,8 +5156,8 @@ def __init__( resource: Optional[str] = None, operation: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword provider: Service provider: Microsoft.Automation. :paramtype provider: str @@ -5154,7 +5186,7 @@ class OperationListResult(_serialization.Model): "value": {"key": "value", "type": "[Operation]"}, } - def __init__(self, *, value: Optional[List["_models.Operation"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.Operation"]] = None, **kwargs: Any) -> None: """ :keyword value: List of Automation operations supported by the Automation resource provider. :paramtype value: list[~azure.mgmt.automation.models.Operation] @@ -5182,8 +5214,8 @@ def __init__( *, metric_specifications: Optional[List["_models.MetricSpecification"]] = None, log_specifications: Optional[List["_models.LogSpecification"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword metric_specifications: Operation service specification. :paramtype metric_specifications: list[~azure.mgmt.automation.models.MetricSpecification] @@ -5240,8 +5272,8 @@ def __init__( private_endpoint: Optional["_models.PrivateEndpointProperty"] = None, group_ids: Optional[List[str]] = None, private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword private_endpoint: Private endpoint which the connection belongs to. :paramtype private_endpoint: ~azure.mgmt.automation.models.PrivateEndpointProperty @@ -5269,7 +5301,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: """ :keyword value: Array of private endpoint connections. :paramtype value: list[~azure.mgmt.automation.models.PrivateEndpointConnection] @@ -5289,7 +5321,7 @@ class PrivateEndpointProperty(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Resource id of the private endpoint. :paramtype id: str @@ -5331,7 +5363,7 @@ class PrivateLinkResource(ProxyResource): "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.group_id = None @@ -5349,7 +5381,7 @@ class PrivateLinkResourceListResult(_serialization.Model): "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: """ :keyword value: Array of private link resources. :paramtype value: list[~azure.mgmt.automation.models.PrivateLinkResource] @@ -5382,7 +5414,7 @@ class PrivateLinkServiceConnectionStateProperty(_serialization.Model): "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs): + def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None: """ :keyword status: The private link service connection status. :paramtype status: str @@ -5415,7 +5447,9 @@ class PythonPackageCreateParameters(_serialization.Model): "content_link": {"key": "properties.contentLink", "type": "ContentLink"}, } - def __init__(self, *, content_link: "_models.ContentLink", tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__( + self, *, content_link: "_models.ContentLink", tags: Optional[Dict[str, str]] = None, **kwargs: Any + ) -> None: """ :keyword tags: Gets or sets the tags attached to the resource. :paramtype tags: dict[str, str] @@ -5438,7 +5472,7 @@ class PythonPackageUpdateParameters(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword tags: Gets or sets the tags attached to the resource. :paramtype tags: dict[str, str] @@ -5471,8 +5505,8 @@ def __init__( schema_version: Optional[str] = None, runbook_definition: Optional[str] = None, runbook_type: Optional[Union[str, "_models.GraphRunbookType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword schema_version: Schema version of the serializer. :paramtype schema_version: str @@ -5499,7 +5533,7 @@ class RunAsCredentialAssociationProperty(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the credential. :paramtype name: str @@ -5612,8 +5646,8 @@ def __init__( creation_time: Optional[datetime.datetime] = None, last_modified_time: Optional[datetime.datetime] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -5686,7 +5720,7 @@ class RunbookAssociationProperty(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the runbook. :paramtype name: str @@ -5712,7 +5746,7 @@ class RunbookCreateOrUpdateDraftParameters(_serialization.Model): "runbook_content": {"key": "runbookContent", "type": "str"}, } - def __init__(self, *, runbook_content: str, **kwargs): + def __init__(self, *, runbook_content: str, **kwargs: Any) -> None: """ :keyword runbook_content: Content of the Runbook. Required. :paramtype runbook_content: str @@ -5765,8 +5799,8 @@ def __init__( log_progress: Optional[bool] = None, description: Optional[str] = None, log_activity_trace: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword log_verbose: Gets or sets verbose log option. :paramtype log_verbose: bool @@ -5851,8 +5885,8 @@ def __init__( publish_content_link: Optional["_models.ContentLink"] = None, description: Optional[str] = None, log_activity_trace: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the resource. :paramtype name: str @@ -5925,8 +5959,8 @@ def __init__( last_modified_time: Optional[datetime.datetime] = None, parameters: Optional[Dict[str, "_models.RunbookParameter"]] = None, output_types: Optional[List[str]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword in_edit: Gets or sets whether runbook is in edit mode. :paramtype in_edit: bool @@ -5962,7 +5996,7 @@ class RunbookDraftUndoEditResult(_serialization.Model): "LengthRequired", "PreconditionFailed", "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", - and "HttpVersionNotSupported". + "HttpVersionNotSupported", and "Continue". :vartype status_code: str or ~azure.mgmt.automation.models.HttpStatusCode :ivar request_id: :vartype request_id: str @@ -5978,8 +6012,8 @@ def __init__( *, status_code: Optional[Union[str, "_models.HttpStatusCode"]] = None, request_id: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword status_code: Known values are: "Continue", "SwitchingProtocols", "OK", "Created", "Accepted", "NonAuthoritativeInformation", "NoContent", "ResetContent", "PartialContent", @@ -5990,7 +6024,7 @@ def __init__( "LengthRequired", "PreconditionFailed", "RequestEntityTooLarge", "RequestUriTooLong", "UnsupportedMediaType", "RequestedRangeNotSatisfiable", "ExpectationFailed", "UpgradeRequired", "InternalServerError", "NotImplemented", "BadGateway", "ServiceUnavailable", "GatewayTimeout", - and "HttpVersionNotSupported". + "HttpVersionNotSupported", and "Continue". :paramtype status_code: str or ~azure.mgmt.automation.models.HttpStatusCode :keyword request_id: :paramtype request_id: str @@ -6014,7 +6048,9 @@ class RunbookListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Runbook"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Runbook"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of runbooks. :paramtype value: list[~azure.mgmt.automation.models.Runbook] @@ -6054,8 +6090,8 @@ def __init__( is_mandatory: Optional[bool] = None, position: Optional[int] = None, default_value: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword type: Gets or sets the type of the parameter. :paramtype type: str @@ -6113,8 +6149,8 @@ def __init__( log_verbose: Optional[bool] = None, log_progress: Optional[bool] = None, log_activity_trace: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the resource. :paramtype name: str @@ -6226,8 +6262,8 @@ def __init__( creation_time: Optional[datetime.datetime] = None, last_modified_time: Optional[datetime.datetime] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword start_time: Gets or sets the start time of the schedule. :paramtype start_time: ~datetime.datetime @@ -6285,7 +6321,7 @@ class ScheduleAssociationProperty(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the Schedule. :paramtype name: str @@ -6346,8 +6382,8 @@ def __init__( interval: Optional[Any] = None, time_zone: Optional[str] = None, advanced_schedule: Optional["_models.AdvancedSchedule"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the Schedule. Required. :paramtype name: str @@ -6392,7 +6428,9 @@ class ScheduleListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Schedule"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Schedule"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of schedules. :paramtype value: list[~azure.mgmt.automation.models.Schedule] @@ -6427,8 +6465,8 @@ def __init__( name: Optional[str] = None, description: Optional[str] = None, is_enabled: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the Schedule. :paramtype name: str @@ -6473,8 +6511,8 @@ def __init__( name: Union[str, "_models.SkuNameEnum"], family: Optional[str] = None, capacity: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the SKU name of the account. Required. Known values are: "Free" and "Basic". @@ -6560,8 +6598,8 @@ def __init__( schedule_info: "_models.SUCScheduleProperties", error: Optional["_models.ErrorResponse"] = None, tasks: Optional["_models.SoftwareUpdateConfigurationTasks"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword update_configuration: update specific properties for the Software update configuration. Required. @@ -6648,8 +6686,8 @@ def __init__( frequency: Optional[Union[str, "_models.ScheduleFrequency"]] = None, start_time: Optional[datetime.datetime] = None, next_run: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword update_configuration: Update specific properties of the software update configuration. :paramtype update_configuration: ~azure.mgmt.automation.models.UpdateConfiguration @@ -6687,7 +6725,9 @@ class SoftwareUpdateConfigurationListResult(_serialization.Model): "value": {"key": "value", "type": "[SoftwareUpdateConfigurationCollectionItem]"}, } - def __init__(self, *, value: Optional[List["_models.SoftwareUpdateConfigurationCollectionItem"]] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.SoftwareUpdateConfigurationCollectionItem"]] = None, **kwargs: Any + ) -> None: """ :keyword value: outer object returned when listing all software update configurations. :paramtype value: list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationCollectionItem] @@ -6788,8 +6828,8 @@ def __init__( software_update_configuration: Optional["_models.UpdateConfigurationNavigation"] = None, job: Optional["_models.JobNavigation"] = None, error: Optional["_models.ErrorResponse"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword software_update_configuration: software update configuration triggered this run. :paramtype software_update_configuration: @@ -6839,8 +6879,8 @@ def __init__( *, value: Optional[List["_models.SoftwareUpdateConfigurationMachineRun"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: outer object returned when listing all software update configuration machine runs. @@ -6933,8 +6973,8 @@ def __init__( *, software_update_configuration: Optional["_models.UpdateConfigurationNavigation"] = None, tasks: Optional["_models.SoftwareUpdateConfigurationRunTasks"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword software_update_configuration: software update configuration triggered this run. :paramtype software_update_configuration: @@ -6979,8 +7019,8 @@ def __init__( *, value: Optional[List["_models.SoftwareUpdateConfigurationRun"]] = None, next_link: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: outer object returned when listing all software update configuration runs. :paramtype value: list[~azure.mgmt.automation.models.SoftwareUpdateConfigurationRun] @@ -7010,8 +7050,8 @@ class SoftwareUpdateConfigurationRunTaskProperties(_serialization.Model): } def __init__( - self, *, status: Optional[str] = None, source: Optional[str] = None, job_id: Optional[str] = None, **kwargs - ): + self, *, status: Optional[str] = None, source: Optional[str] = None, job_id: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword status: The status of the task. :paramtype status: str @@ -7045,8 +7085,8 @@ def __init__( *, pre_task: Optional["_models.SoftwareUpdateConfigurationRunTaskProperties"] = None, post_task: Optional["_models.SoftwareUpdateConfigurationRunTaskProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword pre_task: Pre task properties. :paramtype pre_task: ~azure.mgmt.automation.models.SoftwareUpdateConfigurationRunTaskProperties @@ -7078,8 +7118,8 @@ def __init__( *, pre_task: Optional["_models.TaskProperties"] = None, post_task: Optional["_models.TaskProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword pre_task: Pre task properties. :paramtype pre_task: ~azure.mgmt.automation.models.TaskProperties @@ -7157,8 +7197,8 @@ def __init__( description: Optional[str] = None, creation_time: Optional[datetime.datetime] = None, last_modified_time: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword repo_url: The repo url of the source control. :paramtype repo_url: str @@ -7245,8 +7285,8 @@ def __init__( source_type: Optional[Union[str, "_models.SourceType"]] = None, security_token: Optional["_models.SourceControlSecurityTokenProperties"] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword repo_url: The repo url of the source control. :paramtype repo_url: str @@ -7293,8 +7333,8 @@ class SourceControlListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.SourceControl"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, *, value: Optional[List["_models.SourceControl"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: The list of source controls. :paramtype value: list[~azure.mgmt.automation.models.SourceControl] @@ -7335,8 +7375,8 @@ def __init__( access_token: Optional[str] = None, refresh_token: Optional[str] = None, token_type: Optional[Union[str, "_models.TokenType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword access_token: The access token. :paramtype access_token: str @@ -7405,8 +7445,8 @@ def __init__( source_control_sync_job_id: Optional[str] = None, provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None, sync_type: Optional[Union[str, "_models.SyncType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword source_control_sync_job_id: The source control sync job id. :paramtype source_control_sync_job_id: str @@ -7477,8 +7517,8 @@ def __init__( provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None, sync_type: Optional[Union[str, "_models.SyncType"]] = None, exception: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: The id of the job. :paramtype id: str @@ -7521,7 +7561,7 @@ class SourceControlSyncJobCreateParameters(_serialization.Model): "commit_id": {"key": "properties.commitId", "type": "str"}, } - def __init__(self, *, commit_id: str, **kwargs): + def __init__(self, *, commit_id: str, **kwargs: Any) -> None: """ :keyword commit_id: The commit id of the source control sync job. If not syncing to a commitId, enter an empty string. Required. @@ -7546,8 +7586,12 @@ class SourceControlSyncJobListResult(_serialization.Model): } def __init__( - self, *, value: Optional[List["_models.SourceControlSyncJob"]] = None, next_link: Optional[str] = None, **kwargs - ): + self, + *, + value: Optional[List["_models.SourceControlSyncJob"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword value: The list of source control sync jobs. :paramtype value: list[~azure.mgmt.automation.models.SourceControlSyncJob] @@ -7595,8 +7639,8 @@ def __init__( source_control_sync_job_stream_id: Optional[str] = None, summary: Optional[str] = None, stream_type: Optional[Union[str, "_models.StreamType"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword source_control_sync_job_stream_id: The sync job stream id. :paramtype source_control_sync_job_stream_id: str @@ -7657,8 +7701,8 @@ def __init__( stream_type: Optional[Union[str, "_models.StreamType"]] = None, stream_text: Optional[str] = None, value: Optional[Dict[str, JSON]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword source_control_sync_job_stream_id: The sync job stream id. :paramtype source_control_sync_job_stream_id: str @@ -7701,7 +7745,7 @@ class SourceControlSyncJobStreamsListBySyncJob(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.SourceControlSyncJobStream"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.SourceControlSyncJobStream"]] = None, **kwargs: Any) -> None: """ :keyword value: The list of source control sync job streams. :paramtype value: list[~azure.mgmt.automation.models.SourceControlSyncJobStream] @@ -7746,8 +7790,8 @@ def __init__( publish_runbook: Optional[bool] = None, security_token: Optional["_models.SourceControlSecurityTokenProperties"] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword branch: The repo branch of the source control. :paramtype branch: str @@ -7804,7 +7848,7 @@ class Statistics(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.counter_property = None @@ -7825,7 +7869,7 @@ class StatisticsListResult(_serialization.Model): "value": {"key": "value", "type": "[Statistics]"}, } - def __init__(self, *, value: Optional[List["_models.Statistics"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.Statistics"]] = None, **kwargs: Any) -> None: """ :keyword value: Gets or sets a list of statistics. :paramtype value: list[~azure.mgmt.automation.models.Statistics] @@ -7907,8 +7951,8 @@ def __init__( creation_time: Optional[datetime.datetime] = None, last_modified_time: Optional[datetime.datetime] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword start_time: Gets or sets the start time of the schedule. :paramtype start_time: ~datetime.datetime @@ -7992,8 +8036,8 @@ def __init__( last_modified_by: Optional[str] = None, last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str @@ -8039,8 +8083,8 @@ def __init__( *, tags: Optional[Dict[str, List[str]]] = None, filter_operator: Optional[Union[str, "_models.TagOperators"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword tags: Dictionary of tags with its list of values. :paramtype tags: dict[str, list[str]] @@ -8072,8 +8116,8 @@ def __init__( *, azure_queries: Optional[List["_models.AzureQueryProperties"]] = None, non_azure_queries: Optional[List["_models.NonAzureQueryProperties"]] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword azure_queries: List of Azure queries in the software update configuration. :paramtype azure_queries: list[~azure.mgmt.automation.models.AzureQueryProperties] @@ -8099,7 +8143,9 @@ class TaskProperties(_serialization.Model): "source": {"key": "source", "type": "str"}, } - def __init__(self, *, parameters: Optional[Dict[str, str]] = None, source: Optional[str] = None, **kwargs): + def __init__( + self, *, parameters: Optional[Dict[str, str]] = None, source: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword parameters: Gets or sets the parameters of the task. :paramtype parameters: dict[str, str] @@ -8167,8 +8213,8 @@ def __init__( last_status_modified_time: Optional[datetime.datetime] = None, parameters: Optional[Dict[str, str]] = None, log_activity_trace: Optional[int] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword creation_time: Gets or sets the creation time of the test job. :paramtype creation_time: ~datetime.datetime @@ -8223,7 +8269,9 @@ class TestJobCreateParameters(_serialization.Model): "run_on": {"key": "runOn", "type": "str"}, } - def __init__(self, *, parameters: Optional[Dict[str, str]] = None, run_on: Optional[str] = None, **kwargs): + def __init__( + self, *, parameters: Optional[Dict[str, str]] = None, run_on: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword parameters: Gets or sets the parameters of the test job. :paramtype parameters: dict[str, str] @@ -8250,7 +8298,7 @@ class TypeField(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs): + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Gets or sets the name of the field. :paramtype name: str @@ -8273,7 +8321,7 @@ class TypeFieldListResult(_serialization.Model): "value": {"key": "value", "type": "[TypeField]"}, } - def __init__(self, *, value: Optional[List["_models.TypeField"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.TypeField"]] = None, **kwargs: Any) -> None: """ :keyword value: Gets or sets a list of fields. :paramtype value: list[~azure.mgmt.automation.models.TypeField] @@ -8331,8 +8379,8 @@ def __init__( azure_virtual_machines: Optional[List[str]] = None, non_azure_computer_names: Optional[List[str]] = None, targets: Optional["_models.TargetProperties"] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword operating_system: operating system of target machines. Required. Known values are: "Windows" and "Linux". @@ -8381,7 +8429,7 @@ class UpdateConfigurationNavigation(_serialization.Model): "name": {"key": "name", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.name = None @@ -8422,8 +8470,8 @@ def __init__( current_value: Optional[float] = None, limit: Optional[int] = None, throttle_status: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword id: Gets or sets the id of the resource. :paramtype id: str @@ -8461,7 +8509,7 @@ class UsageCounterName(_serialization.Model): "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs): + def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs: Any) -> None: """ :keyword value: Gets or sets the usage counter name. :paramtype value: str @@ -8484,7 +8532,7 @@ class UsageListResult(_serialization.Model): "value": {"key": "value", "type": "[Usage]"}, } - def __init__(self, *, value: Optional[List["_models.Usage"]] = None, **kwargs): + def __init__(self, *, value: Optional[List["_models.Usage"]] = None, **kwargs: Any) -> None: """ :keyword value: Gets or sets usage. :paramtype value: list[~azure.mgmt.automation.models.Usage] @@ -8514,7 +8562,7 @@ class UserAssignedIdentitiesProperties(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__(self, **kwargs): + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.principal_id = None @@ -8569,8 +8617,8 @@ def __init__( creation_time: Optional[datetime.datetime] = None, last_modified_time: Optional[datetime.datetime] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword value: Gets or sets the value of the variable. :paramtype value: str @@ -8624,8 +8672,8 @@ def __init__( value: Optional[str] = None, description: Optional[str] = None, is_encrypted: Optional[bool] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the variable. Required. :paramtype name: str @@ -8657,7 +8705,9 @@ class VariableListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Variable"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Variable"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of variables. :paramtype value: list[~azure.mgmt.automation.models.Variable] @@ -8687,8 +8737,13 @@ class VariableUpdateParameters(_serialization.Model): } def __init__( - self, *, name: Optional[str] = None, value: Optional[str] = None, description: Optional[str] = None, **kwargs - ): + self, + *, + name: Optional[str] = None, + value: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the variable. :paramtype name: str @@ -8781,8 +8836,8 @@ def __init__( script_parameters: Optional[Dict[str, str]] = None, script_run_on: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword etag: Gets or sets the etag of the resource. :paramtype etag: str @@ -8833,7 +8888,9 @@ class WatcherListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Watcher"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Watcher"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of watchers. :paramtype value: list[~azure.mgmt.automation.models.Watcher] @@ -8860,7 +8917,9 @@ class WatcherUpdateParameters(_serialization.Model): "execution_frequency_in_seconds": {"key": "properties.executionFrequencyInSeconds", "type": "int"}, } - def __init__(self, *, name: Optional[str] = None, execution_frequency_in_seconds: Optional[int] = None, **kwargs): + def __init__( + self, *, name: Optional[str] = None, execution_frequency_in_seconds: Optional[int] = None, **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the resource. :paramtype name: str @@ -8946,8 +9005,8 @@ def __init__( last_modified_time: Optional[datetime.datetime] = None, last_modified_by: Optional[str] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword is_enabled: Gets or sets the value of the enabled flag of the webhook. :paramtype is_enabled: bool @@ -9032,8 +9091,8 @@ def __init__( parameters: Optional[Dict[str, str]] = None, runbook: Optional["_models.RunbookAssociationProperty"] = None, run_on: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the webhook. Required. :paramtype name: str @@ -9074,7 +9133,9 @@ class WebhookListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.Webhook"]] = None, next_link: Optional[str] = None, **kwargs): + def __init__( + self, *, value: Optional[List["_models.Webhook"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword value: Gets or sets a list of webhooks. :paramtype value: list[~azure.mgmt.automation.models.Webhook] @@ -9117,8 +9178,8 @@ def __init__( run_on: Optional[str] = None, parameters: Optional[Dict[str, str]] = None, description: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword name: Gets or sets the name of the webhook. :paramtype name: str @@ -9170,8 +9231,8 @@ def __init__( excluded_kb_numbers: Optional[List[str]] = None, included_kb_numbers: Optional[List[str]] = None, reboot_setting: Optional[str] = None, - **kwargs - ): + **kwargs: Any + ) -> None: """ :keyword included_update_classifications: Update classification included in the software update configuration. A comma separated string with required values. Known values are: "Unclassified", diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_activity_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_activity_operations.py index 7838406aef1b..ef2b116f4f0c 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_activity_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_activity_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +64,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,7 +81,7 @@ def build_list_by_module_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +98,7 @@ def build_list_by_module_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,6 +139,9 @@ def get( ) -> _models.Activity: """Retrieve the activity in the module identified by module name and activity name. + .. seealso:: + - http://aka.ms/azureautomationsdk/activityoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -168,7 +166,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Activity] = kwargs.pop("cls", None) request = build_get_request( @@ -185,8 +183,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -213,6 +212,9 @@ def list_by_module( ) -> Iterable["_models.Activity"]: """Retrieve a list of activities in the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/activityoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -227,7 +229,7 @@ def list_by_module( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ActivityListResult] = kwargs.pop("cls", None) error_map = { @@ -271,8 +273,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_agent_registration_information_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_agent_registration_information_operations.py index d87013f69d5a..9f9944c66916 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_agent_registration_information_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_agent_registration_information_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -26,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +41,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +57,7 @@ def build_get_request( "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,9 +74,7 @@ def build_regenerate_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -99,7 +91,7 @@ def build_regenerate_key_request( "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,6 +127,9 @@ def __init__(self, *args, **kwargs): def get(self, resource_group_name: str, automation_account_name: str, **kwargs: Any) -> _models.AgentRegistration: """Retrieve the automation agent registration information. + .. seealso:: + - http://aka.ms/azureautomationsdk/agentregistrationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -155,9 +150,7 @@ def get(self, resource_group_name: str, automation_account_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.AgentRegistration] = kwargs.pop("cls", None) request = build_get_request( @@ -172,8 +165,9 @@ def get(self, resource_group_name: str, automation_account_name: str, **kwargs: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -206,6 +200,9 @@ def regenerate_key( ) -> _models.AgentRegistration: """Regenerate a primary or secondary agent registration key. + .. seealso:: + - http://aka.ms/azureautomationsdk/agentregistrationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -233,6 +230,9 @@ def regenerate_key( ) -> _models.AgentRegistration: """Regenerate a primary or secondary agent registration key. + .. seealso:: + - http://aka.ms/azureautomationsdk/agentregistrationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -258,12 +258,15 @@ def regenerate_key( ) -> _models.AgentRegistration: """Regenerate a primary or secondary agent registration key. + .. seealso:: + - http://aka.ms/azureautomationsdk/agentregistrationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str - :param parameters: The name of the agent registration key to be regenerated. Is either a model - type or a IO type. Required. + :param parameters: The name of the agent registration key to be regenerated. Is either a + AgentRegistrationRegenerateKeyParameter type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.AgentRegistrationRegenerateKeyParameter or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -284,16 +287,14 @@ def regenerate_key( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AgentRegistration] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "AgentRegistrationRegenerateKeyParameter") @@ -313,8 +314,9 @@ def regenerate_key( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_account_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_account_operations.py index 3820d0877719..b1064da216a8 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_account_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_account_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -63,7 +59,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -99,7 +95,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,7 +114,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +130,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +147,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -167,7 +163,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -182,7 +178,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -197,7 +193,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -212,7 +208,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -223,7 +219,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -265,6 +261,9 @@ def update( ) -> _models.AutomationAccount: """Update an automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -292,6 +291,9 @@ def update( ) -> _models.AutomationAccount: """Update an automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -317,12 +319,15 @@ def update( ) -> _models.AutomationAccount: """Update an automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str - :param parameters: Parameters supplied to the update automation account. Is either a model type - or a IO type. Required. + :param parameters: Parameters supplied to the update automation account. Is either a + AutomationAccountUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.AutomationAccountUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -343,14 +348,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AutomationAccount] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "AutomationAccountUpdateParameters") @@ -370,8 +375,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -404,6 +410,9 @@ def create_or_update( ) -> _models.AutomationAccount: """Create or update automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -431,6 +440,9 @@ def create_or_update( ) -> _models.AutomationAccount: """Create or update automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -456,12 +468,15 @@ def create_or_update( ) -> _models.AutomationAccount: """Create or update automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param parameters: Parameters supplied to the create or update automation account. Is either a - model type or a IO type. Required. + AutomationAccountCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.AutomationAccountCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -482,14 +497,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.AutomationAccount] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "AutomationAccountCreateOrUpdateParameters") @@ -509,8 +524,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -541,6 +557,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete an automation account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -561,7 +580,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -576,8 +595,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -598,6 +618,9 @@ def delete( # pylint: disable=inconsistent-return-statements def get(self, resource_group_name: str, automation_account_name: str, **kwargs: Any) -> _models.AutomationAccount: """Get information about an Automation Account. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -618,7 +641,7 @@ def get(self, resource_group_name: str, automation_account_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.AutomationAccount] = kwargs.pop("cls", None) request = build_get_request( @@ -633,8 +656,9 @@ def get(self, resource_group_name: str, automation_account_name: str, **kwargs: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -659,6 +683,9 @@ def get(self, resource_group_name: str, automation_account_name: str, **kwargs: def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.AutomationAccount"]: """Retrieve a list of accounts within a given resource group. + .. seealso:: + - http://aka.ms/azureautomationsdk/automationaccountoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -669,7 +696,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.AutomationAccountListResult] = kwargs.pop("cls", None) error_map = { @@ -711,8 +738,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -743,7 +771,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.AutomationAccount"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.AutomationAccountListResult] = kwargs.pop("cls", None) error_map = { @@ -784,8 +812,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_client_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_client_operations.py index cdfd540f5d97..6fec723bda1e 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_client_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_automation_client_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -26,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +41,7 @@ def build_convert_graph_runbook_content_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -62,7 +58,7 @@ def build_convert_graph_runbook_content_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -144,8 +140,8 @@ def convert_graph_runbook_content( :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str - :param parameters: Input data describing the graphical runbook. Is either a model type or a IO - type. Required. + :param parameters: Input data describing the graphical runbook. Is either a + GraphicalRunbookContent type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.GraphicalRunbookContent or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -166,14 +162,14 @@ def convert_graph_runbook_content( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GraphicalRunbookContent] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "GraphicalRunbookContent") @@ -193,8 +189,9 @@ def convert_graph_runbook_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_certificate_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_certificate_operations.py index 163a32be6348..857b933d0259 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_certificate_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_certificate_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +59,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +93,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +128,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +147,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -169,7 +165,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +184,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +200,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,6 +236,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,7 +261,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -278,8 +277,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,6 +302,9 @@ def get( ) -> _models.Certificate: """Retrieve the certificate identified by certificate name. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -324,7 +327,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Certificate] = kwargs.pop("cls", None) request = build_get_request( @@ -340,8 +343,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -375,6 +379,9 @@ def create_or_update( ) -> _models.Certificate: """Create a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -407,6 +414,9 @@ def create_or_update( ) -> _models.Certificate: """Create a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -437,6 +447,9 @@ def create_or_update( ) -> _models.Certificate: """Create a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -445,7 +458,7 @@ def create_or_update( Required. :type certificate_name: str :param parameters: The parameters supplied to the create or update certificate operation. Is - either a model type or a IO type. Required. + either a CertificateCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.CertificateCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -466,14 +479,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Certificate] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CertificateCreateOrUpdateParameters") @@ -494,8 +507,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -533,6 +547,9 @@ def update( ) -> _models.Certificate: """Update a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -563,6 +580,9 @@ def update( ) -> _models.Certificate: """Update a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -591,6 +611,9 @@ def update( ) -> _models.Certificate: """Update a certificate. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -598,7 +621,7 @@ def update( :param certificate_name: The parameters supplied to the update certificate operation. Required. :type certificate_name: str :param parameters: The parameters supplied to the update certificate operation. Is either a - model type or a IO type. Required. + CertificateUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.CertificateUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -619,14 +642,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Certificate] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CertificateUpdateParameters") @@ -647,8 +670,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -675,6 +699,9 @@ def list_by_automation_account( ) -> Iterable["_models.Certificate"]: """Retrieve a list of certificates. + .. seealso:: + - http://aka.ms/azureautomationsdk/certificateoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -687,7 +714,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.CertificateListResult] = kwargs.pop("cls", None) error_map = { @@ -730,8 +757,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_operations.py index 408ac1066f5d..b8b2f31ec74a 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +59,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +93,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +128,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +147,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -169,7 +165,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +184,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +200,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,6 +236,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,7 +261,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -278,8 +277,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,6 +302,9 @@ def get( ) -> _models.Connection: """Retrieve the connection identified by connection name. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -324,7 +327,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Connection] = kwargs.pop("cls", None) request = build_get_request( @@ -340,8 +343,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -375,6 +379,9 @@ def create_or_update( ) -> _models.Connection: """Create or update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -407,6 +414,9 @@ def create_or_update( ) -> _models.Connection: """Create or update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -437,6 +447,9 @@ def create_or_update( ) -> _models.Connection: """Create or update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -445,7 +458,7 @@ def create_or_update( Required. :type connection_name: str :param parameters: The parameters supplied to the create or update connection operation. Is - either a model type or a IO type. Required. + either a ConnectionCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ConnectionCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -466,14 +479,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Connection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ConnectionCreateOrUpdateParameters") @@ -494,8 +507,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -533,6 +547,9 @@ def update( ) -> _models.Connection: """Update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -563,6 +580,9 @@ def update( ) -> _models.Connection: """Update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -591,6 +611,9 @@ def update( ) -> _models.Connection: """Update a connection. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -598,7 +621,7 @@ def update( :param connection_name: The parameters supplied to the update a connection operation. Required. :type connection_name: str :param parameters: The parameters supplied to the update a connection operation. Is either a - model type or a IO type. Required. + ConnectionUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ConnectionUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -619,14 +642,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Connection] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ConnectionUpdateParameters") @@ -647,8 +670,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -675,6 +699,9 @@ def list_by_automation_account( ) -> Iterable["_models.Connection"]: """Retrieve a list of connections. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectionoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -687,7 +714,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ConnectionListResult] = kwargs.pop("cls", None) error_map = { @@ -730,8 +757,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_type_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_type_operations.py index e0e5c3a1146e..d569bc6bdc35 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_type_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_connection_type_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +46,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +63,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -88,7 +84,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +101,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -126,7 +122,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -144,7 +140,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -163,7 +159,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +175,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -215,6 +211,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the connection type. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -237,7 +236,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -253,8 +252,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -277,6 +277,9 @@ def get( ) -> _models.ConnectionType: """Retrieve the connection type identified by connection type name. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -299,7 +302,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ConnectionType] = kwargs.pop("cls", None) request = build_get_request( @@ -315,8 +318,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -350,6 +354,9 @@ def create_or_update( ) -> _models.ConnectionType: """Create a connection type. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -382,6 +389,9 @@ def create_or_update( ) -> _models.ConnectionType: """Create a connection type. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -412,6 +422,9 @@ def create_or_update( ) -> _models.ConnectionType: """Create a connection type. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -420,7 +433,7 @@ def create_or_update( operation. Required. :type connection_type_name: str :param parameters: The parameters supplied to the create or update connection type operation. - Is either a model type or a IO type. Required. + Is either a ConnectionTypeCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ConnectionTypeCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -441,14 +454,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ConnectionType] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ConnectionTypeCreateOrUpdateParameters") @@ -469,8 +482,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -497,6 +511,9 @@ def list_by_automation_account( ) -> Iterable["_models.ConnectionType"]: """Retrieve a list of connection types. + .. seealso:: + - http://aka.ms/azureautomationsdk/connectiontypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -509,7 +526,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ConnectionTypeListResult] = kwargs.pop("cls", None) error_map = { @@ -552,8 +569,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_credential_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_credential_operations.py index 375027ade7c8..51651e460261 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_credential_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_credential_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +59,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +93,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +128,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +147,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -169,7 +165,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +184,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +200,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,6 +236,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,7 +261,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -278,8 +277,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,6 +302,9 @@ def get( ) -> _models.Credential: """Retrieve the credential identified by credential name. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -324,7 +327,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Credential] = kwargs.pop("cls", None) request = build_get_request( @@ -340,8 +343,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -375,6 +379,9 @@ def create_or_update( ) -> _models.Credential: """Create a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -407,6 +414,9 @@ def create_or_update( ) -> _models.Credential: """Create a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -437,6 +447,9 @@ def create_or_update( ) -> _models.Credential: """Create a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -445,7 +458,7 @@ def create_or_update( Required. :type credential_name: str :param parameters: The parameters supplied to the create or update credential operation. Is - either a model type or a IO type. Required. + either a CredentialCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.CredentialCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -466,14 +479,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Credential] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CredentialCreateOrUpdateParameters") @@ -494,8 +507,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -533,6 +547,9 @@ def update( ) -> _models.Credential: """Update a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -563,6 +580,9 @@ def update( ) -> _models.Credential: """Update a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -591,6 +611,9 @@ def update( ) -> _models.Credential: """Update a credential. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -598,7 +621,7 @@ def update( :param credential_name: The parameters supplied to the Update credential operation. Required. :type credential_name: str :param parameters: The parameters supplied to the Update credential operation. Is either a - model type or a IO type. Required. + CredentialUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.CredentialUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -619,14 +642,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Credential] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "CredentialUpdateParameters") @@ -647,8 +670,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -675,6 +699,9 @@ def list_by_automation_account( ) -> Iterable["_models.Credential"]: """Retrieve a list of credentials. + .. seealso:: + - http://aka.ms/azureautomationsdk/credentialoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -687,7 +714,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.CredentialListResult] = kwargs.pop("cls", None) error_map = { @@ -730,8 +757,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_deleted_automation_accounts_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_deleted_automation_accounts_operations.py index d6ac5231db4d..7638a99a240a 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_deleted_automation_accounts_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_deleted_automation_accounts_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +38,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-01-31"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-01-31")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +49,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -104,7 +99,7 @@ def list_by_subscription(self, **kwargs: Any) -> _models.DeletedAutomationAccoun _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-01-31"] = kwargs.pop("api_version", _params.pop("api-version", "2022-01-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-01-31")) cls: ClsType[_models.DeletedAutomationAccountListResult] = kwargs.pop("cls", None) request = build_list_by_subscription_request( @@ -117,8 +112,9 @@ def list_by_subscription(self, **kwargs: Any) -> _models.DeletedAutomationAccoun request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_operations.py index b8d498a822ea..ea8bc54b2c9c 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,12 +29,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,9 +48,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -72,7 +66,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,9 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +106,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,9 +128,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -154,7 +144,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -178,9 +168,7 @@ def build_get_stream_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +186,7 @@ def build_get_stream_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -247,16 +235,14 @@ def _create_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscCompilationJob] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DscCompilationJobCreateParameters") @@ -277,8 +263,9 @@ def _create_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -312,6 +299,9 @@ def begin_create( ) -> LROPoller[_models.DscCompilationJob]: """Creates the Dsc compilation job of the configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscconfigurationcompilejoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -350,6 +340,9 @@ def begin_create( ) -> LROPoller[_models.DscCompilationJob]: """Creates the Dsc compilation job of the configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscconfigurationcompilejoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -386,6 +379,9 @@ def begin_create( ) -> LROPoller[_models.DscCompilationJob]: """Creates the Dsc compilation job of the configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscconfigurationcompilejoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -393,7 +389,7 @@ def begin_create( :param compilation_job_name: The DSC configuration Id. Required. :type compilation_job_name: str :param parameters: The parameters supplied to the create compilation job operation. Is either a - model type or a IO type. Required. + DscCompilationJobCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.DscCompilationJobCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -414,9 +410,7 @@ def begin_create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscCompilationJob] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -468,6 +462,9 @@ def get( ) -> _models.DscCompilationJob: """Retrieve the Dsc configuration compilation job identified by job id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dsccompilationjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -490,9 +487,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscCompilationJob] = kwargs.pop("cls", None) request = build_get_request( @@ -508,8 +503,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -536,6 +532,9 @@ def list_by_automation_account( ) -> Iterable["_models.DscCompilationJob"]: """Retrieve a list of dsc compilation jobs. + .. seealso:: + - http://aka.ms/azureautomationsdk/compilationjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -550,9 +549,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscCompilationJobListResult] = kwargs.pop("cls", None) error_map = { @@ -596,8 +593,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -620,6 +618,9 @@ def get_stream( ) -> _models.JobStream: """Retrieve the job stream identified by job stream id. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -644,9 +645,7 @@ def get_stream( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.JobStream] = kwargs.pop("cls", None) request = build_get_stream_request( @@ -663,8 +662,9 @@ def get_stream( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_stream_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_stream_operations.py index 7e4fd8be18a1..49db8b718248 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_stream_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_compilation_job_stream_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,9 +40,7 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +57,7 @@ def build_list_by_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -100,6 +93,9 @@ def list_by_job( ) -> _models.JobStreamListResult: """Retrieve all the job streams for the compilation Job. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -122,9 +118,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.JobStreamListResult] = kwargs.pop("cls", None) request = build_list_by_job_request( @@ -140,8 +134,9 @@ def list_by_job( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_configuration_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_configuration_operations.py index c32539930fd6..b4a318bda768 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_configuration_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_configuration_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Iterator, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +58,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +75,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +92,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +109,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +127,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +146,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -169,7 +164,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +183,7 @@ def build_get_content_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "text/powershell") # Construct URL @@ -205,7 +200,7 @@ def build_get_content_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -230,7 +225,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +241,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -290,6 +285,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the dsc configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -312,7 +310,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -328,8 +326,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -352,6 +351,9 @@ def get( ) -> _models.DscConfiguration: """Retrieve the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -374,7 +376,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.DscConfiguration] = kwargs.pop("cls", None) request = build_get_request( @@ -390,8 +392,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,6 +428,9 @@ def create_or_update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -455,6 +461,9 @@ def create_or_update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -483,14 +492,17 @@ def create_or_update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param configuration_name: The create or update parameters for configuration. Required. :type configuration_name: str - :param parameters: The create or update parameters for configuration. Is either a model type or - a string type. Required. + :param parameters: The create or update parameters for configuration. Is either a + DscConfigurationCreateOrUpdateParameters type or a str type. Required. :type parameters: ~azure.mgmt.automation.models.DscConfigurationCreateOrUpdateParameters or str :keyword content_type: Body Parameter content-type. Known values are: 'application/json', 'text/plain; charset=utf-8'. Default value is None. @@ -511,7 +523,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscConfiguration] = kwargs.pop("cls", None) @@ -539,8 +551,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -578,6 +591,9 @@ def update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -608,6 +624,9 @@ def update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -636,14 +655,17 @@ def update( ) -> _models.DscConfiguration: """Create the configuration identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param configuration_name: The create or update parameters for configuration. Required. :type configuration_name: str - :param parameters: The create or update parameters for configuration. Is either a model type or - a string type. Default value is None. + :param parameters: The create or update parameters for configuration. Is either a + DscConfigurationUpdateParameters type or a str type. Default value is None. :type parameters: ~azure.mgmt.automation.models.DscConfigurationUpdateParameters or str :keyword content_type: Body Parameter content-type. Known values are: 'application/json', 'text/plain; charset=utf-8'. Default value is None. @@ -664,7 +686,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscConfiguration] = kwargs.pop("cls", None) @@ -698,8 +720,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -726,6 +749,9 @@ def get_content( ) -> Iterator[bytes]: """Retrieve the configuration script identified by configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -748,7 +774,7 @@ def get_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) request = build_get_content_request( @@ -764,8 +790,9 @@ def get_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=True, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -798,6 +825,9 @@ def list_by_automation_account( ) -> Iterable["_models.DscConfiguration"]: """Retrieve a list of configurations. + .. seealso:: + - http://aka.ms/azureautomationsdk/configurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -818,7 +848,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.DscConfigurationListResult] = kwargs.pop("cls", None) error_map = { @@ -865,8 +895,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_configuration_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_configuration_operations.py index 9d05b99c479b..4ea5529f923c 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_configuration_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_configuration_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,12 +29,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +48,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +65,7 @@ def build_delete_request( "nodeConfigurationName": _SERIALIZER.url("node_configuration_name", node_configuration_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,7 +86,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +103,7 @@ def build_get_request( "nodeConfigurationName": _SERIALIZER.url("node_configuration_name", node_configuration_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -128,7 +124,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -146,7 +142,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -173,7 +169,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,7 +185,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -233,6 +229,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the Dsc node configurations by node configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -255,7 +254,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -271,8 +270,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -295,6 +295,9 @@ def get( ) -> _models.DscNodeConfiguration: """Retrieve the Dsc node configurations by node configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -317,7 +320,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.DscNodeConfiguration] = kwargs.pop("cls", None) request = build_get_request( @@ -333,8 +336,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -374,14 +378,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.DscNodeConfiguration]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "DscNodeConfigurationCreateOrUpdateParameters") @@ -402,8 +406,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -436,9 +441,12 @@ def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: + ) -> LROPoller[_models.DscNodeConfiguration]: """Create the node configuration identified by node configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -474,9 +482,12 @@ def begin_create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: + ) -> LROPoller[_models.DscNodeConfiguration]: """Create the node configuration identified by node configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -510,17 +521,20 @@ def begin_create_or_update( node_configuration_name: str, parameters: Union[_models.DscNodeConfigurationCreateOrUpdateParameters, IO], **kwargs: Any - ) -> LROPoller[None]: + ) -> LROPoller[_models.DscNodeConfiguration]: """Create the node configuration identified by node configuration name. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param node_configuration_name: The Dsc node configuration name. Required. :type node_configuration_name: str - :param parameters: The create or update parameters for configuration. Is either a model type or - a IO type. Required. + :param parameters: The create or update parameters for configuration. Is either a + DscNodeConfigurationCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.DscNodeConfigurationCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -542,7 +556,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -601,6 +615,9 @@ def list_by_automation_account( ) -> Iterable["_models.DscNodeConfiguration"]: """Retrieve a list of dsc node configurations. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeconfigurations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -622,7 +639,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.DscNodeConfigurationListResult] = kwargs.pop("cls", None) error_map = { @@ -669,8 +686,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_operations.py index b3a9240a65ac..bd9aff0d6fe9 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_dsc_node_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +59,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,9 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +93,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -118,9 +110,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -138,7 +128,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -165,9 +155,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +171,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -227,6 +215,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the dsc node identified by node id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -249,9 +240,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -267,8 +256,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -291,6 +281,9 @@ def get( ) -> _models.DscNode: """Retrieve the dsc node identified by node id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -313,9 +306,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscNode] = kwargs.pop("cls", None) request = build_get_request( @@ -331,8 +322,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -366,6 +358,9 @@ def update( ) -> _models.DscNode: """Update the dsc node. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -396,6 +391,9 @@ def update( ) -> _models.DscNode: """Update the dsc node. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -424,6 +422,9 @@ def update( ) -> _models.DscNode: """Update the dsc node. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -431,7 +432,7 @@ def update( :param node_id: Parameters supplied to the update dsc node. Required. :type node_id: str :param dsc_node_update_parameters: Parameters supplied to the update dsc node. Is either a - model type or a IO type. Required. + DscNodeUpdateParameters type or a IO type. Required. :type dsc_node_update_parameters: ~azure.mgmt.automation.models.DscNodeUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -452,16 +453,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DscNode] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(dsc_node_update_parameters, (IO, bytes)): + if isinstance(dsc_node_update_parameters, (IOBase, bytes)): _content = dsc_node_update_parameters else: _json = self._serialize.body(dsc_node_update_parameters, "DscNodeUpdateParameters") @@ -482,8 +481,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -517,6 +517,9 @@ def list_by_automation_account( ) -> Iterable["_models.DscNode"]: """Retrieve a list of dsc nodes. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -537,9 +540,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscNodeListResult] = kwargs.pop("cls", None) error_map = { @@ -586,8 +587,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_fields_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_fields_operations.py index 97511e77ab4f..f7c602b1b8cf 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_fields_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_fields_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +46,7 @@ def build_list_by_type_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +64,7 @@ def build_list_by_type_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -105,6 +100,9 @@ def list_by_type( ) -> Iterable["_models.TypeField"]: """Retrieve a list of fields of a given type identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/typefieldoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -121,7 +119,7 @@ def list_by_type( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.TypeFieldListResult] = kwargs.pop("cls", None) error_map = { @@ -166,8 +164,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_worker_group_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_worker_group_operations.py index 50ecad63e97e..ac69a2c339b5 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_worker_group_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_worker_group_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +46,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +65,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -90,7 +86,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +105,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -130,7 +126,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -150,7 +146,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -173,7 +169,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -193,7 +189,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -217,7 +213,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -233,7 +229,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -275,6 +271,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -297,7 +296,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -313,8 +312,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -341,6 +341,9 @@ def get( ) -> _models.HybridRunbookWorkerGroup: """Retrieve a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -363,7 +366,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.HybridRunbookWorkerGroup] = kwargs.pop("cls", None) request = build_get_request( @@ -379,8 +382,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -414,6 +418,9 @@ def create( ) -> _models.HybridRunbookWorkerGroup: """Create a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -446,6 +453,9 @@ def create( ) -> _models.HybridRunbookWorkerGroup: """Create a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -477,6 +487,9 @@ def create( ) -> _models.HybridRunbookWorkerGroup: """Create a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -484,7 +497,8 @@ def create( :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. Required. :type hybrid_runbook_worker_group_name: str :param hybrid_runbook_worker_group_creation_parameters: The create or update parameters for - hybrid runbook worker group. Is either a model type or a IO type. Required. + hybrid runbook worker group. Is either a HybridRunbookWorkerGroupCreateOrUpdateParameters type + or a IO type. Required. :type hybrid_runbook_worker_group_creation_parameters: ~azure.mgmt.automation.models.HybridRunbookWorkerGroupCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -506,14 +520,14 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.HybridRunbookWorkerGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hybrid_runbook_worker_group_creation_parameters, (IO, bytes)): + if isinstance(hybrid_runbook_worker_group_creation_parameters, (IOBase, bytes)): _content = hybrid_runbook_worker_group_creation_parameters else: _json = self._serialize.body( @@ -536,8 +550,9 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -575,6 +590,9 @@ def update( ) -> _models.HybridRunbookWorkerGroup: """Update a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -607,6 +625,9 @@ def update( ) -> _models.HybridRunbookWorkerGroup: """Update a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -638,6 +659,9 @@ def update( ) -> _models.HybridRunbookWorkerGroup: """Update a hybrid runbook worker group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -645,7 +669,7 @@ def update( :param hybrid_runbook_worker_group_name: The hybrid runbook worker group name. Required. :type hybrid_runbook_worker_group_name: str :param hybrid_runbook_worker_group_updation_parameters: The hybrid runbook worker group. Is - either a model type or a IO type. Required. + either a HybridRunbookWorkerGroupCreateOrUpdateParameters type or a IO type. Required. :type hybrid_runbook_worker_group_updation_parameters: ~azure.mgmt.automation.models.HybridRunbookWorkerGroupCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -667,14 +691,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.HybridRunbookWorkerGroup] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hybrid_runbook_worker_group_updation_parameters, (IO, bytes)): + if isinstance(hybrid_runbook_worker_group_updation_parameters, (IOBase, bytes)): _content = hybrid_runbook_worker_group_updation_parameters else: _json = self._serialize.body( @@ -697,8 +721,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -725,6 +750,9 @@ def list_by_automation_account( ) -> Iterable["_models.HybridRunbookWorkerGroup"]: """Retrieve a list of hybrid runbook worker groups. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkergroupoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -740,7 +768,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.HybridRunbookWorkerGroupsListResult] = kwargs.pop("cls", None) error_map = { @@ -784,8 +812,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_workers_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_workers_operations.py index a5f04677e394..ab7477b945ff 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_workers_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_hybrid_runbook_workers_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +47,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +67,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -93,7 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +109,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +131,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -156,7 +152,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -180,7 +176,7 @@ def build_move_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -201,7 +197,7 @@ def build_move_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -226,7 +222,7 @@ def build_list_by_hybrid_runbook_worker_group_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +241,7 @@ def build_list_by_hybrid_runbook_worker_group_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -288,6 +284,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -312,7 +311,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -329,8 +328,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -358,6 +358,9 @@ def get( ) -> _models.HybridRunbookWorker: """Retrieve a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -382,7 +385,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.HybridRunbookWorker] = kwargs.pop("cls", None) request = build_get_request( @@ -399,8 +402,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -435,6 +439,9 @@ def create( ) -> _models.HybridRunbookWorker: """Create a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -470,6 +477,9 @@ def create( ) -> _models.HybridRunbookWorker: """Create a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -502,6 +512,9 @@ def create( ) -> _models.HybridRunbookWorker: """Create a hybrid runbook worker. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -511,7 +524,7 @@ def create( :param hybrid_runbook_worker_id: The hybrid runbook worker id. Required. :type hybrid_runbook_worker_id: str :param hybrid_runbook_worker_creation_parameters: The create or update parameters for hybrid - runbook worker. Is either a model type or a IO type. Required. + runbook worker. Is either a HybridRunbookWorkerCreateParameters type or a IO type. Required. :type hybrid_runbook_worker_creation_parameters: ~azure.mgmt.automation.models.HybridRunbookWorkerCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -533,14 +546,14 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.HybridRunbookWorker] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hybrid_runbook_worker_creation_parameters, (IO, bytes)): + if isinstance(hybrid_runbook_worker_creation_parameters, (IOBase, bytes)): _content = hybrid_runbook_worker_creation_parameters else: _json = self._serialize.body( @@ -564,8 +577,9 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -604,6 +618,9 @@ def move( # pylint: disable=inconsistent-return-statements ) -> None: """Move a hybrid worker to a different group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -639,6 +656,9 @@ def move( # pylint: disable=inconsistent-return-statements ) -> None: """Move a hybrid worker to a different group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -671,6 +691,9 @@ def move( # pylint: disable=inconsistent-return-statements ) -> None: """Move a hybrid worker to a different group. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -680,7 +703,7 @@ def move( # pylint: disable=inconsistent-return-statements :param hybrid_runbook_worker_id: The hybrid runbook worker id. Required. :type hybrid_runbook_worker_id: str :param hybrid_runbook_worker_move_parameters: The hybrid runbook worker move parameters. Is - either a model type or a IO type. Required. + either a HybridRunbookWorkerMoveParameters type or a IO type. Required. :type hybrid_runbook_worker_move_parameters: ~azure.mgmt.automation.models.HybridRunbookWorkerMoveParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. @@ -702,14 +725,14 @@ def move( # pylint: disable=inconsistent-return-statements _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(hybrid_runbook_worker_move_parameters, (IO, bytes)): + if isinstance(hybrid_runbook_worker_move_parameters, (IOBase, bytes)): _content = hybrid_runbook_worker_move_parameters else: _json = self._serialize.body(hybrid_runbook_worker_move_parameters, "HybridRunbookWorkerMoveParameters") @@ -731,8 +754,9 @@ def move( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -760,6 +784,9 @@ def list_by_hybrid_runbook_worker_group( ) -> Iterable["_models.HybridRunbookWorker"]: """Retrieve a list of hybrid runbook workers. + .. seealso:: + - http://aka.ms/azureautomationsdk/hybridrunbookworkeroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -776,7 +803,7 @@ def list_by_hybrid_runbook_worker_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.HybridRunbookWorkersListResult] = kwargs.pop("cls", None) error_map = { @@ -821,8 +848,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_operations.py index 1f32175053c2..b926cec47d46 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +48,7 @@ def build_get_output_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "text/plain") # Construct URL @@ -69,7 +65,7 @@ def build_get_output_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -94,7 +90,7 @@ def build_get_runbook_content_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "text/powershell") # Construct URL @@ -111,7 +107,7 @@ def build_get_runbook_content_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -136,7 +132,7 @@ def build_suspend_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +149,7 @@ def build_suspend_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -178,7 +174,7 @@ def build_stop_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +191,7 @@ def build_stop_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -220,7 +216,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -237,7 +233,7 @@ def build_get_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -262,7 +258,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -280,7 +276,7 @@ def build_create_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -307,7 +303,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -323,7 +319,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -350,7 +346,7 @@ def build_resume_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -367,7 +363,7 @@ def build_resume_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -410,6 +406,9 @@ def get_output( ) -> str: """Retrieve the job output identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -434,7 +433,7 @@ def get_output( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[str] = kwargs.pop("cls", None) request = build_get_output_request( @@ -451,8 +450,9 @@ def get_output( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -483,6 +483,9 @@ def get_runbook_content( ) -> str: """Retrieve the runbook content of the job identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -507,7 +510,7 @@ def get_runbook_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[str] = kwargs.pop("cls", None) request = build_get_runbook_content_request( @@ -524,8 +527,9 @@ def get_runbook_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -556,6 +560,9 @@ def suspend( # pylint: disable=inconsistent-return-statements ) -> None: """Suspend the job identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -580,7 +587,7 @@ def suspend( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_suspend_request( @@ -597,8 +604,9 @@ def suspend( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -626,6 +634,9 @@ def stop( # pylint: disable=inconsistent-return-statements ) -> None: """Stop the job identified by jobName. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -650,7 +661,7 @@ def stop( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -667,8 +678,9 @@ def stop( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -696,6 +708,9 @@ def get( ) -> _models.Job: """Retrieve the job identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -720,7 +735,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Job] = kwargs.pop("cls", None) request = build_get_request( @@ -737,8 +752,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -773,6 +789,9 @@ def create( ) -> _models.Job: """Create a job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -806,6 +825,9 @@ def create( ) -> _models.Job: """Create a job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -837,14 +859,17 @@ def create( ) -> _models.Job: """Create a job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param job_name: The job name. Required. :type job_name: str - :param parameters: The parameters supplied to the create job operation. Is either a model type - or a IO type. Required. + :param parameters: The parameters supplied to the create job operation. Is either a + JobCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.JobCreateParameters or IO :param client_request_id: Identifies this specific client request. Default value is None. :type client_request_id: str @@ -867,14 +892,14 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobCreateParameters") @@ -896,8 +921,9 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -929,6 +955,9 @@ def list_by_automation_account( ) -> Iterable["_models.JobCollectionItem"]: """Retrieve a list of jobs. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -945,7 +974,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobListResultV2] = kwargs.pop("cls", None) error_map = { @@ -990,8 +1019,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -1019,6 +1049,9 @@ def resume( # pylint: disable=inconsistent-return-statements ) -> None: """Resume the job identified by jobName. + .. seealso:: + - http://aka.ms/azureautomationsdk/joboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -1043,7 +1076,7 @@ def resume( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resume_request( @@ -1060,8 +1093,9 @@ def resume( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_schedule_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_schedule_operations.py index b5dce81f200f..a01a43bd0ea6 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_schedule_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_schedule_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +59,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +93,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +110,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +128,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -156,7 +152,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +168,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -210,6 +206,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the job schedule identified by job schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -232,7 +231,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -248,8 +247,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -272,6 +272,9 @@ def get( ) -> _models.JobSchedule: """Retrieve the job schedule identified by job schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -294,7 +297,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobSchedule] = kwargs.pop("cls", None) request = build_get_request( @@ -310,8 +313,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -345,6 +349,9 @@ def create( ) -> _models.JobSchedule: """Create a job schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -375,6 +382,9 @@ def create( ) -> _models.JobSchedule: """Create a job schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -403,6 +413,9 @@ def create( ) -> _models.JobSchedule: """Create a job schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -410,7 +423,7 @@ def create( :param job_schedule_id: The job schedule name. Required. :type job_schedule_id: str :param parameters: The parameters supplied to the create job schedule operation. Is either a - model type or a IO type. Required. + JobScheduleCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.JobScheduleCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -431,14 +444,14 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobSchedule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "JobScheduleCreateParameters") @@ -459,8 +472,9 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -487,6 +501,9 @@ def list_by_automation_account( ) -> Iterable["_models.JobSchedule"]: """Retrieve a list of job schedules. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobscheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -501,7 +518,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobScheduleListResult] = kwargs.pop("cls", None) error_map = { @@ -545,8 +562,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_stream_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_stream_operations.py index 0052d87dde4d..1c530046371b 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_stream_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_job_stream_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +48,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +66,7 @@ def build_get_request( "jobStreamId": _SERIALIZER.url("job_stream_id", job_stream_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +92,7 @@ def build_list_by_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,7 +109,7 @@ def build_list_by_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -160,6 +155,9 @@ def get( ) -> _models.JobStream: """Retrieve the job stream identified by job stream id. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -186,7 +184,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobStream] = kwargs.pop("cls", None) request = build_get_request( @@ -204,8 +202,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -238,6 +237,9 @@ def list_by_job( ) -> Iterable["_models.JobStream"]: """Retrieve a list of jobs streams identified by job name. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -256,7 +258,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobStreamListResult] = kwargs.pop("cls", None) error_map = { @@ -302,8 +304,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_keys_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_keys_operations.py index 65d3c2d4f59d..6043655c6e81 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_keys_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_keys_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +56,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -117,7 +112,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.KeyListResult] = kwargs.pop("cls", None) request = build_list_by_automation_account_request( @@ -132,8 +127,9 @@ def list_by_automation_account( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_linked_workspace_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_linked_workspace_operations.py index 3e65082d6b94..42dd285dd88f 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_linked_workspace_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_linked_workspace_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +40,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -61,7 +56,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -95,6 +90,9 @@ def __init__(self, *args, **kwargs): def get(self, resource_group_name: str, automation_account_name: str, **kwargs: Any) -> _models.LinkedWorkspace: """Retrieve the linked workspace for the account id. + .. seealso:: + - http://aka.ms/azureautomationsdk/linkedworkspaceoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -115,7 +113,7 @@ def get(self, resource_group_name: str, automation_account_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.LinkedWorkspace] = kwargs.pop("cls", None) request = build_get_request( @@ -130,8 +128,9 @@ def get(self, resource_group_name: str, automation_account_name: str, **kwargs: request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_module_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_module_operations.py index 2631b4144265..5a7b8c6e9dcf 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_module_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_module_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +59,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +93,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +128,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +147,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -169,7 +165,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +184,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +200,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,6 +236,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the module by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,7 +261,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -278,8 +277,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,6 +302,9 @@ def get( ) -> _models.Module: """Retrieve the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -324,7 +327,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Module] = kwargs.pop("cls", None) request = build_get_request( @@ -340,8 +343,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -375,6 +379,9 @@ def create_or_update( ) -> _models.Module: """Create or Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -405,6 +412,9 @@ def create_or_update( ) -> _models.Module: """Create or Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -433,14 +443,17 @@ def create_or_update( ) -> _models.Module: """Create or Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param module_name: The name of module. Required. :type module_name: str - :param parameters: The create or update parameters for module. Is either a model type or a IO - type. Required. + :param parameters: The create or update parameters for module. Is either a + ModuleCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ModuleCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -461,14 +474,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ModuleCreateOrUpdateParameters") @@ -489,8 +502,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -528,6 +542,9 @@ def update( ) -> _models.Module: """Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -558,6 +575,9 @@ def update( ) -> _models.Module: """Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -586,14 +606,17 @@ def update( ) -> _models.Module: """Update the module identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param module_name: The name of module. Required. :type module_name: str - :param parameters: The update parameters for module. Is either a model type or a IO type. - Required. + :param parameters: The update parameters for module. Is either a ModuleUpdateParameters type or + a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ModuleUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -614,14 +637,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ModuleUpdateParameters") @@ -642,8 +665,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -670,6 +694,9 @@ def list_by_automation_account( ) -> Iterable["_models.Module"]: """Retrieve a list of modules. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -682,7 +709,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ModuleListResult] = kwargs.pop("cls", None) error_map = { @@ -725,8 +752,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_count_information_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_count_information_operations.py index efe79673ab61..59e5fc2c4b5b 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_count_information_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_count_information_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,9 +44,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +61,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -108,6 +101,9 @@ def get( ) -> _models.NodeCounts: """Retrieve counts for Dsc Nodes. + .. seealso:: + - http://aka.ms/azureautomationsdk/nodecounts + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -131,9 +127,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.NodeCounts] = kwargs.pop("cls", None) request = build_get_request( @@ -149,8 +143,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_reports_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_reports_operations.py index fa13f6eca28c..905175ced0d2 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_reports_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_node_reports_operations.py @@ -27,16 +27,12 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -57,9 +53,7 @@ def build_list_by_node_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +70,7 @@ def build_list_by_node_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -100,9 +94,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -120,7 +112,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,9 +134,7 @@ def build_get_content_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +152,7 @@ def build_get_content_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -203,6 +193,9 @@ def list_by_node( ) -> Iterable["_models.DscNodeReport"]: """Retrieve the Dsc node report list by node id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodereportoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -219,9 +212,7 @@ def list_by_node( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscNodeReportListResult] = kwargs.pop("cls", None) error_map = { @@ -266,8 +257,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -290,6 +282,9 @@ def get( ) -> _models.DscNodeReport: """Retrieve the Dsc node report data by node id and report id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodereportoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -314,9 +309,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.DscNodeReport] = kwargs.pop("cls", None) request = build_get_request( @@ -333,8 +326,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -361,6 +355,9 @@ def get_content( ) -> JSON: """Retrieve the Dsc node reports by node id and report id. + .. seealso:: + - http://aka.ms/azureautomationsdk/dscnodereportoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -385,9 +382,7 @@ def get_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[JSON] = kwargs.pop("cls", None) request = build_get_content_request( @@ -404,8 +399,9 @@ def get_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_object_data_types_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_object_data_types_operations.py index a0bd570f9776..4bf98d689e35 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_object_data_types_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_object_data_types_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +46,7 @@ def build_list_fields_by_module_and_type_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +64,7 @@ def build_list_fields_by_module_and_type_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -86,7 +81,7 @@ def build_list_fields_by_type_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +98,7 @@ def build_list_fields_by_type_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -139,6 +134,9 @@ def list_fields_by_module_and_type( ) -> Iterable["_models.TypeField"]: """Retrieve a list of fields of a given type identified by module name. + .. seealso:: + - http://aka.ms/azureautomationsdk/objectdatatypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -155,7 +153,7 @@ def list_fields_by_module_and_type( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.TypeFieldListResult] = kwargs.pop("cls", None) error_map = { @@ -200,8 +198,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -224,6 +223,9 @@ def list_fields_by_type( ) -> Iterable["_models.TypeField"]: """Retrieve a list of fields of a given type across all accessible modules. + .. seealso:: + - http://aka.ms/azureautomationsdk/objectdatatypeoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -238,7 +240,7 @@ def list_fields_by_type( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.TypeFieldListResult] = kwargs.pop("cls", None) error_map = { @@ -282,8 +284,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py index 840ce5a7ac2d..3fce9c0fb57c 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -29,10 +28,6 @@ from .._serialization import Serializer from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +39,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +85,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map = { @@ -130,8 +125,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_private_endpoint_connections_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_private_endpoint_connections_operations.py index a74811f185c9..116173ab202d 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_private_endpoint_connections_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_private_endpoint_connections_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,12 +29,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,9 +44,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -66,7 +60,7 @@ def build_list_by_automation_account_request( "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -87,9 +81,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +100,7 @@ def build_get_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -129,9 +121,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -151,7 +141,7 @@ def build_create_or_update_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -174,9 +164,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +183,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -244,9 +232,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map = { @@ -289,8 +275,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -338,9 +325,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) request = build_get_request( @@ -356,8 +341,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -396,16 +382,14 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PrivateEndpointConnection") @@ -426,8 +410,9 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -543,7 +528,7 @@ def begin_create_or_update( :type automation_account_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. Required. :type private_endpoint_connection_name: str - :param parameters: Is either a model type or a IO type. Required. + :param parameters: Is either a PrivateEndpointConnection type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PrivateEndpointConnection or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -564,9 +549,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -630,9 +613,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -648,8 +629,9 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -697,9 +679,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_private_link_resources_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_private_link_resources_operations.py index 3c4845e592ff..fd2e59ab0c45 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_private_link_resources_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_private_link_resources_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +41,7 @@ def build_automation_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -64,7 +57,7 @@ def build_automation_request( "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -112,9 +105,7 @@ def automation( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map = { @@ -157,8 +148,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python2_package_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python2_package_operations.py index 9637fdcdee3b..bc2cd097224f 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python2_package_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python2_package_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +59,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +76,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +93,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +110,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +128,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +147,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -169,7 +165,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +184,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +200,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,6 +236,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the python 2 package by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,7 +261,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -278,8 +277,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,6 +302,9 @@ def get( ) -> _models.Module: """Retrieve the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -324,7 +327,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Module] = kwargs.pop("cls", None) request = build_get_request( @@ -340,8 +343,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -375,6 +379,9 @@ def create_or_update( ) -> _models.Module: """Create or Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -405,6 +412,9 @@ def create_or_update( ) -> _models.Module: """Create or Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -433,14 +443,17 @@ def create_or_update( ) -> _models.Module: """Create or Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param package_name: The name of python package. Required. :type package_name: str - :param parameters: The create or update parameters for python package. Is either a model type - or a IO type. Required. + :param parameters: The create or update parameters for python package. Is either a + PythonPackageCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PythonPackageCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -461,14 +474,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PythonPackageCreateParameters") @@ -489,8 +502,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -528,6 +542,9 @@ def update( ) -> _models.Module: """Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -558,6 +575,9 @@ def update( ) -> _models.Module: """Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -586,14 +606,17 @@ def update( ) -> _models.Module: """Update the python 2 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param package_name: The name of python package. Required. :type package_name: str - :param parameters: The update parameters for python package. Is either a model type or a IO - type. Required. + :param parameters: The update parameters for python package. Is either a + PythonPackageUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PythonPackageUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -614,14 +637,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PythonPackageUpdateParameters") @@ -642,8 +665,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -670,6 +694,9 @@ def list_by_automation_account( ) -> Iterable["_models.Module"]: """Retrieve a list of python 2 packages. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -682,7 +709,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ModuleListResult] = kwargs.pop("cls", None) error_map = { @@ -725,8 +752,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python3_package_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python3_package_operations.py index 8a972064ff1b..d9a77e8c22cd 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python3_package_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_python3_package_operations.py @@ -6,8 +6,8 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -20,19 +20,17 @@ 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 AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +44,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -63,7 +61,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -80,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +95,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -114,7 +112,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -132,7 +130,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -151,7 +149,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -169,7 +167,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +186,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +202,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -240,6 +238,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the python 3 package by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -262,7 +263,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -278,8 +279,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -302,6 +304,9 @@ def get( ) -> _models.Module: """Retrieve the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -324,7 +329,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Module] = kwargs.pop("cls", None) request = build_get_request( @@ -340,8 +345,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -362,8 +368,82 @@ def get( "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName}" } + def _create_or_update_initial( + self, + resource_group_name: str, + automation_account_name: str, + package_name: str, + parameters: Union[_models.PythonPackageCreateParameters, IO], + **kwargs: Any + ) -> _models.Module: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Module] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "PythonPackageCreateParameters") + + request = build_create_or_update_request( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + package_name=package_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + 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) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + 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("Module", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Module", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + _create_or_update_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName}" + } + @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, automation_account_name: str, @@ -372,9 +452,12 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Module: + ) -> LROPoller[_models.Module]: """Create or Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -387,13 +470,20 @@ def create_or_update( 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: Module or the result of cls(response) - :rtype: ~azure.mgmt.automation.models.Module + :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 Module or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.automation.models.Module] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, automation_account_name: str, @@ -402,9 +492,12 @@ def create_or_update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.Module: + ) -> LROPoller[_models.Module]: """Create or Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -417,101 +510,104 @@ def create_or_update( 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: Module or the result of cls(response) - :rtype: ~azure.mgmt.automation.models.Module + :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 Module or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.automation.models.Module] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( + def begin_create_or_update( self, resource_group_name: str, automation_account_name: str, package_name: str, parameters: Union[_models.PythonPackageCreateParameters, IO], **kwargs: Any - ) -> _models.Module: + ) -> LROPoller[_models.Module]: """Create or Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param package_name: The name of python package. Required. :type package_name: str - :param parameters: The create or update parameters for python package. Is either a model type - or a IO type. Required. + :param parameters: The create or update parameters for python package. Is either a + PythonPackageCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PythonPackageCreateParameters 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: Module or the result of cls(response) - :rtype: ~azure.mgmt.automation.models.Module + :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 Module or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.automation.models.Module] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + automation_account_name=automation_account_name, + package_name=package_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IO, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PythonPackageCreateParameters") - - request = build_create_or_update_request( - resource_group_name=resource_group_name, - automation_account_name=automation_account_name, - package_name=package_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - 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) - - pipeline_response: PipelineResponse = self._client._pipeline.run( # 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) - 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("Module", pipeline_response) - - if response.status_code == 201: + def get_long_running_output(pipeline_response): deserialized = self._deserialize("Module", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + 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, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore - create_or_update.metadata = { + begin_create_or_update.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/python3Packages/{packageName}" } @@ -528,6 +624,9 @@ def update( ) -> _models.Module: """Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -558,6 +657,9 @@ def update( ) -> _models.Module: """Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -586,14 +688,17 @@ def update( ) -> _models.Module: """Update the python 3 package identified by package name. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param package_name: The name of python package. Required. :type package_name: str - :param parameters: The update parameters for python package. Is either a model type or a IO - type. Required. + :param parameters: The update parameters for python package. Is either a + PythonPackageUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.PythonPackageUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -614,14 +719,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Module] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "PythonPackageUpdateParameters") @@ -642,8 +747,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -670,6 +776,9 @@ def list_by_automation_account( ) -> Iterable["_models.Module"]: """Retrieve a list of python 3 packages. + .. seealso:: + - http://aka.ms/azureautomationsdk/moduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -682,7 +791,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ModuleListResult] = kwargs.pop("cls", None) error_map = { @@ -725,8 +834,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_draft_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_draft_operations.py index 0168fc1dfd72..4689f25b80fd 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_draft_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_draft_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast from azure.core.exceptions import ( @@ -28,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +42,7 @@ def build_get_content_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "text/powershell") # Construct URL @@ -61,10 +56,10 @@ def build_get_content_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -87,7 +82,7 @@ def build_replace_content_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -102,10 +97,10 @@ def build_replace_content_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -124,7 +119,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,10 +133,10 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -158,7 +153,7 @@ def build_undo_edit_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,10 +167,10 @@ def build_undo_edit_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -211,6 +206,9 @@ def get_content( ) -> Iterator[bytes]: """Retrieve the content of runbook draft identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -233,7 +231,7 @@ def get_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) request = build_get_content_request( @@ -249,8 +247,9 @@ def get_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=True, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -289,7 +288,7 @@ def _replace_content_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[Iterator[bytes]]] = kwargs.pop("cls", None) @@ -310,8 +309,9 @@ def _replace_content_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=True, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -349,6 +349,9 @@ def begin_replace_content( ) -> LROPoller[Iterator[bytes]]: """Replaces the runbook draft content. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -373,7 +376,7 @@ def begin_replace_content( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -427,6 +430,9 @@ def get( ) -> _models.RunbookDraft: """Retrieve the runbook draft identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -449,7 +455,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.RunbookDraft] = kwargs.pop("cls", None) request = build_get_request( @@ -465,8 +471,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -493,6 +500,9 @@ def undo_edit( ) -> _models.RunbookDraftUndoEditResult: """Undo draft edit to last known published state identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -515,7 +525,7 @@ def undo_edit( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.RunbookDraftUndoEditResult] = kwargs.pop("cls", None) request = build_undo_edit_request( @@ -531,8 +541,9 @@ def undo_edit( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_operations.py index 3b9098bee619..416d41809752 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_runbook_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload from azure.core.exceptions import ( @@ -29,12 +29,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +44,7 @@ def build_publish_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,10 +58,10 @@ def build_publish_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_content_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "text/powershell") # Construct URL @@ -96,10 +92,10 @@ def build_get_content_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +112,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,10 +126,10 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -150,7 +146,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -165,10 +161,10 @@ def build_create_or_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -187,7 +183,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -202,10 +198,10 @@ def build_update_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -224,7 +220,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -238,10 +234,10 @@ def build_delete_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -258,7 +254,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -274,7 +270,7 @@ def build_list_by_automation_account_request( "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -318,7 +314,7 @@ def _publish_initial( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_publish_request( @@ -334,8 +330,9 @@ def _publish_initial( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -361,6 +358,9 @@ def begin_publish( ) -> LROPoller[None]: """Publish runbook draft. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookdraftoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -382,7 +382,7 @@ def begin_publish( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -429,6 +429,9 @@ def get_content( ) -> Iterator[bytes]: """Retrieve the content of runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -451,7 +454,7 @@ def get_content( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) request = build_get_content_request( @@ -467,8 +470,9 @@ def get_content( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=True, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -494,6 +498,9 @@ def get( ) -> _models.Runbook: """Retrieve the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -516,7 +523,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Runbook] = kwargs.pop("cls", None) request = build_get_request( @@ -532,8 +539,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -567,6 +575,9 @@ def create_or_update( ) -> _models.Runbook: """Create the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -598,6 +609,9 @@ def create_or_update( ) -> _models.Runbook: """Create the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -627,6 +641,9 @@ def create_or_update( ) -> _models.Runbook: """Create the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -634,7 +651,8 @@ def create_or_update( :param runbook_name: The runbook name. Required. :type runbook_name: str :param parameters: The create or update parameters for runbook. Provide either content link for - a published runbook or draft, not both. Is either a model type or a IO type. Required. + a published runbook or draft, not both. Is either a RunbookCreateOrUpdateParameters type or a + IO type. Required. :type parameters: ~azure.mgmt.automation.models.RunbookCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -655,14 +673,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Runbook] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RunbookCreateOrUpdateParameters") @@ -683,8 +701,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -722,6 +741,9 @@ def update( ) -> _models.Runbook: """Update the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -752,6 +774,9 @@ def update( ) -> _models.Runbook: """Update the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -780,14 +805,17 @@ def update( ) -> _models.Runbook: """Update the runbook identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param runbook_name: The runbook name. Required. :type runbook_name: str - :param parameters: The update parameters for runbook. Is either a model type or a IO type. - Required. + :param parameters: The update parameters for runbook. Is either a RunbookUpdateParameters type + or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.RunbookUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -808,14 +836,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Runbook] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "RunbookUpdateParameters") @@ -836,8 +864,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -864,6 +893,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the runbook by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -886,7 +918,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -902,8 +934,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -926,6 +959,9 @@ def list_by_automation_account( ) -> Iterable["_models.Runbook"]: """Retrieve a list of runbooks. + .. seealso:: + - http://aka.ms/azureautomationsdk/runbookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -938,7 +974,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.RunbookListResult] = kwargs.pop("cls", None) error_map = { @@ -981,8 +1017,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_schedule_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_schedule_operations.py index 7788fca6ce08..ad150086be28 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_schedule_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_schedule_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -64,7 +60,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,7 +79,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -101,7 +97,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -120,7 +116,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +133,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -154,7 +150,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +167,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +184,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +200,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -247,6 +243,9 @@ def create_or_update( ) -> Optional[_models.Schedule]: """Create a schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -278,6 +277,9 @@ def create_or_update( ) -> Optional[_models.Schedule]: """Create a schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -307,6 +309,9 @@ def create_or_update( ) -> Optional[_models.Schedule]: """Create a schedule. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -314,7 +319,7 @@ def create_or_update( :param schedule_name: The schedule name. Required. :type schedule_name: str :param parameters: The parameters supplied to the create or update schedule operation. Is - either a model type or a IO type. Required. + either a ScheduleCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ScheduleCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -335,14 +340,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Optional[_models.Schedule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ScheduleCreateOrUpdateParameters") @@ -363,8 +368,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -403,6 +409,9 @@ def update( ) -> _models.Schedule: """Update the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -433,6 +442,9 @@ def update( ) -> _models.Schedule: """Update the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -461,14 +473,17 @@ def update( ) -> _models.Schedule: """Update the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param schedule_name: The schedule name. Required. :type schedule_name: str - :param parameters: The parameters supplied to the update schedule operation. Is either a model - type or a IO type. Required. + :param parameters: The parameters supplied to the update schedule operation. Is either a + ScheduleUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.ScheduleUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -489,14 +504,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "ScheduleUpdateParameters") @@ -517,8 +532,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -545,6 +561,9 @@ def get( ) -> _models.Schedule: """Retrieve the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -567,7 +586,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Schedule] = kwargs.pop("cls", None) request = build_get_request( @@ -583,8 +602,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -611,6 +631,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the schedule identified by schedule name. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -633,7 +656,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -649,8 +672,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -673,6 +697,9 @@ def list_by_automation_account( ) -> Iterable["_models.Schedule"]: """Retrieve a list of schedules. + .. seealso:: + - http://aka.ms/azureautomationsdk/scheduleoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -685,7 +712,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.ScheduleListResult] = kwargs.pop("cls", None) error_map = { @@ -728,8 +755,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_machine_runs_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_machine_runs_operations.py index 3ad108e767be..a2f28b70ea74 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_machine_runs_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_machine_runs_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +46,7 @@ def build_get_by_id_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +65,7 @@ def build_get_by_id_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +92,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +108,7 @@ def build_list_request( "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -162,6 +157,9 @@ def get_by_id( ) -> _models.SoftwareUpdateConfigurationMachineRun: """Get a single software update configuration machine run by Id. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -187,7 +185,7 @@ def get_by_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SoftwareUpdateConfigurationMachineRun] = kwargs.pop("cls", None) request = build_get_by_id_request( @@ -204,8 +202,9 @@ def get_by_id( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -239,6 +238,9 @@ def list( ) -> _models.SoftwareUpdateConfigurationMachineRunListResult: """Return list of software update configuration machine runs. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -270,7 +272,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SoftwareUpdateConfigurationMachineRunListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -289,8 +291,9 @@ def list( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_runs_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_runs_operations.py index af550b9c2421..daf855dbdbfb 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_runs_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configuration_runs_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( @@ -26,12 +25,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +46,7 @@ def build_get_by_id_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +65,7 @@ def build_get_by_id_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -97,7 +92,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +108,7 @@ def build_list_request( "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -162,6 +157,9 @@ def get_by_id( ) -> _models.SoftwareUpdateConfigurationRun: """Get a single software update configuration Run by Id. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationrunoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -187,7 +185,7 @@ def get_by_id( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SoftwareUpdateConfigurationRun] = kwargs.pop("cls", None) request = build_get_by_id_request( @@ -204,8 +202,9 @@ def get_by_id( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -239,6 +238,9 @@ def list( ) -> _models.SoftwareUpdateConfigurationRunListResult: """Return list of software update configuration runs. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -270,7 +272,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SoftwareUpdateConfigurationRunListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -289,8 +291,9 @@ def list( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configurations_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configurations_operations.py index 2fc4294217af..f8cecccc7a00 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configurations_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_software_update_configurations_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -26,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +47,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -71,7 +67,7 @@ def build_create_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,7 +94,7 @@ def build_get_by_name_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +113,7 @@ def build_get_by_name_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -142,7 +138,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +157,7 @@ def build_delete_request( ), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -186,7 +182,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -202,7 +198,7 @@ def build_list_request( "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -250,6 +246,9 @@ def create( ) -> _models.SoftwareUpdateConfiguration: """Create a new software update configuration with the name given in the URI. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -284,6 +283,9 @@ def create( ) -> _models.SoftwareUpdateConfiguration: """Create a new software update configuration with the name given in the URI. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -316,6 +318,9 @@ def create( ) -> _models.SoftwareUpdateConfiguration: """Create a new software update configuration with the name given in the URI. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -323,7 +328,8 @@ def create( :param software_update_configuration_name: The name of the software update configuration to be created. Required. :type software_update_configuration_name: str - :param parameters: Request body. Is either a model type or a IO type. Required. + :param parameters: Request body. Is either a SoftwareUpdateConfiguration type or a IO type. + Required. :type parameters: ~azure.mgmt.automation.models.SoftwareUpdateConfiguration or IO :param client_request_id: Identifies this specific client request. Default value is None. :type client_request_id: str @@ -346,14 +352,14 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SoftwareUpdateConfiguration] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SoftwareUpdateConfiguration") @@ -375,8 +381,9 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -412,6 +419,9 @@ def get_by_name( ) -> _models.SoftwareUpdateConfiguration: """Get a single software update configuration by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -437,7 +447,7 @@ def get_by_name( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) cls: ClsType[_models.SoftwareUpdateConfiguration] = kwargs.pop("cls", None) request = build_get_by_name_request( @@ -454,8 +464,9 @@ def get_by_name( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -487,6 +498,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """delete a specific software update configuration. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -512,7 +526,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -529,8 +543,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -558,6 +573,9 @@ def list( ) -> _models.SoftwareUpdateConfigurationListResult: """Get all software update configurations for the account. + .. seealso:: + - http://aka.ms/azureautomationsdk/softwareupdateconfigurationoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -582,7 +600,7 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2019-06-01"] = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) cls: ClsType[_models.SoftwareUpdateConfigurationListResult] = kwargs.pop("cls", None) request = build_list_request( @@ -599,8 +617,9 @@ def list( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_operations.py index 8c58d2fc5e71..6d8dae4ae827 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +46,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -68,7 +64,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -91,7 +87,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -109,7 +105,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -132,7 +128,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +145,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -170,7 +166,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -187,7 +183,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -209,7 +205,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -225,7 +221,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -270,6 +266,9 @@ def create_or_update( ) -> _models.SourceControl: """Create a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -301,6 +300,9 @@ def create_or_update( ) -> _models.SourceControl: """Create a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -330,6 +332,9 @@ def create_or_update( ) -> _models.SourceControl: """Create a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -337,7 +342,7 @@ def create_or_update( :param source_control_name: The source control name. Required. :type source_control_name: str :param parameters: The parameters supplied to the create or update source control operation. Is - either a model type or a IO type. Required. + either a SourceControlCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.SourceControlCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -358,14 +363,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SourceControlCreateOrUpdateParameters") @@ -386,8 +391,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -425,6 +431,9 @@ def update( ) -> _models.SourceControl: """Update a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -455,6 +464,9 @@ def update( ) -> _models.SourceControl: """Update a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -483,6 +495,9 @@ def update( ) -> _models.SourceControl: """Update a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -490,7 +505,7 @@ def update( :param source_control_name: The source control name. Required. :type source_control_name: str :param parameters: The parameters supplied to the update source control operation. Is either a - model type or a IO type. Required. + SourceControlUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.SourceControlUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -511,14 +526,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SourceControlUpdateParameters") @@ -539,8 +554,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -567,6 +583,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -589,7 +608,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -605,8 +624,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -629,6 +649,9 @@ def get( ) -> _models.SourceControl: """Retrieve the source control identified by source control name. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -651,7 +674,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControl] = kwargs.pop("cls", None) request = build_get_request( @@ -667,8 +690,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -695,6 +719,9 @@ def list_by_automation_account( ) -> Iterable["_models.SourceControl"]: """Retrieve a list of source controls. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontroloperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -709,7 +736,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlListResult] = kwargs.pop("cls", None) error_map = { @@ -753,8 +780,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_operations.py index 0c41e15aa9d1..3b57408ce453 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +47,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -70,7 +66,7 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -94,7 +90,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,7 +108,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -135,7 +131,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +148,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -198,6 +194,9 @@ def create( ) -> _models.SourceControlSyncJob: """Creates the sync job for a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -232,6 +231,9 @@ def create( ) -> _models.SourceControlSyncJob: """Creates the sync job for a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -264,6 +266,9 @@ def create( ) -> _models.SourceControlSyncJob: """Creates the sync job for a source control. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -273,7 +278,7 @@ def create( :param source_control_sync_job_id: The source control sync job id. Required. :type source_control_sync_job_id: str :param parameters: The parameters supplied to the create source control sync job operation. Is - either a model type or a IO type. Required. + either a SourceControlSyncJobCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.SourceControlSyncJobCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -294,14 +299,14 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SourceControlSyncJob] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "SourceControlSyncJobCreateParameters") @@ -323,8 +328,9 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -356,6 +362,9 @@ def get( ) -> _models.SourceControlSyncJobById: """Retrieve the source control sync job identified by job id. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -380,7 +389,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlSyncJobById] = kwargs.pop("cls", None) request = build_get_request( @@ -397,8 +406,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -430,6 +440,9 @@ def list_by_automation_account( ) -> Iterable["_models.SourceControlSyncJob"]: """Retrieve a list of source control sync jobs. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -447,7 +460,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlSyncJobListResult] = kwargs.pop("cls", None) error_map = { @@ -492,8 +505,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_streams_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_streams_operations.py index 314e759b1941..c7ff655c9455 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_streams_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_source_control_sync_job_streams_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -53,7 +48,7 @@ def build_list_by_sync_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +66,7 @@ def build_list_by_sync_job_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -96,7 +91,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +110,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -157,6 +152,9 @@ def list_by_sync_job( ) -> Iterable["_models.SourceControlSyncJobStream"]: """Retrieve a list of sync job streams identified by sync job id. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -176,7 +174,7 @@ def list_by_sync_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlSyncJobStreamsListBySyncJob] = kwargs.pop("cls", None) error_map = { @@ -222,8 +220,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -252,6 +251,9 @@ def get( ) -> _models.SourceControlSyncJobStreamById: """Retrieve a sync job stream identified by stream id. + .. seealso:: + - http://aka.ms/azureautomationsdk/sourcecontrolsyncjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -278,7 +280,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.SourceControlSyncJobStreamById] = kwargs.pop("cls", None) request = build_get_request( @@ -296,8 +298,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_statistics_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_statistics_operations.py index c55349c27844..7d8ba8a060af 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_statistics_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_statistics_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +46,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +62,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -105,6 +100,9 @@ def list_by_automation_account( ) -> Iterable["_models.Statistics"]: """Retrieve the statistics for the account. + .. seealso:: + - http://aka.ms/azureautomationsdk/statisticsoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -119,7 +117,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.StatisticsListResult] = kwargs.pop("cls", None) error_map = { @@ -163,8 +161,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_operations.py index f9f05316a2c7..f3d01977bdfc 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -26,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +41,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -60,10 +56,10 @@ def build_create_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -82,7 +78,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,10 +92,10 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -116,7 +112,7 @@ def build_resume_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,10 +126,10 @@ def build_resume_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -150,7 +146,7 @@ def build_stop_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,10 +160,10 @@ def build_stop_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -184,7 +180,7 @@ def build_suspend_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,10 +194,10 @@ def build_suspend_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -244,6 +240,9 @@ def create( ) -> _models.TestJob: """Create a test job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -274,6 +273,9 @@ def create( ) -> _models.TestJob: """Create a test job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -302,14 +304,17 @@ def create( ) -> _models.TestJob: """Create a test job of the runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param runbook_name: The parameters supplied to the create test job operation. Required. :type runbook_name: str - :param parameters: The parameters supplied to the create test job operation. Is either a model - type or a IO type. Required. + :param parameters: The parameters supplied to the create test job operation. Is either a + TestJobCreateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.TestJobCreateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -330,14 +335,14 @@ def create( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.TestJob] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "TestJobCreateParameters") @@ -358,8 +363,9 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -386,6 +392,9 @@ def get( ) -> _models.TestJob: """Retrieve the test job for the specified runbook. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -408,7 +417,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.TestJob] = kwargs.pop("cls", None) request = build_get_request( @@ -424,8 +433,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -452,6 +462,9 @@ def resume( # pylint: disable=inconsistent-return-statements ) -> None: """Resume the test job. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -474,7 +487,7 @@ def resume( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_resume_request( @@ -490,8 +503,9 @@ def resume( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -514,6 +528,9 @@ def stop( # pylint: disable=inconsistent-return-statements ) -> None: """Stop the test job. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -536,7 +553,7 @@ def stop( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -552,8 +569,9 @@ def stop( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -576,6 +594,9 @@ def suspend( # pylint: disable=inconsistent-return-statements ) -> None: """Suspend the test job. + .. seealso:: + - http://aka.ms/azureautomationsdk/testjoboperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -598,7 +619,7 @@ def suspend( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_suspend_request( @@ -614,8 +635,9 @@ def suspend( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_streams_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_streams_operations.py index e20b0d12c927..8502283ee3e1 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_streams_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_test_job_streams_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -51,7 +46,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,11 +60,11 @@ def build_get_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), "jobStreamId": _SERIALIZER.url("job_stream_id", job_stream_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -92,7 +87,7 @@ def build_list_by_test_job_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -106,10 +101,10 @@ def build_list_by_test_job_request( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1, pattern=r"^[-\w\._]+$" ), "automationAccountName": _SERIALIZER.url("automation_account_name", automation_account_name, "str"), - "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z]*-*[a-zA-Z0-9]*$"), + "runbookName": _SERIALIZER.url("runbook_name", runbook_name, "str", pattern=r"^[a-zA-Z][a-zA-Z-_0-9]*$"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -152,6 +147,9 @@ def get( ) -> _models.JobStream: """Retrieve a test job stream of the test job identified by runbook name and stream id. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -176,7 +174,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobStream] = kwargs.pop("cls", None) request = build_get_request( @@ -193,8 +191,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -226,6 +225,9 @@ def list_by_test_job( ) -> Iterable["_models.JobStream"]: """Retrieve a list of test job streams identified by runbook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/jobstreamoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -242,7 +244,7 @@ def list_by_test_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.JobStreamListResult] = kwargs.pop("cls", None) error_map = { @@ -287,8 +289,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_usages_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_usages_operations.py index 46d2b4c00a69..96d4f7ebe062 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_usages_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_usages_operations.py @@ -6,7 +6,6 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from azure.core.exceptions import ( @@ -27,12 +26,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +41,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +57,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -98,6 +93,9 @@ def list_by_automation_account( ) -> Iterable["_models.Usage"]: """Retrieve the usage for the account id. + .. seealso:: + - http://aka.ms/azureautomationsdk/usageoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -110,7 +108,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map = { @@ -153,8 +151,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_variable_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_variable_operations.py index 33b9118074cf..922dab75bbfa 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_variable_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_variable_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -64,7 +60,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -83,7 +79,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -101,7 +97,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -120,7 +116,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +133,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -154,7 +150,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +167,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -188,7 +184,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +200,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -247,6 +243,9 @@ def create_or_update( ) -> _models.Variable: """Create a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -278,6 +277,9 @@ def create_or_update( ) -> _models.Variable: """Create a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -307,6 +309,9 @@ def create_or_update( ) -> _models.Variable: """Create a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -314,7 +319,7 @@ def create_or_update( :param variable_name: The variable name. Required. :type variable_name: str :param parameters: The parameters supplied to the create or update variable operation. Is - either a model type or a IO type. Required. + either a VariableCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.VariableCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -335,14 +340,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VariableCreateOrUpdateParameters") @@ -363,8 +368,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -402,6 +408,9 @@ def update( ) -> _models.Variable: """Update a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -432,6 +441,9 @@ def update( ) -> _models.Variable: """Update a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -460,14 +472,17 @@ def update( ) -> _models.Variable: """Update a variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param variable_name: The variable name. Required. :type variable_name: str - :param parameters: The parameters supplied to the update variable operation. Is either a model - type or a IO type. Required. + :param parameters: The parameters supplied to the update variable operation. Is either a + VariableUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.VariableUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -488,14 +503,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "VariableUpdateParameters") @@ -516,8 +531,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -544,6 +560,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the variable. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -566,7 +585,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -582,8 +601,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -606,6 +626,9 @@ def get( ) -> _models.Variable: """Retrieve the variable identified by variable name. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -628,7 +651,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.Variable] = kwargs.pop("cls", None) request = build_get_request( @@ -644,8 +667,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -672,6 +696,9 @@ def list_by_automation_account( ) -> Iterable["_models.Variable"]: """Retrieve a list of variables. + .. seealso:: + - http://aka.ms/azureautomationsdk/variableoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -684,7 +711,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2022-08-08"] = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-08")) cls: ClsType[_models.VariableListResult] = kwargs.pop("cls", None) error_map = { @@ -727,8 +754,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_watcher_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_watcher_operations.py index 66097fe791af..7e653b3013c2 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_watcher_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_watcher_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,9 +42,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -66,7 +60,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -85,9 +79,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +96,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -121,9 +113,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -141,7 +131,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -160,9 +150,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +167,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -196,9 +184,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +201,7 @@ def build_start_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -232,9 +218,7 @@ def build_stop_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +235,7 @@ def build_stop_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -273,9 +257,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -291,7 +273,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -336,6 +318,9 @@ def create_or_update( ) -> _models.Watcher: """Create the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -366,6 +351,9 @@ def create_or_update( ) -> _models.Watcher: """Create the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -394,14 +382,17 @@ def create_or_update( ) -> _models.Watcher: """Create the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param watcher_name: The watcher name. Required. :type watcher_name: str - :param parameters: The create or update parameters for watcher. Is either a model type or a IO - type. Required. + :param parameters: The create or update parameters for watcher. Is either a Watcher type or a + IO type. Required. :type parameters: ~azure.mgmt.automation.models.Watcher or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -422,16 +413,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Watcher] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "Watcher") @@ -452,8 +441,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -484,6 +474,9 @@ def get( ) -> _models.Watcher: """Retrieve the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -506,9 +499,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.Watcher] = kwargs.pop("cls", None) request = build_get_request( @@ -524,8 +515,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -559,6 +551,9 @@ def update( ) -> _models.Watcher: """Update the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -589,6 +584,9 @@ def update( ) -> _models.Watcher: """Update the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -617,14 +615,17 @@ def update( ) -> _models.Watcher: """Update the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param watcher_name: The watcher name. Required. :type watcher_name: str - :param parameters: The update parameters for watcher. Is either a model type or a IO type. - Required. + :param parameters: The update parameters for watcher. Is either a WatcherUpdateParameters type + or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.WatcherUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -645,16 +646,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Watcher] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WatcherUpdateParameters") @@ -675,8 +674,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -703,6 +703,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the watcher by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -725,9 +728,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -743,8 +744,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -767,6 +769,9 @@ def start( # pylint: disable=inconsistent-return-statements ) -> None: """Resume the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -789,9 +794,7 @@ def start( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_start_request( @@ -807,8 +810,9 @@ def start( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -831,6 +835,9 @@ def stop( # pylint: disable=inconsistent-return-statements ) -> None: """Resume the watcher identified by watcher name. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -853,9 +860,7 @@ def stop( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_stop_request( @@ -871,8 +876,9 @@ def stop( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -895,6 +901,9 @@ def list_by_automation_account( ) -> Iterable["_models.Watcher"]: """Retrieve a list of watchers. + .. seealso:: + - http://aka.ms/azureautomationsdk/watcheroperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -909,9 +918,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2020-01-13-preview"] = kwargs.pop( - "api_version", _params.pop("api-version", "2020-01-13-preview") - ) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-01-13-preview")) cls: ClsType[_models.WatcherListResult] = kwargs.pop("cls", None) error_map = { @@ -955,8 +962,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_webhook_operations.py b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_webhook_operations.py index d738fc7d1b05..5acc20bff618 100644 --- a/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_webhook_operations.py +++ b/sdk/automation/azure-mgmt-automation/azure/mgmt/automation/operations/_webhook_operations.py @@ -6,7 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import sys +from io import IOBase from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from azure.core.exceptions import ( @@ -27,12 +27,8 @@ from .. import models as _models from .._serialization import Serializer -from .._vendor import AutomationClientMixinABC, _convert_request, _format_url_section +from .._vendor import AutomationClientMixinABC, _convert_request -if sys.version_info >= (3, 8): - from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports -else: - from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +42,7 @@ def build_generate_uri_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -62,7 +58,7 @@ def build_generate_uri_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -79,7 +75,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +92,7 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -113,7 +109,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +126,7 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -147,7 +143,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -165,7 +161,7 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -184,7 +180,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -202,7 +198,7 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -226,7 +222,7 @@ def build_list_by_automation_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -242,7 +238,7 @@ def build_list_by_automation_account_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } - _url: str = _format_url_section(_url, **path_format_arguments) # type: ignore + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters if filter is not None: @@ -278,6 +274,9 @@ def __init__(self, *args, **kwargs): def generate_uri(self, resource_group_name: str, automation_account_name: str, **kwargs: Any) -> str: """Generates a Uri for use in creating a webhook. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -298,7 +297,7 @@ def generate_uri(self, resource_group_name: str, automation_account_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) cls: ClsType[str] = kwargs.pop("cls", None) request = build_generate_uri_request( @@ -313,8 +312,9 @@ def generate_uri(self, resource_group_name: str, automation_account_name: str, * request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -341,6 +341,9 @@ def delete( # pylint: disable=inconsistent-return-statements ) -> None: """Delete the webhook by name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -363,7 +366,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) cls: ClsType[None] = kwargs.pop("cls", None) request = build_delete_request( @@ -379,8 +382,9 @@ def delete( # pylint: disable=inconsistent-return-statements request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -403,6 +407,9 @@ def get( ) -> _models.Webhook: """Retrieve the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -425,7 +432,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) cls: ClsType[_models.Webhook] = kwargs.pop("cls", None) request = build_get_request( @@ -441,8 +448,9 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -476,6 +484,9 @@ def create_or_update( ) -> _models.Webhook: """Create the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -506,6 +517,9 @@ def create_or_update( ) -> _models.Webhook: """Create the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -534,14 +548,17 @@ def create_or_update( ) -> _models.Webhook: """Create the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param webhook_name: The webhook name. Required. :type webhook_name: str - :param parameters: The create or update parameters for webhook. Is either a model type or a IO - type. Required. + :param parameters: The create or update parameters for webhook. Is either a + WebhookCreateOrUpdateParameters type or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.WebhookCreateOrUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -562,14 +579,14 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Webhook] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WebhookCreateOrUpdateParameters") @@ -590,8 +607,9 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -629,6 +647,9 @@ def update( ) -> _models.Webhook: """Update the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -659,6 +680,9 @@ def update( ) -> _models.Webhook: """Update the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -687,14 +711,17 @@ def update( ) -> _models.Webhook: """Update the webhook identified by webhook name. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. :type automation_account_name: str :param webhook_name: The webhook name. Required. :type webhook_name: str - :param parameters: The update parameters for webhook. Is either a model type or a IO type. - Required. + :param parameters: The update parameters for webhook. Is either a WebhookUpdateParameters type + or a IO type. Required. :type parameters: ~azure.mgmt.automation.models.WebhookUpdateParameters or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. @@ -715,14 +742,14 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Webhook] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None _content = None - if isinstance(parameters, (IO, bytes)): + if isinstance(parameters, (IOBase, bytes)): _content = parameters else: _json = self._serialize.body(parameters, "WebhookUpdateParameters") @@ -743,8 +770,9 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response @@ -771,6 +799,9 @@ def list_by_automation_account( ) -> Iterable["_models.Webhook"]: """Retrieve a list of webhooks. + .. seealso:: + - http://aka.ms/azureautomationsdk/webhookoperations + :param resource_group_name: Name of an Azure Resource group. Required. :type resource_group_name: str :param automation_account_name: The name of the automation account. Required. @@ -785,7 +816,7 @@ def list_by_automation_account( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: Literal["2015-10-31"] = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2015-10-31")) cls: ClsType[_models.WebhookListResult] = kwargs.pop("cls", None) error_map = { @@ -829,8 +860,9 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=False, **kwargs + request, stream=_stream, **kwargs ) response = pipeline_response.http_response diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/create_or_update_python3_package.py b/sdk/automation/azure-mgmt-automation/generated_samples/create_or_update_python3_package.py index 05ebdbeca55d..366aa093e93c 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/create_or_update_python3_package.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/create_or_update_python3_package.py @@ -29,7 +29,7 @@ def main(): subscription_id="subid", ) - response = client.python3_package.create_or_update( + response = client.python3_package.begin_create_or_update( resource_group_name="rg", automation_account_name="myAutomationAccount33", package_name="OmsCompositeResources", @@ -46,7 +46,7 @@ def main(): }, "tags": {}, }, - ) + ).result() print(response) diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_automation_account.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_automation_account.py index e20284362dff..b3a71072b28c 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_automation_account.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_automation_account.py @@ -29,11 +29,10 @@ def main(): subscription_id="subid", ) - response = client.automation_account.delete( + client.automation_account.delete( resource_group_name="rg", automation_account_name="myAutomationAccount9", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteAutomationAccount.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_certificate.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_certificate.py index 61fd5294d6ec..56b460b7c086 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_certificate.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_certificate.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.certificate.delete( + client.certificate.delete( resource_group_name="rg", automation_account_name="myAutomationAccount33", certificate_name="testCert", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteCertificate.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_connection.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_connection.py index a3a0ad565068..cb23399723e5 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_connection.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_connection.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.connection.delete( + client.connection.delete( resource_group_name="rg", automation_account_name="myAutomationAccount28", connection_name="myConnection", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteConnection.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_connection_type.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_connection_type.py index f929c0d808aa..2dd3f6eabc4b 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_connection_type.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_connection_type.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.connection_type.delete( + client.connection_type.delete( resource_group_name="rg", automation_account_name="myAutomationAccount22", connection_type_name="myCT", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteConnectionType.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_credential_existing.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_credential_existing.py index 798b2233ab98..f7fabe982f39 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_credential_existing.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_credential_existing.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.credential.delete( + client.credential.delete( resource_group_name="rg", automation_account_name="myAutomationAccount20", credential_name="myCredential", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteCredentialExisting.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_configuration.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_configuration.py index 4f6167ad95e6..da99b70a34e5 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_configuration.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_configuration.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.dsc_configuration.delete( + client.dsc_configuration.delete( resource_group_name="rg", automation_account_name="myAutomationAccount33", configuration_name="TemplateBasic", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteDscConfiguration.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_node.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_node.py index 6ba11c5dd893..758358286b96 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_node.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_node.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.dsc_node.delete( + client.dsc_node.delete( resource_group_name="rg", automation_account_name="myAutomationAccount9", node_id="e1243a76-a9bd-432f-bde3-ad8f317ee786", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteDscNode.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_node_configuration.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_node_configuration.py index 986c71cb656b..1191c578b088 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_node_configuration.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_dsc_node_configuration.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.dsc_node_configuration.delete( + client.dsc_node_configuration.delete( resource_group_name="rg", automation_account_name="myAutomationAccount20", node_configuration_name="configName.nodeConfigName", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteDscNodeConfiguration.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_hybrid_runbook_worker.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_hybrid_runbook_worker.py index d57ea4f58b6c..5131c5415035 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_hybrid_runbook_worker.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_hybrid_runbook_worker.py @@ -29,13 +29,12 @@ def main(): subscription_id="subid", ) - response = client.hybrid_runbook_workers.delete( + client.hybrid_runbook_workers.delete( resource_group_name="rg", automation_account_name="myAutomationAccount20", hybrid_runbook_worker_group_name="myGroup", hybrid_runbook_worker_id="c010ad12-ef14-4a2a-aa9e-ef22c4745ddd", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteHybridRunbookWorker.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_hybrid_runbook_worker_group.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_hybrid_runbook_worker_group.py index d2756c5337d4..a9df2f45b4db 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_hybrid_runbook_worker_group.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_hybrid_runbook_worker_group.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.hybrid_runbook_worker_group.delete( + client.hybrid_runbook_worker_group.delete( resource_group_name="rg", automation_account_name="myAutomationAccount20", hybrid_runbook_worker_group_name="myGroup", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteHybridRunbookWorkerGroup.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_job_schedule.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_job_schedule.py index 8a4366dc6e0d..7e98557bc7d2 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_job_schedule.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_job_schedule.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.job_schedule.delete( + client.job_schedule.delete( resource_group_name="rg", automation_account_name="ContoseAutomationAccount", job_schedule_id="0fa462ba-3aa2-4138-83ca-9ebc3bc55cdc", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteJobSchedule.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_module.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_module.py index 3758f7cbd3b2..26896a4fb4df 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_module.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_module.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.module.delete( + client.module.delete( resource_group_name="rg", automation_account_name="myAutomationAccount33", module_name="OmsCompositeResources", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteModule.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_python2_package.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_python2_package.py index ba772b1f15c1..d4e8797815e4 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_python2_package.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_python2_package.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.python2_package.delete( + client.python2_package.delete( resource_group_name="rg", automation_account_name="myAutomationAccount33", package_name="OmsCompositeResources", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deletePython2Package.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_python3_package.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_python3_package.py index 49b6c157e7ce..d4d5fc71b6cf 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_python3_package.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_python3_package.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.python3_package.delete( + client.python3_package.delete( resource_group_name="rg", automation_account_name="myAutomationAccount33", package_name="OmsCompositeResources", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deletePython3Package.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_runbook.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_runbook.py index bd4aeccefb63..e57d51da3fda 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_runbook.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_runbook.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.runbook.delete( + client.runbook.delete( resource_group_name="rg", automation_account_name="ContoseAutomationAccount", runbook_name="Get-AzureVMTutorial", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteRunbook.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_schedule.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_schedule.py index e4bbe77ff19a..cd48f043b6bb 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_schedule.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_schedule.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.schedule.delete( + client.schedule.delete( resource_group_name="rg", automation_account_name="myAutomationAccount33", schedule_name="mySchedule", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteSchedule.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_variable.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_variable.py index 373381e793b3..2f1c5b220ce1 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_variable.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_variable.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.variable.delete( + client.variable.delete( resource_group_name="rg", automation_account_name="sampleAccount9", variable_name="sampleVariable", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/deleteVariable.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_watcher.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_watcher.py index 0c14c65c24c2..3849782d4466 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_watcher.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_watcher.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.watcher.delete( + client.watcher.delete( resource_group_name="rg", automation_account_name="MyTestAutomationAccount", watcher_name="MyTestWatcher", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/deleteWatcher.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_webhook.py b/sdk/automation/azure-mgmt-automation/generated_samples/delete_webhook.py index 5998a5bd524d..29a72bc49103 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_webhook.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/delete_webhook.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.webhook.delete( + client.webhook.delete( resource_group_name="rg", automation_account_name="myAutomationAccount33", webhook_name="TestWebhook", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2015-10-31/examples/deleteWebhook.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/create_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/create_job.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/create_job.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/create_job.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/get_job.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_job.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/get_job.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_job_output.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/get_job_output.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_job_output.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/get_job_output.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_job_runbook_content.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/get_job_runbook_content.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_job_runbook_content.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/get_job_runbook_content.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_job_stream.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/get_job_stream.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_job_stream.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/get_job_stream.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/list_job_streams_by_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/list_job_streams_by_job.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/list_job_streams_by_job.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/list_job_streams_by_job.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/list_jobs_by_automation_account.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/list_jobs_by_automation_account.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/list_jobs_by_automation_account.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/list_jobs_by_automation_account.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/resume_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/resume_job.py similarity index 96% rename from sdk/automation/azure-mgmt-automation/generated_samples/resume_job.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/resume_job.py index 9f6449d75dcf..43a0fe539b16 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/resume_job.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/job/resume_job.py @@ -29,12 +29,11 @@ def main(): subscription_id="51766542-3ed7-4a72-a187-0c8ab644ddab", ) - response = client.job.resume( + client.job.resume( resource_group_name="mygroup", automation_account_name="ContoseAutomationAccount", job_name="foo", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/job/resumeJob.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/stop_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/stop_job.py similarity index 96% rename from sdk/automation/azure-mgmt-automation/generated_samples/stop_job.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/stop_job.py index b918877a09be..1aa7af5a910b 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/stop_job.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/job/stop_job.py @@ -29,12 +29,11 @@ def main(): subscription_id="51766542-3ed7-4a72-a187-0c8ab644ddab", ) - response = client.job.stop( + client.job.stop( resource_group_name="mygroup", automation_account_name="ContoseAutomationAccount", job_name="foo", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/job/stopJob.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/suspend_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/job/suspend_job.py similarity index 96% rename from sdk/automation/azure-mgmt-automation/generated_samples/suspend_job.py rename to sdk/automation/azure-mgmt-automation/generated_samples/job/suspend_job.py index 8d989be033b9..6acf7a8d3b61 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/suspend_job.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/job/suspend_job.py @@ -29,12 +29,11 @@ def main(): subscription_id="51766542-3ed7-4a72-a187-0c8ab644ddab", ) - response = client.job.suspend( + client.job.suspend( resource_group_name="mygroup", automation_account_name="ContoseAutomationAccount", job_name="foo", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/job/suspendJob.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/move_hybrid_runbook_worker.py b/sdk/automation/azure-mgmt-automation/generated_samples/move_hybrid_runbook_worker.py new file mode 100644 index 000000000000..fa33e3e2d024 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/generated_samples/move_hybrid_runbook_worker.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.automation import AutomationClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-automation +# USAGE + python move_hybrid_runbook_worker.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AutomationClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + client.hybrid_runbook_workers.move( + resource_group_name="rg", + automation_account_name="testaccount", + hybrid_runbook_worker_group_name="TestHybridGroup", + hybrid_runbook_worker_id="c010ad12-ef14-4a2a-aa9e-ef22c4745ddd", + hybrid_runbook_worker_move_parameters={"hybridRunbookWorkerGroupName": "TestHybridGroup2"}, + ) + + +# x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/moveHybridRunbookWorker.json +if __name__ == "__main__": + main() diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/private_endpoint_connection_delete.py b/sdk/automation/azure-mgmt-automation/generated_samples/private_endpoint_connection_delete.py index 90667792d25a..e8d8c53b414e 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/private_endpoint_connection_delete.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/private_endpoint_connection_delete.py @@ -29,12 +29,11 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.private_endpoint_connections.begin_delete( + client.private_endpoint_connections.begin_delete( resource_group_name="rg1", automation_account_name="ddb1", private_endpoint_connection_name="privateEndpointConnectionName", ).result() - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/PrivateEndpointConnectionDelete.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/publish_runbook.py b/sdk/automation/azure-mgmt-automation/generated_samples/publish_runbook.py index 8b27533bda34..8e1bdd665efb 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/publish_runbook.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/publish_runbook.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.runbook.begin_publish( + client.runbook.begin_publish( resource_group_name="rg", automation_account_name="ContoseAutomationAccount", runbook_name="Get-AzureVMTutorial", ).result() - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/publishRunbook.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/put_hybrid_runbook_worker.py b/sdk/automation/azure-mgmt-automation/generated_samples/put_hybrid_runbook_worker.py new file mode 100644 index 000000000000..529c8011af1f --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/generated_samples/put_hybrid_runbook_worker.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.automation import AutomationClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-automation +# USAGE + python put_hybrid_runbook_worker.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AutomationClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.hybrid_runbook_workers.create( + resource_group_name="rg", + automation_account_name="testaccount", + hybrid_runbook_worker_group_name="TestHybridGroup", + hybrid_runbook_worker_id="c010ad12-ef14-4a2a-aa9e-ef22c4745ddd", + hybrid_runbook_worker_creation_parameters={ + "properties": { + "vmResourceId": "/subscriptions/vmsubid/resourceGroups/vmrg/providers/Microsoft.Compute/virtualMachines/vmname" + } + }, + ) + print(response) + + +# x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/putHybridRunbookWorker.json +if __name__ == "__main__": + main() diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/put_hybrid_runbook_worker_group.py b/sdk/automation/azure-mgmt-automation/generated_samples/put_hybrid_runbook_worker_group.py new file mode 100644 index 000000000000..6f063346fe6d --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/generated_samples/put_hybrid_runbook_worker_group.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.automation import AutomationClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-automation +# USAGE + python put_hybrid_runbook_worker_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AutomationClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.hybrid_runbook_worker_group.create( + resource_group_name="rg", + automation_account_name="testaccount", + hybrid_runbook_worker_group_name="TestHybridGroup", + hybrid_runbook_worker_group_creation_parameters={ + "properties": {"credential": {"name": "myRunAsCredentialName"}} + }, + ) + print(response) + + +# x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/putHybridRunbookWorkerGroup.json +if __name__ == "__main__": + main() diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/resume_test_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/resume_test_job.py index 793545c2a9b7..e8be49d876ca 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/resume_test_job.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/resume_test_job.py @@ -29,12 +29,11 @@ def main(): subscription_id="51766542-3ed7-4a72-a187-0c8ab644ddab", ) - response = client.test_job.resume( + client.test_job.resume( resource_group_name="mygroup", automation_account_name="ContoseAutomationAccount", runbook_name="Get-AzureVMTutorial", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/resumeTestJob.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/create_software_update_configuration.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/create_software_update_configuration.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/create_software_update_configuration.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/create_software_update_configuration.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_software_update_configuration.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/delete_software_update_configuration.py similarity index 95% rename from sdk/automation/azure-mgmt-automation/generated_samples/delete_software_update_configuration.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/delete_software_update_configuration.py index 6e2eb24b74ed..4a51b8faf785 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_software_update_configuration.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/delete_software_update_configuration.py @@ -29,12 +29,11 @@ def main(): subscription_id="51766542-3ed7-4a72-a187-0c8ab644ddab", ) - response = client.software_update_configurations.delete( + client.software_update_configurations.delete( resource_group_name="mygroup", automation_account_name="myaccount", software_update_configuration_name="mypatch", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2019-06-01/examples/softwareUpdateConfiguration/deleteSoftwareUpdateConfiguration.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_software_update_configuration_by_name.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/get_software_update_configuration_by_name.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_software_update_configuration_by_name.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/get_software_update_configuration_by_name.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configurations.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/list_software_update_configurations.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configurations.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/list_software_update_configurations.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configurations_by_vm.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/list_software_update_configurations_by_vm.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configurations_by_vm.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration/list_software_update_configurations_by_vm.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_software_update_configuration_machine_run_by_id.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_machine_run/get_software_update_configuration_machine_run_by_id.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_software_update_configuration_machine_run_by_id.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_machine_run/get_software_update_configuration_machine_run_by_id.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configuration_machine_runs.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_machine_run/list_software_update_configuration_machine_runs.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configuration_machine_runs.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_machine_run/list_software_update_configuration_machine_runs.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configuration_machine_runs_by_run.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_machine_run/list_software_update_configuration_machine_runs_by_run.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configuration_machine_runs_by_run.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_machine_run/list_software_update_configuration_machine_runs_by_run.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_software_update_configuration_run_by_id.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_run/get_software_update_configuration_run_by_id.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_software_update_configuration_run_by_id.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_run/get_software_update_configuration_run_by_id.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/list_failed_software_update_configuration_runs.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_run/list_failed_software_update_configuration_runs.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/list_failed_software_update_configuration_runs.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_run/list_failed_software_update_configuration_runs.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configuration_runs.py b/sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_run/list_software_update_configuration_runs.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/list_software_update_configuration_runs.py rename to sdk/automation/azure-mgmt-automation/generated_samples/software_update_configuration_run/list_software_update_configuration_runs.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/create_or_update_source_control.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control/create_or_update_source_control.py similarity index 91% rename from sdk/automation/azure-mgmt-automation/generated_samples/create_or_update_source_control.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control/create_or_update_source_control.py index 714e153313c0..acf52caa2cd0 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/create_or_update_source_control.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/source_control/create_or_update_source_control.py @@ -41,10 +41,7 @@ def main(): "folderPath": "/folderOne/folderTwo", "publishRunbook": True, "repoUrl": "https://sampleUser.visualstudio.com/myProject/_git/myRepository", - "securityToken": { - "accessToken": "3a326f7a0dcd343ea58fee21f2fd5fb4c1234567", - "tokenType": "PersonalAccessToken", - }, + "securityToken": {"accessToken": "******", "tokenType": "PersonalAccessToken"}, "sourceType": "VsoGit", } }, diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/delete_source_control.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control/delete_source_control.py similarity index 95% rename from sdk/automation/azure-mgmt-automation/generated_samples/delete_source_control.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control/delete_source_control.py index 7d549e83d0ee..e3db9b78c83a 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/delete_source_control.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/source_control/delete_source_control.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.source_control.delete( + client.source_control.delete( resource_group_name="rg", automation_account_name="sampleAccount9", source_control_name="sampleSourceControl", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/sourceControl/deleteSourceControl.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_all_source_controls.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control/get_all_source_controls.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_all_source_controls.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control/get_all_source_controls.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_source_control.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control/get_source_control.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_source_control.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control/get_source_control.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/update_source_control_patch.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control/update_source_control_patch.py similarity index 90% rename from sdk/automation/azure-mgmt-automation/generated_samples/update_source_control_patch.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control/update_source_control_patch.py index 52f7e6b0d4e0..2fb782a5bf2e 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/update_source_control_patch.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/source_control/update_source_control_patch.py @@ -40,10 +40,7 @@ def main(): "description": "my description", "folderPath": "/folderOne/folderTwo", "publishRunbook": True, - "securityToken": { - "accessToken": "3a326f7a0dcd343ea58fee21f2fd5fb4c1234567", - "tokenType": "PersonalAccessToken", - }, + "securityToken": {"accessToken": "******", "tokenType": "PersonalAccessToken"}, } }, ) diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/create_source_control_sync_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job/create_source_control_sync_job.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/create_source_control_sync_job.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job/create_source_control_sync_job.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_all_source_control_sync_jobs.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job/get_all_source_control_sync_jobs.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_all_source_control_sync_jobs.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job/get_all_source_control_sync_jobs.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_source_control_sync_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job/get_source_control_sync_job.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_source_control_sync_job.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job/get_source_control_sync_job.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_source_control_sync_job_streams.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job_streams/get_source_control_sync_job_streams.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_source_control_sync_job_streams.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job_streams/get_source_control_sync_job_streams.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/get_source_control_sync_job_streams_by_stream_id.py b/sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job_streams/get_source_control_sync_job_streams_by_stream_id.py similarity index 100% rename from sdk/automation/azure-mgmt-automation/generated_samples/get_source_control_sync_job_streams_by_stream_id.py rename to sdk/automation/azure-mgmt-automation/generated_samples/source_control_sync_job_streams/get_source_control_sync_job_streams_by_stream_id.py diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/start_watcher.py b/sdk/automation/azure-mgmt-automation/generated_samples/start_watcher.py index 7662d25930d7..670dd75ba369 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/start_watcher.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/start_watcher.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.watcher.start( + client.watcher.start( resource_group_name="rg", automation_account_name="MyTestAutomationAccount", watcher_name="MyTestWatcher", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/startWatcher.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/stop_test_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/stop_test_job.py index e70cbf68bc08..152fd88d801e 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/stop_test_job.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/stop_test_job.py @@ -29,12 +29,11 @@ def main(): subscription_id="51766542-3ed7-4a72-a187-0c8ab644ddab", ) - response = client.test_job.stop( + client.test_job.stop( resource_group_name="mygroup", automation_account_name="ContoseAutomationAccount", runbook_name="Get-AzureVMTutorial", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/stopTestJob.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/stop_watcher.py b/sdk/automation/azure-mgmt-automation/generated_samples/stop_watcher.py index f71ada541e02..324365e5fb42 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/stop_watcher.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/stop_watcher.py @@ -29,12 +29,11 @@ def main(): subscription_id="subid", ) - response = client.watcher.stop( + client.watcher.stop( resource_group_name="rg", automation_account_name="MyTestAutomationAccount", watcher_name="MyTestWatcher", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/preview/2020-01-13-preview/examples/stopWatcher.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/suspend_test_job.py b/sdk/automation/azure-mgmt-automation/generated_samples/suspend_test_job.py index e01ba8626e41..a6f95db6cb9c 100644 --- a/sdk/automation/azure-mgmt-automation/generated_samples/suspend_test_job.py +++ b/sdk/automation/azure-mgmt-automation/generated_samples/suspend_test_job.py @@ -29,12 +29,11 @@ def main(): subscription_id="51766542-3ed7-4a72-a187-0c8ab644ddab", ) - response = client.test_job.suspend( + client.test_job.suspend( resource_group_name="mygroup", automation_account_name="ContoseAutomationAccount", runbook_name="Get-AzureVMTutorial", ) - print(response) # x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/suspendTestJob.json diff --git a/sdk/automation/azure-mgmt-automation/generated_samples/update_hybrid_runbook_worker_group.py b/sdk/automation/azure-mgmt-automation/generated_samples/update_hybrid_runbook_worker_group.py new file mode 100644 index 000000000000..ffe6950756d1 --- /dev/null +++ b/sdk/automation/azure-mgmt-automation/generated_samples/update_hybrid_runbook_worker_group.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.automation import AutomationClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-automation +# USAGE + python update_hybrid_runbook_worker_group.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = AutomationClient( + credential=DefaultAzureCredential(), + subscription_id="subid", + ) + + response = client.hybrid_runbook_worker_group.update( + resource_group_name="rg", + automation_account_name="testaccount", + hybrid_runbook_worker_group_name="TestHybridGroup", + hybrid_runbook_worker_group_updation_parameters={ + "properties": {"credential": {"name": "myRunAsCredentialUpdatedName"}} + }, + ) + print(response) + + +# x-ms-original-file: specification/automation/resource-manager/Microsoft.Automation/stable/2022-08-08/examples/updateHybridRunbookWorkerGroup.json +if __name__ == "__main__": + main()