diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json index cc1c882ac2c4..26075b2da5f3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json +++ b/sdk/appcontainers/azure-mgmt-appcontainers/_meta.json @@ -1,11 +1,11 @@ { - "commit": "c3f246bece34c122def67e59945e634490f205fe", + "commit": "04840c6de8807310ad13c720a91d676e2c983c30", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.19.0", + "@autorest/python@6.27.2", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --generate-test=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.27.2 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/app/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py index 4b355a70ac13..70129350215c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._container_apps_api_client import ContainerAppsAPIClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._container_apps_api_client import ContainerAppsAPIClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "ContainerAppsAPIClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py index af2e666061c1..e61c302fbdf2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_configuration.py @@ -14,11 +14,10 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ContainerAppsAPIClient. Note that all parameters used to create this instance are saved as instance @@ -26,15 +25,15 @@ class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance- :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-08-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-08-02-preview") + api_version: str = kwargs.pop("api_version", "2025-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py index c9c41bc93026..11bc589e3aec 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_container_apps_api_client.py @@ -19,13 +19,8 @@ from ._configuration import ContainerAppsAPIClientConfiguration from ._serialization import Deserializer, Serializer from .operations import ( - AppResiliencyOperations, AvailableWorkloadProfilesOperations, BillingMetersOperations, - BuildAuthTokenOperations, - BuildersOperations, - BuildsByBuilderResourceOperations, - BuildsOperations, CertificatesOperations, ConnectedEnvironmentsCertificatesOperations, ConnectedEnvironmentsDaprComponentsOperations, @@ -33,28 +28,16 @@ ConnectedEnvironmentsStoragesOperations, ContainerAppsAPIClientOperationsMixin, ContainerAppsAuthConfigsOperations, - ContainerAppsBuildsByContainerAppOperations, - ContainerAppsBuildsOperations, ContainerAppsDiagnosticsOperations, ContainerAppsOperations, - ContainerAppsPatchesOperations, ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, - ContainerAppsSessionPoolsOperations, ContainerAppsSourceControlsOperations, - DaprComponentResiliencyPoliciesOperations, DaprComponentsOperations, - DaprSubscriptionsOperations, - DotNetComponentsOperations, - FunctionsExtensionOperations, - JavaComponentsOperations, JobsExecutionsOperations, JobsOperations, - LogicAppsOperations, ManagedCertificatesOperations, ManagedEnvironmentDiagnosticsOperations, - ManagedEnvironmentPrivateEndpointConnectionsOperations, - ManagedEnvironmentPrivateLinkResourcesOperations, ManagedEnvironmentUsagesOperations, ManagedEnvironmentsDiagnosticsOperations, ManagedEnvironmentsOperations, @@ -65,19 +48,12 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ContainerAppsAPIClient( - ContainerAppsAPIClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """Functions is an extension resource to revisions and the api listed is used to proxy the call - from Web RP to the function app's host process, this api is not exposed to users and only Web - RP is allowed to invoke functions extension resource. +class ContainerAppsAPIClient(ContainerAppsAPIClientOperationsMixin): # pylint: disable=too-many-instance-attributes + """ContainerAppsAPIClient. - :ivar app_resiliency: AppResiliencyOperations operations - :vartype app_resiliency: azure.mgmt.appcontainers.operations.AppResiliencyOperations :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations :vartype container_apps_auth_configs: azure.mgmt.appcontainers.operations.ContainerAppsAuthConfigsOperations @@ -86,15 +62,6 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.operations.AvailableWorkloadProfilesOperations :ivar billing_meters: BillingMetersOperations operations :vartype billing_meters: azure.mgmt.appcontainers.operations.BillingMetersOperations - :ivar builders: BuildersOperations operations - :vartype builders: azure.mgmt.appcontainers.operations.BuildersOperations - :ivar builds_by_builder_resource: BuildsByBuilderResourceOperations operations - :vartype builds_by_builder_resource: - azure.mgmt.appcontainers.operations.BuildsByBuilderResourceOperations - :ivar builds: BuildsOperations operations - :vartype builds: azure.mgmt.appcontainers.operations.BuildsOperations - :ivar build_auth_token: BuildAuthTokenOperations operations - :vartype build_auth_token: azure.mgmt.appcontainers.operations.BuildAuthTokenOperations :ivar connected_environments: ConnectedEnvironmentsOperations operations :vartype connected_environments: azure.mgmt.appcontainers.operations.ConnectedEnvironmentsOperations @@ -111,16 +78,6 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.operations.ConnectedEnvironmentsStoragesOperations :ivar container_apps: ContainerAppsOperations operations :vartype container_apps: azure.mgmt.appcontainers.operations.ContainerAppsOperations - :ivar container_apps_builds_by_container_app: ContainerAppsBuildsByContainerAppOperations - operations - :vartype container_apps_builds_by_container_app: - azure.mgmt.appcontainers.operations.ContainerAppsBuildsByContainerAppOperations - :ivar container_apps_builds: ContainerAppsBuildsOperations operations - :vartype container_apps_builds: - azure.mgmt.appcontainers.operations.ContainerAppsBuildsOperations - :ivar container_apps_patches: ContainerAppsPatchesOperations operations - :vartype container_apps_patches: - azure.mgmt.appcontainers.operations.ContainerAppsPatchesOperations :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations :vartype container_apps_revisions: azure.mgmt.appcontainers.operations.ContainerAppsRevisionsOperations @@ -138,18 +95,10 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.operations.ManagedEnvironmentsDiagnosticsOperations :ivar jobs: JobsOperations operations :vartype jobs: azure.mgmt.appcontainers.operations.JobsOperations - :ivar dot_net_components: DotNetComponentsOperations operations - :vartype dot_net_components: azure.mgmt.appcontainers.operations.DotNetComponentsOperations - :ivar functions_extension: FunctionsExtensionOperations operations - :vartype functions_extension: azure.mgmt.appcontainers.operations.FunctionsExtensionOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.appcontainers.operations.Operations - :ivar java_components: JavaComponentsOperations operations - :vartype java_components: azure.mgmt.appcontainers.operations.JavaComponentsOperations :ivar jobs_executions: JobsExecutionsOperations operations :vartype jobs_executions: azure.mgmt.appcontainers.operations.JobsExecutionsOperations - :ivar logic_apps: LogicAppsOperations operations - :vartype logic_apps: azure.mgmt.appcontainers.operations.LogicAppsOperations :ivar managed_environments: ManagedEnvironmentsOperations operations :vartype managed_environments: azure.mgmt.appcontainers.operations.ManagedEnvironmentsOperations @@ -160,27 +109,11 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.operations.ManagedCertificatesOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.appcontainers.operations.NamespacesOperations - :ivar managed_environment_private_endpoint_connections: - ManagedEnvironmentPrivateEndpointConnectionsOperations operations - :vartype managed_environment_private_endpoint_connections: - azure.mgmt.appcontainers.operations.ManagedEnvironmentPrivateEndpointConnectionsOperations - :ivar managed_environment_private_link_resources: - ManagedEnvironmentPrivateLinkResourcesOperations operations - :vartype managed_environment_private_link_resources: - azure.mgmt.appcontainers.operations.ManagedEnvironmentPrivateLinkResourcesOperations - :ivar dapr_component_resiliency_policies: DaprComponentResiliencyPoliciesOperations operations - :vartype dapr_component_resiliency_policies: - azure.mgmt.appcontainers.operations.DaprComponentResiliencyPoliciesOperations :ivar dapr_components: DaprComponentsOperations operations :vartype dapr_components: azure.mgmt.appcontainers.operations.DaprComponentsOperations - :ivar dapr_subscriptions: DaprSubscriptionsOperations operations - :vartype dapr_subscriptions: azure.mgmt.appcontainers.operations.DaprSubscriptionsOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: azure.mgmt.appcontainers.operations.ManagedEnvironmentsStoragesOperations - :ivar container_apps_session_pools: ContainerAppsSessionPoolsOperations operations - :vartype container_apps_session_pools: - azure.mgmt.appcontainers.operations.ContainerAppsSessionPoolsOperations :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations :vartype container_apps_source_controls: azure.mgmt.appcontainers.operations.ContainerAppsSourceControlsOperations @@ -191,12 +124,12 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.operations.ManagedEnvironmentUsagesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-08-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -236,7 +169,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.app_resiliency = AppResiliencyOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -244,12 +176,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.billing_meters = BillingMetersOperations(self._client, self._config, self._serialize, self._deserialize) - self.builders = BuildersOperations(self._client, self._config, self._serialize, self._deserialize) - self.builds_by_builder_resource = BuildsByBuilderResourceOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.builds = BuildsOperations(self._client, self._config, self._serialize, self._deserialize) - self.build_auth_token = BuildAuthTokenOperations(self._client, self._config, self._serialize, self._deserialize) self.connected_environments = ConnectedEnvironmentsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -263,15 +189,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) - self.container_apps_builds_by_container_app = ContainerAppsBuildsByContainerAppOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.container_apps_builds = ContainerAppsBuildsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.container_apps_patches = ContainerAppsPatchesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.container_apps_revisions = ContainerAppsRevisionsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -288,16 +205,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dot_net_components = DotNetComponentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.functions_extension = FunctionsExtensionOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.java_components = JavaComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.logic_apps = LogicAppsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments = ManagedEnvironmentsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -306,25 +215,10 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_environment_private_endpoint_connections = ManagedEnvironmentPrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_environment_private_link_resources = ManagedEnvironmentPrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.dapr_component_resiliency_policies = DaprComponentResiliencyPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dapr_subscriptions = DaprSubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.container_apps_session_pools = ContainerAppsSessionPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.container_apps_source_controls = ContainerAppsSourceControlsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py index 8139854b97bb..b24ab2885450 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_serialization.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -24,7 +25,6 @@ # # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -52,7 +52,6 @@ MutableMapping, Type, List, - Mapping, ) try: @@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -155,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -184,15 +190,30 @@ class UTC(datetime.tzinfo): """Time Zone info for handling UTC""" def utcoffset(self, dt): - """UTF offset for UTC is 0.""" + """UTF offset for UTC is 0. + + :param datetime.datetime dt: The datetime + :returns: The offset + :rtype: datetime.timedelta + """ return datetime.timedelta(0) def tzname(self, dt): - """Timestamp representation.""" + """Timestamp representation. + + :param datetime.datetime dt: The datetime + :returns: The timestamp representation + :rtype: str + """ return "Z" def dst(self, dt): - """No daylight saving for UTC.""" + """No daylight saving for UTC. + + :param datetime.datetime dt: The datetime + :returns: The daylight saving time + :rtype: datetime.timedelta + """ return datetime.timedelta(hours=1) @@ -206,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore :param datetime.timedelta offset: offset in timedelta format """ - def __init__(self, offset): + def __init__(self, offset) -> None: self.__offset = offset def utcoffset(self, dt): @@ -235,24 +256,26 @@ def __getinitargs__(self): _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -300,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -326,7 +366,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -346,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -380,12 +426,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -395,7 +444,7 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @@ -408,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @@ -426,9 +476,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +500,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -501,11 +557,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -540,7 +598,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -560,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict :raises: SerializationError if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -592,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -633,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -664,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict :raises: SerializationError if serialization fails. :raises: ValueError if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -703,7 +767,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -712,9 +776,11 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str + :returns: The serialized URL path :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -728,21 +794,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object 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, list :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -759,19 +824,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +846,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None :raises: AttributeError if required data is None. :raises: ValueError if data is None :raises: SerializationError if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -805,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -821,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -841,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -871,8 +938,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -882,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -945,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -971,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -979,6 +1042,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1003,7 +1067,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1034,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1091,11 +1160,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1105,30 +1175,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: TypeError if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1141,12 +1213,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: SerializationError if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1245,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int :raises: SerializationError if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,11 +1260,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1211,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1232,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1279,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1331,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1354,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1363,9 +1450,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1403,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None): :param str content_type: Swagger "produces" if available. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree @@ -1416,12 +1504,13 @@ def _deserialize(self, target_obj, data): :param object data: Object to deserialize. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1440,13 +1529,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1476,9 +1565,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1505,6 +1593,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1516,7 +1606,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1531,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1552,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1579,24 +1673,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1605,15 +1710,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1733,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1647,14 +1757,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1671,6 +1781,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1681,11 +1792,12 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict :raises: TypeError if non-builtin datatype encountered. """ @@ -1720,11 +1832,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1732,6 +1843,7 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool :raises: TypeError if string format is not valid. """ @@ -1743,24 +1855,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1768,6 +1879,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1781,8 +1893,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1794,6 +1905,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1804,9 +1916,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1822,6 +1934,7 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1834,6 +1947,7 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1849,8 +1963,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal + :return: Deserialized decimal :raises: DeserializationError if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,6 +1980,7 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int :raises: ValueError if string format invalid. """ @@ -1877,6 +1993,7 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta :raises: DeserializationError if string format invalid. """ @@ -1887,14 +2004,14 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date :raises: DeserializationError if string format invalid. """ @@ -1910,6 +2027,7 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time :raises: DeserializationError if string format invalid. """ @@ -1924,6 +2042,7 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1939,14 +2058,14 @@ def deserialize_rfc(attr): except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1976,8 +2095,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1985,6 +2103,7 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime :raises: DeserializationError if format invalid """ @@ -1996,5 +2115,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py index 869b8cac8a5e..9835aee9cecc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_vendor.py @@ -11,7 +11,6 @@ from ._configuration import ContainerAppsAPIClientConfiguration if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core import PipelineClient from ._serialization import Deserializer, Serializer diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py index e46fe87dc038..e5754a47ce68 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.2.0b1" +VERSION = "1.0.0b1" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py index 50b245b83bea..a56355c91250 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._container_apps_api_client import ContainerAppsAPIClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._container_apps_api_client import ContainerAppsAPIClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "ContainerAppsAPIClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py index 8cae65231135..6d22c9c3efd3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_configuration.py @@ -14,11 +14,10 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance-attributes """Configuration for ContainerAppsAPIClient. Note that all parameters used to create this instance are saved as instance @@ -26,15 +25,15 @@ class ContainerAppsAPIClientConfiguration: # pylint: disable=too-many-instance- :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-08-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-08-02-preview") + api_version: str = kwargs.pop("api_version", "2025-01-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py index 3bec301c96c4..1519a7190f4a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_container_apps_api_client.py @@ -19,13 +19,8 @@ from .._serialization import Deserializer, Serializer from ._configuration import ContainerAppsAPIClientConfiguration from .operations import ( - AppResiliencyOperations, AvailableWorkloadProfilesOperations, BillingMetersOperations, - BuildAuthTokenOperations, - BuildersOperations, - BuildsByBuilderResourceOperations, - BuildsOperations, CertificatesOperations, ConnectedEnvironmentsCertificatesOperations, ConnectedEnvironmentsDaprComponentsOperations, @@ -33,28 +28,16 @@ ConnectedEnvironmentsStoragesOperations, ContainerAppsAPIClientOperationsMixin, ContainerAppsAuthConfigsOperations, - ContainerAppsBuildsByContainerAppOperations, - ContainerAppsBuildsOperations, ContainerAppsDiagnosticsOperations, ContainerAppsOperations, - ContainerAppsPatchesOperations, ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, - ContainerAppsSessionPoolsOperations, ContainerAppsSourceControlsOperations, - DaprComponentResiliencyPoliciesOperations, DaprComponentsOperations, - DaprSubscriptionsOperations, - DotNetComponentsOperations, - FunctionsExtensionOperations, - JavaComponentsOperations, JobsExecutionsOperations, JobsOperations, - LogicAppsOperations, ManagedCertificatesOperations, ManagedEnvironmentDiagnosticsOperations, - ManagedEnvironmentPrivateEndpointConnectionsOperations, - ManagedEnvironmentPrivateLinkResourcesOperations, ManagedEnvironmentUsagesOperations, ManagedEnvironmentsDiagnosticsOperations, ManagedEnvironmentsOperations, @@ -65,19 +48,12 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ContainerAppsAPIClient( - ContainerAppsAPIClientOperationsMixin -): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes - """Functions is an extension resource to revisions and the api listed is used to proxy the call - from Web RP to the function app's host process, this api is not exposed to users and only Web - RP is allowed to invoke functions extension resource. +class ContainerAppsAPIClient(ContainerAppsAPIClientOperationsMixin): # pylint: disable=too-many-instance-attributes + """ContainerAppsAPIClient. - :ivar app_resiliency: AppResiliencyOperations operations - :vartype app_resiliency: azure.mgmt.appcontainers.aio.operations.AppResiliencyOperations :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations :vartype container_apps_auth_configs: azure.mgmt.appcontainers.aio.operations.ContainerAppsAuthConfigsOperations @@ -86,15 +62,6 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.aio.operations.AvailableWorkloadProfilesOperations :ivar billing_meters: BillingMetersOperations operations :vartype billing_meters: azure.mgmt.appcontainers.aio.operations.BillingMetersOperations - :ivar builders: BuildersOperations operations - :vartype builders: azure.mgmt.appcontainers.aio.operations.BuildersOperations - :ivar builds_by_builder_resource: BuildsByBuilderResourceOperations operations - :vartype builds_by_builder_resource: - azure.mgmt.appcontainers.aio.operations.BuildsByBuilderResourceOperations - :ivar builds: BuildsOperations operations - :vartype builds: azure.mgmt.appcontainers.aio.operations.BuildsOperations - :ivar build_auth_token: BuildAuthTokenOperations operations - :vartype build_auth_token: azure.mgmt.appcontainers.aio.operations.BuildAuthTokenOperations :ivar connected_environments: ConnectedEnvironmentsOperations operations :vartype connected_environments: azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsOperations @@ -111,16 +78,6 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsStoragesOperations :ivar container_apps: ContainerAppsOperations operations :vartype container_apps: azure.mgmt.appcontainers.aio.operations.ContainerAppsOperations - :ivar container_apps_builds_by_container_app: ContainerAppsBuildsByContainerAppOperations - operations - :vartype container_apps_builds_by_container_app: - azure.mgmt.appcontainers.aio.operations.ContainerAppsBuildsByContainerAppOperations - :ivar container_apps_builds: ContainerAppsBuildsOperations operations - :vartype container_apps_builds: - azure.mgmt.appcontainers.aio.operations.ContainerAppsBuildsOperations - :ivar container_apps_patches: ContainerAppsPatchesOperations operations - :vartype container_apps_patches: - azure.mgmt.appcontainers.aio.operations.ContainerAppsPatchesOperations :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations :vartype container_apps_revisions: azure.mgmt.appcontainers.aio.operations.ContainerAppsRevisionsOperations @@ -138,19 +95,10 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsDiagnosticsOperations :ivar jobs: JobsOperations operations :vartype jobs: azure.mgmt.appcontainers.aio.operations.JobsOperations - :ivar dot_net_components: DotNetComponentsOperations operations - :vartype dot_net_components: azure.mgmt.appcontainers.aio.operations.DotNetComponentsOperations - :ivar functions_extension: FunctionsExtensionOperations operations - :vartype functions_extension: - azure.mgmt.appcontainers.aio.operations.FunctionsExtensionOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.appcontainers.aio.operations.Operations - :ivar java_components: JavaComponentsOperations operations - :vartype java_components: azure.mgmt.appcontainers.aio.operations.JavaComponentsOperations :ivar jobs_executions: JobsExecutionsOperations operations :vartype jobs_executions: azure.mgmt.appcontainers.aio.operations.JobsExecutionsOperations - :ivar logic_apps: LogicAppsOperations operations - :vartype logic_apps: azure.mgmt.appcontainers.aio.operations.LogicAppsOperations :ivar managed_environments: ManagedEnvironmentsOperations operations :vartype managed_environments: azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsOperations @@ -161,28 +109,11 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.aio.operations.ManagedCertificatesOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.appcontainers.aio.operations.NamespacesOperations - :ivar managed_environment_private_endpoint_connections: - ManagedEnvironmentPrivateEndpointConnectionsOperations operations - :vartype managed_environment_private_endpoint_connections: - azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentPrivateEndpointConnectionsOperations - :ivar managed_environment_private_link_resources: - ManagedEnvironmentPrivateLinkResourcesOperations operations - :vartype managed_environment_private_link_resources: - azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentPrivateLinkResourcesOperations - :ivar dapr_component_resiliency_policies: DaprComponentResiliencyPoliciesOperations operations - :vartype dapr_component_resiliency_policies: - azure.mgmt.appcontainers.aio.operations.DaprComponentResiliencyPoliciesOperations :ivar dapr_components: DaprComponentsOperations operations :vartype dapr_components: azure.mgmt.appcontainers.aio.operations.DaprComponentsOperations - :ivar dapr_subscriptions: DaprSubscriptionsOperations operations - :vartype dapr_subscriptions: - azure.mgmt.appcontainers.aio.operations.DaprSubscriptionsOperations :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations :vartype managed_environments_storages: azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsStoragesOperations - :ivar container_apps_session_pools: ContainerAppsSessionPoolsOperations operations - :vartype container_apps_session_pools: - azure.mgmt.appcontainers.aio.operations.ContainerAppsSessionPoolsOperations :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations :vartype container_apps_source_controls: azure.mgmt.appcontainers.aio.operations.ContainerAppsSourceControlsOperations @@ -193,12 +124,12 @@ class ContainerAppsAPIClient( azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentUsagesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-08-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -238,7 +169,6 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.app_resiliency = AppResiliencyOperations(self._client, self._config, self._serialize, self._deserialize) self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -246,12 +176,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.billing_meters = BillingMetersOperations(self._client, self._config, self._serialize, self._deserialize) - self.builders = BuildersOperations(self._client, self._config, self._serialize, self._deserialize) - self.builds_by_builder_resource = BuildsByBuilderResourceOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.builds = BuildsOperations(self._client, self._config, self._serialize, self._deserialize) - self.build_auth_token = BuildAuthTokenOperations(self._client, self._config, self._serialize, self._deserialize) self.connected_environments = ConnectedEnvironmentsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -265,15 +189,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) - self.container_apps_builds_by_container_app = ContainerAppsBuildsByContainerAppOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.container_apps_builds = ContainerAppsBuildsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.container_apps_patches = ContainerAppsPatchesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.container_apps_revisions = ContainerAppsRevisionsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -290,16 +205,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dot_net_components = DotNetComponentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.functions_extension = FunctionsExtensionOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.java_components = JavaComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.logic_apps = LogicAppsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_environments = ManagedEnvironmentsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -308,25 +215,10 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_environment_private_endpoint_connections = ManagedEnvironmentPrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_environment_private_link_resources = ManagedEnvironmentPrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.dapr_component_resiliency_policies = DaprComponentResiliencyPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.dapr_subscriptions = DaprSubscriptionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.managed_environments_storages = ManagedEnvironmentsStoragesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.container_apps_session_pools = ContainerAppsSessionPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.container_apps_source_controls = ContainerAppsSourceControlsOperations( self._client, self._config, self._serialize, self._deserialize ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py index 4345e924ce42..e77fe7aa38a5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/_vendor.py @@ -11,7 +11,6 @@ from ._configuration import ContainerAppsAPIClientConfiguration if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core import AsyncPipelineClient from .._serialization import Deserializer, Serializer diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py index f105aaf0a686..c032b65d93a9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/__init__.py @@ -5,101 +5,71 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._app_resiliency_operations import AppResiliencyOperations -from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations -from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations -from ._billing_meters_operations import BillingMetersOperations -from ._builders_operations import BuildersOperations -from ._builds_by_builder_resource_operations import BuildsByBuilderResourceOperations -from ._builds_operations import BuildsOperations -from ._build_auth_token_operations import BuildAuthTokenOperations -from ._connected_environments_operations import ConnectedEnvironmentsOperations -from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations -from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations -from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations -from ._container_apps_operations import ContainerAppsOperations -from ._container_apps_builds_by_container_app_operations import ContainerAppsBuildsByContainerAppOperations -from ._container_apps_builds_operations import ContainerAppsBuildsOperations -from ._container_apps_patches_operations import ContainerAppsPatchesOperations -from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations -from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations -from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations -from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations -from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations -from ._jobs_operations import JobsOperations -from ._dot_net_components_operations import DotNetComponentsOperations -from ._functions_extension_operations import FunctionsExtensionOperations -from ._operations import Operations -from ._java_components_operations import JavaComponentsOperations -from ._jobs_executions_operations import JobsExecutionsOperations -from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin -from ._logic_apps_operations import LogicAppsOperations -from ._managed_environments_operations import ManagedEnvironmentsOperations -from ._certificates_operations import CertificatesOperations -from ._managed_certificates_operations import ManagedCertificatesOperations -from ._namespaces_operations import NamespacesOperations -from ._managed_environment_private_endpoint_connections_operations import ( - ManagedEnvironmentPrivateEndpointConnectionsOperations, -) -from ._managed_environment_private_link_resources_operations import ManagedEnvironmentPrivateLinkResourcesOperations -from ._dapr_component_resiliency_policies_operations import DaprComponentResiliencyPoliciesOperations -from ._dapr_components_operations import DaprComponentsOperations -from ._dapr_subscriptions_operations import DaprSubscriptionsOperations -from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations -from ._container_apps_session_pools_operations import ContainerAppsSessionPoolsOperations -from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations -from ._usages_operations import UsagesOperations -from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations # type: ignore +from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations # type: ignore +from ._billing_meters_operations import BillingMetersOperations # type: ignore +from ._connected_environments_operations import ConnectedEnvironmentsOperations # type: ignore +from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations # type: ignore +from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations # type: ignore +from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations # type: ignore +from ._container_apps_operations import ContainerAppsOperations # type: ignore +from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations # type: ignore +from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations # type: ignore +from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations # type: ignore +from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations # type: ignore +from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations # type: ignore +from ._jobs_operations import JobsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._jobs_executions_operations import JobsExecutionsOperations # type: ignore +from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin # type: ignore +from ._managed_environments_operations import ManagedEnvironmentsOperations # type: ignore +from ._certificates_operations import CertificatesOperations # type: ignore +from ._managed_certificates_operations import ManagedCertificatesOperations # type: ignore +from ._namespaces_operations import NamespacesOperations # type: ignore +from ._dapr_components_operations import DaprComponentsOperations # type: ignore +from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations # type: ignore +from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "AppResiliencyOperations", "ContainerAppsAuthConfigsOperations", "AvailableWorkloadProfilesOperations", "BillingMetersOperations", - "BuildersOperations", - "BuildsByBuilderResourceOperations", - "BuildsOperations", - "BuildAuthTokenOperations", "ConnectedEnvironmentsOperations", "ConnectedEnvironmentsCertificatesOperations", "ConnectedEnvironmentsDaprComponentsOperations", "ConnectedEnvironmentsStoragesOperations", "ContainerAppsOperations", - "ContainerAppsBuildsByContainerAppOperations", - "ContainerAppsBuildsOperations", - "ContainerAppsPatchesOperations", "ContainerAppsRevisionsOperations", "ContainerAppsRevisionReplicasOperations", "ContainerAppsDiagnosticsOperations", "ManagedEnvironmentDiagnosticsOperations", "ManagedEnvironmentsDiagnosticsOperations", "JobsOperations", - "DotNetComponentsOperations", - "FunctionsExtensionOperations", "Operations", - "JavaComponentsOperations", "JobsExecutionsOperations", "ContainerAppsAPIClientOperationsMixin", - "LogicAppsOperations", "ManagedEnvironmentsOperations", "CertificatesOperations", "ManagedCertificatesOperations", "NamespacesOperations", - "ManagedEnvironmentPrivateEndpointConnectionsOperations", - "ManagedEnvironmentPrivateLinkResourcesOperations", - "DaprComponentResiliencyPoliciesOperations", "DaprComponentsOperations", - "DaprSubscriptionsOperations", "ManagedEnvironmentsStoragesOperations", - "ContainerAppsSessionPoolsOperations", "ContainerAppsSourceControlsOperations", "UsagesOperations", "ManagedEnvironmentUsagesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_app_resiliency_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_app_resiliency_operations.py deleted file mode 100644 index 4ca3515c3463..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_app_resiliency_operations.py +++ /dev/null @@ -1,562 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._app_resiliency_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class AppResiliencyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`app_resiliency` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: _models.AppResiliency, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Required. - :type resiliency_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: Union[_models.AppResiliency, IO[bytes]], - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Is either a - AppResiliency type or a IO[bytes] type. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency or IO[bytes] - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resiliency_envelope, (IOBase, bytes)): - _content = resiliency_envelope - else: - _json = self._serialize.body(resiliency_envelope, "AppResiliency") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: _models.AppResiliency, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Required. - :type resiliency_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: Union[_models.AppResiliency, IO[bytes]], - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Is either a AppResiliency type or - a IO[bytes] type. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency or IO[bytes] - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resiliency_envelope, (IOBase, bytes)): - _content = resiliency_envelope - else: - _json = self._serialize.body(resiliency_envelope, "AppResiliency") - - _request = build_update_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, app_name: str, name: str, **kwargs: Any - ) -> None: - """Delete an application's resiliency policy. - - Delete container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get(self, resource_group_name: str, app_name: str, name: str, **kwargs: Any) -> _models.AppResiliency: - """Get an application's resiliency policy. - - Get container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, app_name: str, **kwargs: Any) -> AsyncIterable["_models.AppResiliency"]: - """List an application's resiliency policies. - - List container app resiliency policies. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :return: An iterator like instance of either AppResiliency or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.AppResiliency] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AppResiliencyCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - app_name=app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AppResiliencyCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py index 007b7f9e95dc..6158881a4b84 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_available_workload_profiles_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -75,7 +74,7 @@ def get(self, location: str, **kwargs: Any) -> AsyncIterable["_models.AvailableW api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AvailableWorkloadProfilesCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py index 11596186fb1a..9b68807a08ee 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_billing_meters_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,7 +64,7 @@ async def get(self, location: str, **kwargs: Any) -> _models.BillingMeterCollect :rtype: ~azure.mgmt.appcontainers.models.BillingMeterCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_build_auth_token_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_build_auth_token_operations.py deleted file mode 100644 index a875471941c0..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_build_auth_token_operations.py +++ /dev/null @@ -1,115 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._build_auth_token_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BuildAuthTokenOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`build_auth_token` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> _models.BuildToken: - """Gets the token used to connect to the endpoint where source code can be uploaded for a build. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: BuildToken or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuildToken - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildToken] = kwargs.pop("cls", None) - - _request = build_list_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("BuildToken", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builders_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builders_operations.py deleted file mode 100644 index 5d01584d4431..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builders_operations.py +++ /dev/null @@ -1,792 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, 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 ...operations._builders_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BuildersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`builders` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.BuilderResource"]: - """List BuilderResource resources by subscription ID. - - :return: An iterator like instance of either BuilderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BuilderCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BuilderResource"]: - """List BuilderResource resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either BuilderResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BuilderCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> _models.BuilderResource: - """Get a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: BuilderResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuilderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("BuilderResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(builder_envelope, (IOBase, bytes)): - _content = builder_envelope - else: - _json = self._serialize.body(builder_envelope, "BuilderResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: _models.BuilderResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Required. - :type builder_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Is either a BuilderResource type or a - IO[bytes] type. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = 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, - builder_name=builder_name, - builder_envelope=builder_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuilderResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BuilderResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BuilderResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(builder_envelope, (IOBase, bytes)): - _content = builder_envelope - else: - _json = self._serialize.body(builder_envelope, "BuilderResourceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: _models.BuilderResourceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResourceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Required. - :type builder_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Is either a - BuilderResourceUpdate type or a IO[bytes] type. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResourceUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = 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._update_initial( - resource_group_name=resource_group_name, - builder_name=builder_name, - builder_envelope=builder_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuilderResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - 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[_models.BuilderResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BuilderResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - builder_name=builder_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_by_builder_resource_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_by_builder_resource_operations.py deleted file mode 100644 index 56a53acdbbfb..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_by_builder_resource_operations.py +++ /dev/null @@ -1,140 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._builds_by_builder_resource_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BuildsByBuilderResourceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`builds_by_builder_resource` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, builder_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BuildResource"]: - """List BuildResource resources by BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: An iterator like instance of either BuildResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BuildCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_operations.py deleted file mode 100644 index 72103545763f..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_builds_operations.py +++ /dev/null @@ -1,450 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._builds_operations import build_create_or_update_request, build_delete_request, build_get_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class BuildsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`builds` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> _models.BuildResource: - """Get a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: BuildResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuildResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("BuildResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: Union[_models.BuildResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(build_envelope, (IOBase, bytes)): - _content = build_envelope - else: - _json = self._serialize.body(build_envelope, "BuildResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: _models.BuildResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Required. - :type build_envelope: ~azure.mgmt.appcontainers.models.BuildResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Required. - :type build_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: Union[_models.BuildResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Is either a BuildResource type or - a IO[bytes] type. Required. - :type build_envelope: ~azure.mgmt.appcontainers.models.BuildResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuildResource] = 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, - builder_name=builder_name, - build_name=build_name, - build_envelope=build_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuildResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.BuildResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BuildResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py index bada5159b51f..e70e891c4fe2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,7 +38,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +85,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +302,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +362,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, environment_name: str, certificate_name: str, **kwargs: Any ) -> None: """Deletes the specified Certificate. @@ -381,7 +380,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +511,7 @@ async def update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py index 963c94331810..dcc1bffde0aa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,7 +38,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +85,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +302,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +362,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, connected_environment_name: str, certificate_name: str, **kwargs: Any ) -> None: """Deletes the specified Certificate. @@ -381,7 +380,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +511,7 @@ async def update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py index d892729a6bac..2354bc86bc30 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_dapr_components_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,7 +38,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +85,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DaprComponentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +302,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,7 +359,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, connected_environment_name: str, component_name: str, **kwargs: Any ) -> None: """Delete a Dapr Component. @@ -378,7 +377,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -437,7 +436,7 @@ async def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.DaprSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py index 921acd30a914..edce9388db12 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -45,7 +44,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +86,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Connecte api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConnectedEnvironmentCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +168,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConnectedEnvironmentCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,7 +245,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -296,7 +295,7 @@ async def _create_or_update_initial( environment_envelope: Union[_models.ConnectedEnvironment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -491,7 +490,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, connected_environment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -619,7 +618,7 @@ async def update( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -748,7 +747,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.appcontainers.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py index 00be8a0cd8f8..c12784f78263 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_connected_environments_storages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,7 +34,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +75,7 @@ async def list( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStoragesCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +137,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +273,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -331,7 +330,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, connected_environment_name: str, storage_name: str, **kwargs: Any ) -> None: """Delete storage for a connectedEnvironment. @@ -349,7 +348,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py index 20b35af8390f..fa7cd87c6973 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_api_client_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -33,7 +32,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -59,7 +58,7 @@ async def job_execution( :rtype: ~azure.mgmt.appcontainers.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +110,7 @@ async def get_custom_domain_verification_id(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py index 5f7d8adfd62e..f05220d72ad5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_auth_configs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,7 +37,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -85,7 +84,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AuthConfigCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -167,7 +166,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.AuthConfig :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +301,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.AuthConfig :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -359,7 +358,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, container_app_name: str, auth_config_name: str, **kwargs: Any ) -> None: """Delete a Container App AuthConfig. @@ -377,7 +376,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_by_container_app_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_by_container_app_operations.py deleted file mode 100644 index 4a1965d111b0..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_by_container_app_operations.py +++ /dev/null @@ -1,142 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._container_apps_builds_by_container_app_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ContainerAppsBuildsByContainerAppOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`container_apps_builds_by_container_app` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, container_app_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ContainerAppsBuildResource"]: - """List Container Apps Build resources by Container App. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Build is associated. Required. - :type container_app_name: str - :return: An iterator like instance of either ContainerAppsBuildResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.ContainerAppsBuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ContainerAppsBuildCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ContainerAppsBuildCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_operations.py deleted file mode 100644 index c2caea4ecb4e..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_builds_operations.py +++ /dev/null @@ -1,235 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._container_apps_builds_operations import build_delete_request, build_get_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ContainerAppsBuildsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`container_apps_builds` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, container_app_name: str, build_name: str, **kwargs: Any - ) -> _models.ContainerAppsBuildResource: - """Get a Container Apps Build resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Build is associated. Required. - :type container_app_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: ContainerAppsBuildResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ContainerAppsBuildResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ContainerAppsBuildResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("ContainerAppsBuildResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, container_app_name: str, build_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, container_app_name: str, build_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a Container Apps Build resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Build is associated. Required. - :type container_app_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - build_name=build_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py index 22cf063d8766..19d52da603ad 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar, cast +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,7 +37,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +85,7 @@ def list_detectors( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DiagnosticsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +167,7 @@ async def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -237,7 +236,7 @@ def list_revisions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RevisionCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +319,7 @@ async def get_revision( :rtype: ~azure.mgmt.appcontainers.models.Revision :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -379,14 +378,11 @@ async def get_root(self, resource_group_name: str, container_app_name: str, **kw :rtype: ~azure.mgmt.appcontainers.models.ContainerApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -414,7 +410,7 @@ async def get_root(self, resource_group_name: str, container_app_name: str, **kw response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py index 7b5d63dcf798..2e0e7384646e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -49,7 +49,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +89,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Containe api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +169,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -246,14 +246,11 @@ async def get(self, resource_group_name: str, container_app_name: str, **kwargs: :rtype: ~azure.mgmt.appcontainers.models.ContainerApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -281,7 +278,7 @@ async def get(self, resource_group_name: str, container_app_name: str, **kwargs: response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -299,7 +296,7 @@ async def _create_or_update_initial( container_app_envelope: Union[_models.ContainerApp, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -497,7 +494,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, container_app_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -615,7 +612,7 @@ async def _update_initial( container_app_envelope: Union[_models.ContainerApp, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -830,7 +827,7 @@ async def list_custom_host_name_analysis( :rtype: ~azure.mgmt.appcontainers.models.CustomHostnameAnalysisResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -891,7 +888,7 @@ async def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.SecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -951,14 +948,11 @@ async def get_auth_token( :rtype: ~azure.mgmt.appcontainers.models.ContainerAppAuthToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -986,7 +980,7 @@ async def get_auth_token( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -1000,7 +994,7 @@ async def get_auth_token( async def _start_initial( self, resource_group_name: str, container_app_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1119,7 +1113,7 @@ def get_long_running_output(pipeline_response): async def _stop_initial( self, resource_group_name: str, container_app_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_patches_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_patches_operations.py deleted file mode 100644 index 7860b774654c..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_patches_operations.py +++ /dev/null @@ -1,664 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, 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 ...operations._container_apps_patches_operations import ( - build_apply_request, - build_delete_request, - build_get_request, - build_list_by_container_app_request, - build_skip_configure_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ContainerAppsPatchesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`container_apps_patches` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_container_app( - self, resource_group_name: str, container_app_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncIterable["_models.ContainerAppsPatchResource"]: - """List Container Apps Patch resources by ContainerApp. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param filter: The filter to apply on the operation. For example, - $filter=properties/patchApplyStatus eq 'Succeeded'. Default value is None. - :type filter: str - :return: An iterator like instance of either ContainerAppsPatchResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.ContainerAppsPatchResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PatchCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_container_app_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PatchCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> _models.ContainerAppsPatchResource: - """Get details for specific Container Apps Patch by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :return: ContainerAppsPatchResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ContainerAppsPatchResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ContainerAppsPatchResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("ContainerAppsPatchResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete specific Container Apps Patch by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _skip_configure_initial( - self, - resource_group_name: str, - container_app_name: str, - patch_name: str, - patch_skip_config: Union[_models.PatchSkipConfig, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(patch_skip_config, (IOBase, bytes)): - _content = patch_skip_config - else: - _json = self._serialize.body(patch_skip_config, "PatchSkipConfig") - - _request = build_skip_configure_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_skip_configure( - self, - resource_group_name: str, - container_app_name: str, - patch_name: str, - patch_skip_config: _models.PatchSkipConfig, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Configure the Container Apps Patch skip option by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :param patch_skip_config: Configure patcher to skip a patch or not. Required. - :type patch_skip_config: ~azure.mgmt.appcontainers.models.PatchSkipConfig - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_skip_configure( - self, - resource_group_name: str, - container_app_name: str, - patch_name: str, - patch_skip_config: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Configure the Container Apps Patch skip option by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :param patch_skip_config: Configure patcher to skip a patch or not. Required. - :type patch_skip_config: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_skip_configure( - self, - resource_group_name: str, - container_app_name: str, - patch_name: str, - patch_skip_config: Union[_models.PatchSkipConfig, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Configure the Container Apps Patch skip option by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :param patch_skip_config: Configure patcher to skip a patch or not. Is either a PatchSkipConfig - type or a IO[bytes] type. Required. - :type patch_skip_config: ~azure.mgmt.appcontainers.models.PatchSkipConfig or IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - 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._skip_configure_initial( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - patch_skip_config=patch_skip_config, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _apply_initial( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_apply_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_apply( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ContainerAppsPatchResource]: - """Apply a Container Apps Patch resource with patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :return: An instance of AsyncLROPoller that returns either ContainerAppsPatchResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.ContainerAppsPatchResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ContainerAppsPatchResource] = 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._apply_initial( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ContainerAppsPatchResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ContainerAppsPatchResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ContainerAppsPatchResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py index 3b22ff21655a..f125dc0bd967 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revision_replicas_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,7 +76,7 @@ async def get_replica( :rtype: ~azure.mgmt.appcontainers.models.Replica :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -141,7 +140,7 @@ async def list_replicas( :rtype: ~azure.mgmt.appcontainers.models.ReplicaCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py index 40a69d7b2126..94d47e0249fd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_revisions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,7 +37,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +86,7 @@ def list_revisions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RevisionCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +169,7 @@ async def get_revision( :rtype: ~azure.mgmt.appcontainers.models.Revision :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +214,7 @@ async def get_revision( return deserialized # type: ignore @distributed_trace_async - async def activate_revision( # pylint: disable=inconsistent-return-statements + async def activate_revision( self, resource_group_name: str, container_app_name: str, revision_name: str, **kwargs: Any ) -> None: """Activates a revision for a Container App. @@ -233,7 +232,7 @@ async def activate_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +273,7 @@ async def activate_revision( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def deactivate_revision( # pylint: disable=inconsistent-return-statements + async def deactivate_revision( self, resource_group_name: str, container_app_name: str, revision_name: str, **kwargs: Any ) -> None: """Deactivates a revision for a Container App. @@ -292,7 +291,7 @@ async def deactivate_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -333,7 +332,7 @@ async def deactivate_revision( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def restart_revision( # pylint: disable=inconsistent-return-statements + async def restart_revision( self, resource_group_name: str, container_app_name: str, revision_name: str, **kwargs: Any ) -> None: """Restarts a revision for a Container App. @@ -351,7 +350,7 @@ async def restart_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_session_pools_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_session_pools_operations.py deleted file mode 100644 index a5a3cec4ed59..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_session_pools_operations.py +++ /dev/null @@ -1,808 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, 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 ...operations._container_apps_session_pools_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_by_subscription_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ContainerAppsSessionPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`container_apps_session_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SessionPool"]: - """Get the session pools in a given subscription. - - Get the session pools in a given subscription. - - :return: An iterator like instance of either SessionPool or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SessionPoolCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SessionPoolCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.SessionPool"]: - """Get the session pools in a given resource group of a subscription. - - Get the session pools in a given resource group of a subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either SessionPool or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SessionPoolCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SessionPoolCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, session_pool_name: str, **kwargs: Any) -> _models.SessionPool: - """Get the properties of a session pool. - - Get the properties of a session pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :return: SessionPool or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.SessionPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SessionPool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("SessionPool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: Union[_models.SessionPool, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(session_pool_envelope, (IOBase, bytes)): - _content = session_pool_envelope - else: - _json = self._serialize.body(session_pool_envelope, "SessionPool") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: _models.SessionPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SessionPool]: - """Create or update a session pool. - - Create or update a session pool with the given properties. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Required. - :type session_pool_envelope: ~azure.mgmt.appcontainers.models.SessionPool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SessionPool]: - """Create or update a session pool. - - Create or update a session pool with the given properties. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Required. - :type session_pool_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: Union[_models.SessionPool, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SessionPool]: - """Create or update a session pool. - - Create or update a session pool with the given properties. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Is either a SessionPool - type or a IO[bytes] type. Required. - :type session_pool_envelope: ~azure.mgmt.appcontainers.models.SessionPool or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SessionPool] = 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, - session_pool_name=session_pool_name, - session_pool_envelope=session_pool_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SessionPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.SessionPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SessionPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: Union[_models.SessionPoolUpdatableProperties, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(session_pool_envelope, (IOBase, bytes)): - _content = session_pool_envelope - else: - _json = self._serialize.body(session_pool_envelope, "SessionPoolUpdatableProperties") - - _request = build_update_request( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: _models.SessionPoolUpdatableProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SessionPool]: - """Update properties of a session pool. - - Patches a session pool using JSON merge patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Required. - :type session_pool_envelope: ~azure.mgmt.appcontainers.models.SessionPoolUpdatableProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SessionPool]: - """Update properties of a session pool. - - Patches a session pool using JSON merge patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Required. - :type session_pool_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: Union[_models.SessionPoolUpdatableProperties, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SessionPool]: - """Update properties of a session pool. - - Patches a session pool using JSON merge patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Is either a - SessionPoolUpdatableProperties type or a IO[bytes] type. Required. - :type session_pool_envelope: ~azure.mgmt.appcontainers.models.SessionPoolUpdatableProperties or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SessionPool] = 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._update_initial( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - session_pool_envelope=session_pool_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SessionPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.SessionPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SessionPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, session_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, session_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a session pool. - - Delete the session pool with the given name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py index 8b1407ce04f5..4c3ace040618 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_container_apps_source_controls_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,7 +41,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -89,7 +88,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SourceControlCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -171,7 +170,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.SourceControl :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -221,10 +220,9 @@ async def _create_or_update_initial( container_app_name: str, source_control_name: str, source_control_envelope: Union[_models.SourceControl, IO[bytes]], - x_ms_github_auxiliary: Optional[str] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -252,7 +250,6 @@ async def _create_or_update_initial( container_app_name=container_app_name, source_control_name=source_control_name, subscription_id=self._config.subscription_id, - x_ms_github_auxiliary=x_ms_github_auxiliary, api_version=api_version, content_type=content_type, json=_json, @@ -293,7 +290,6 @@ async def begin_create_or_update( container_app_name: str, source_control_name: str, source_control_envelope: _models.SourceControl, - x_ms_github_auxiliary: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any @@ -312,9 +308,6 @@ async def begin_create_or_update( :param source_control_envelope: Properties used to create a Container App SourceControl. Required. :type source_control_envelope: ~azure.mgmt.appcontainers.models.SourceControl - :param x_ms_github_auxiliary: Github personal access token used for SourceControl. Default - value is None. - :type x_ms_github_auxiliary: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -331,7 +324,6 @@ async def begin_create_or_update( container_app_name: str, source_control_name: str, source_control_envelope: IO[bytes], - x_ms_github_auxiliary: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any @@ -350,9 +342,6 @@ async def begin_create_or_update( :param source_control_envelope: Properties used to create a Container App SourceControl. Required. :type source_control_envelope: IO[bytes] - :param x_ms_github_auxiliary: Github personal access token used for SourceControl. Default - value is None. - :type x_ms_github_auxiliary: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -369,7 +358,6 @@ async def begin_create_or_update( container_app_name: str, source_control_name: str, source_control_envelope: Union[_models.SourceControl, IO[bytes]], - x_ms_github_auxiliary: Optional[str] = None, **kwargs: Any ) -> AsyncLROPoller[_models.SourceControl]: """Create or update the SourceControl for a Container App. @@ -386,9 +374,6 @@ async def begin_create_or_update( :param source_control_envelope: Properties used to create a Container App SourceControl. Is either a SourceControl type or a IO[bytes] type. Required. :type source_control_envelope: ~azure.mgmt.appcontainers.models.SourceControl or IO[bytes] - :param x_ms_github_auxiliary: Github personal access token used for SourceControl. Default - value is None. - :type x_ms_github_auxiliary: str :return: An instance of AsyncLROPoller that returns either SourceControl or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.SourceControl] @@ -409,7 +394,6 @@ async def begin_create_or_update( container_app_name=container_app_name, source_control_name=source_control_name, source_control_envelope=source_control_envelope, - x_ms_github_auxiliary=x_ms_github_auxiliary, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -444,16 +428,9 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial( - self, - resource_group_name: str, - container_app_name: str, - source_control_name: str, - x_ms_github_auxiliary: Optional[str] = None, - ignore_workflow_deletion_failure: Optional[bool] = None, - delete_workflow: Optional[bool] = None, - **kwargs: Any + self, resource_group_name: str, container_app_name: str, source_control_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,9 +449,6 @@ async def _delete_initial( container_app_name=container_app_name, source_control_name=source_control_name, subscription_id=self._config.subscription_id, - x_ms_github_auxiliary=x_ms_github_auxiliary, - ignore_workflow_deletion_failure=ignore_workflow_deletion_failure, - delete_workflow=delete_workflow, api_version=api_version, headers=_headers, params=_params, @@ -507,14 +481,7 @@ async def _delete_initial( @distributed_trace_async async def begin_delete( - self, - resource_group_name: str, - container_app_name: str, - source_control_name: str, - x_ms_github_auxiliary: Optional[str] = None, - ignore_workflow_deletion_failure: Optional[bool] = None, - delete_workflow: Optional[bool] = None, - **kwargs: Any + self, resource_group_name: str, container_app_name: str, source_control_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Delete a Container App SourceControl. @@ -527,14 +494,6 @@ async def begin_delete( :type container_app_name: str :param source_control_name: Name of the Container App SourceControl. Required. :type source_control_name: str - :param x_ms_github_auxiliary: Github personal access token used for SourceControl. Default - value is None. - :type x_ms_github_auxiliary: str - :param ignore_workflow_deletion_failure: Ignore Workflow Deletion Failure. Default value is - None. - :type ignore_workflow_deletion_failure: bool - :param delete_workflow: Delete workflow. Default value is None. - :type delete_workflow: bool :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -552,9 +511,6 @@ async def begin_delete( resource_group_name=resource_group_name, container_app_name=container_app_name, source_control_name=source_control_name, - x_ms_github_auxiliary=x_ms_github_auxiliary, - ignore_workflow_deletion_failure=ignore_workflow_deletion_failure, - delete_workflow=delete_workflow, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_component_resiliency_policies_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_component_resiliency_policies_operations.py deleted file mode 100644 index 83bef2cb2959..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_component_resiliency_policies_operations.py +++ /dev/null @@ -1,444 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._dapr_component_resiliency_policies_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DaprComponentResiliencyPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`dapr_component_resiliency_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, component_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DaprComponentResiliencyPolicy"]: - """Get the resiliency policies for a Dapr component. - - Get the resiliency policies for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :return: An iterator like instance of either DaprComponentResiliencyPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprComponentResiliencyPoliciesCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DaprComponentResiliencyPoliciesCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, component_name: str, name: str, **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Get a Dapr component resiliency policy. - - Get a Dapr component resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprComponentResiliencyPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: _models.DaprComponentResiliencyPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Required. - :type dapr_component_resiliency_policy_envelope: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Required. - :type dapr_component_resiliency_policy_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: Union[_models.DaprComponentResiliencyPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Is either a DaprComponentResiliencyPolicy type or a IO[bytes] type. - Required. - :type dapr_component_resiliency_policy_envelope: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy or IO[bytes] - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DaprComponentResiliencyPolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_component_resiliency_policy_envelope, (IOBase, bytes)): - _content = dapr_component_resiliency_policy_envelope - else: - _json = self._serialize.body(dapr_component_resiliency_policy_envelope, "DaprComponentResiliencyPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, component_name: str, name: str, **kwargs: Any - ) -> None: - """Delete a Dapr component resiliency policy. - - Delete a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py index 000354f1d838..fb9eb23bfe25 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_components_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -39,7 +38,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +85,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DaprComponentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -168,7 +167,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +302,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,9 +359,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, component_name: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, environment_name: str, component_name: str, **kwargs: Any) -> None: """Delete a Dapr Component. Delete a Dapr Component from a Managed Environment. @@ -378,7 +375,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -437,7 +434,7 @@ async def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.DaprSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_subscriptions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_subscriptions_operations.py deleted file mode 100644 index 6f92d52e2b97..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dapr_subscriptions_operations.py +++ /dev/null @@ -1,420 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._dapr_subscriptions_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DaprSubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`dapr_subscriptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DaprSubscription"]: - """Get the Dapr subscriptions for a managed environment. - - Get the Dapr subscriptions for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either DaprSubscription or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.DaprSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprSubscriptionsCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DaprSubscriptionsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> _models.DaprSubscription: - """Get a dapr subscription. - - Get a dapr subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprSubscription] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprSubscription", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: _models.DaprSubscription, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Required. - :type dapr_subscription_envelope: ~azure.mgmt.appcontainers.models.DaprSubscription - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Required. - :type dapr_subscription_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: Union[_models.DaprSubscription, IO[bytes]], - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Is either a - DaprSubscription type or a IO[bytes] type. Required. - :type dapr_subscription_envelope: ~azure.mgmt.appcontainers.models.DaprSubscription or - IO[bytes] - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DaprSubscription] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_subscription_envelope, (IOBase, bytes)): - _content = dapr_subscription_envelope - else: - _json = self._serialize.body(dapr_subscription_envelope, "DaprSubscription") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprSubscription", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> None: - """Delete a Dapr subscription. - - Delete a Dapr subscription from a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dot_net_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dot_net_components_operations.py deleted file mode 100644 index cbf95800c59a..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_dot_net_components_operations.py +++ /dev/null @@ -1,765 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, 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 ...operations._dot_net_components_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DotNetComponentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`dot_net_components` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DotNetComponent"]: - """Get the .NET Components for a managed environment. - - Get the .NET Components for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either DotNetComponent or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DotNetComponentsCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DotNetComponentsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> _models.DotNetComponent: - """Get a .NET Component. - - Get a .NET Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :return: DotNetComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DotNetComponent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DotNetComponent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("DotNetComponent", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dot_net_component_envelope, (IOBase, bytes)): - _content = dot_net_component_envelope - else: - _json = self._serialize.body(dot_net_component_envelope, "DotNetComponent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: _models.DotNetComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Is either a - DotNetComponent type or a IO[bytes] type. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = 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, - environment_name=environment_name, - name=name, - dot_net_component_envelope=dot_net_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DotNetComponent", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DotNetComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DotNetComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dot_net_component_envelope, (IOBase, bytes)): - _content = dot_net_component_envelope - else: - _json = self._serialize.body(dot_net_component_envelope, "DotNetComponent") - - _request = build_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: _models.DotNetComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Is either a - DotNetComponent type or a IO[bytes] type. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = 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._update_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - dot_net_component_envelope=dot_net_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DotNetComponent", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.DotNetComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DotNetComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a .NET Component. - - Delete a .NET Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_functions_extension_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_functions_extension_operations.py deleted file mode 100644 index 5842f2f55257..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_functions_extension_operations.py +++ /dev/null @@ -1,125 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._functions_extension_operations import build_invoke_functions_host_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class FunctionsExtensionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`functions_extension` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def invoke_functions_host( - self, - resource_group_name: str, - container_app_name: str, - revision_name: str, - function_app_name: str, - **kwargs: Any - ) -> str: - """Proxies a Functions host call to the function app backed by the container app. - - Proxies a Functions host call to the function app backed by the container app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param revision_name: Name of the Container App Revision, the parent resource. Required. - :type revision_name: str - :param function_app_name: Name of the Function App, the extension resource. Required. - :type function_app_name: str - :return: str or the result of cls(response) - :rtype: str - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[str] = kwargs.pop("cls", None) - - _request = build_invoke_functions_host_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - revision_name=revision_name, - function_app_name=function_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("str", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_java_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_java_components_operations.py deleted file mode 100644 index ade6507b432b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_java_components_operations.py +++ /dev/null @@ -1,764 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, 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 ...operations._java_components_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class JavaComponentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`java_components` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.JavaComponent"]: - """Get the Java Components for a managed environment. - - Get the Java Components for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either JavaComponent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JavaComponentsCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JavaComponentsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> _models.JavaComponent: - """Get a Java Component. - - Get a Java Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :return: JavaComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.JavaComponent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JavaComponent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("JavaComponent", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(java_component_envelope, (IOBase, bytes)): - _content = java_component_envelope - else: - _json = self._serialize.body(java_component_envelope, "JavaComponent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: _models.JavaComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Is either a - JavaComponent type or a IO[bytes] type. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = 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, - environment_name=environment_name, - name=name, - java_component_envelope=java_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JavaComponent", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.JavaComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JavaComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(java_component_envelope, (IOBase, bytes)): - _content = java_component_envelope - else: - _json = self._serialize.body(java_component_envelope, "JavaComponent") - - _request = build_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: _models.JavaComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Is either a - JavaComponent type or a IO[bytes] type. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = 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._update_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - java_component_envelope=java_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JavaComponent", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.JavaComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JavaComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a Java Component. - - Delete a Java Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py index c261a646f9a7..1a470d10420f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_executions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -80,7 +79,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppJobExecutions] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py index 1a9c1c601aa5..91d654e8f638 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_jobs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,23 +42,21 @@ build_list_detectors_request, build_list_secrets_request, build_proxy_get_request, - build_resume_request, build_start_request, build_stop_execution_request, build_stop_multiple_executions_request, - build_suspend_request, build_update_request, ) if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class JobsOperations: # pylint: disable=too-many-public-methods +class JobsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -100,7 +98,7 @@ def list_detectors( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DiagnosticsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -182,7 +180,7 @@ async def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -228,7 +226,7 @@ async def get_detector( @distributed_trace_async async def proxy_get(self, resource_group_name: str, job_name: str, api_name: str, **kwargs: Any) -> _models.Job: - """Get the properties for a given Container App Job. + """Get the properties of a Container App Job. Get the properties of a Container App Job. @@ -243,7 +241,7 @@ async def proxy_get(self, resource_group_name: str, job_name: str, api_name: str :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +301,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Job"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +381,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -460,7 +458,7 @@ async def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -506,7 +504,7 @@ async def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _ async def _create_or_update_initial( self, resource_group_name: str, job_name: str, job_envelope: Union[_models.Job, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -695,7 +693,7 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -811,7 +809,7 @@ async def _update_initial( job_envelope: Union[_models.JobPatchProperties, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1011,7 +1009,7 @@ async def _start_initial( template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1215,7 +1213,7 @@ def get_long_running_output(pipeline_response): async def _stop_execution_initial( self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1333,7 +1331,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _stop_multiple_executions_initial( self, resource_group_name: str, job_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1467,7 +1465,7 @@ async def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.JobSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1509,241 +1507,3 @@ async def list_secrets( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - async def _resume_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_resume(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncLROPoller[_models.Job]: - """Resumes a suspended job. - - Resumes a suspended job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param job_name: Name of the Job. Required. - :type job_name: str - :return: An instance of AsyncLROPoller that returns either Job or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Job] = 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._resume_initial( - resource_group_name=resource_group_name, - job_name=job_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Job", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Job].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Job]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _suspend_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_suspend_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_suspend( - self, resource_group_name: str, job_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.Job]: - """Suspends a job. - - Suspends a job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param job_name: Name of the Job. Required. - :type job_name: str - :return: An instance of AsyncLROPoller that returns either Job or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Job] = 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._suspend_initial( - resource_group_name=resource_group_name, - job_name=job_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Job", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Job].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Job]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_logic_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_logic_apps_operations.py deleted file mode 100644 index cc823a950fa5..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_logic_apps_operations.py +++ /dev/null @@ -1,767 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._logic_apps_operations import ( - build_create_or_update_request, - build_delete_request, - build_deploy_workflow_artifacts_request, - build_get_request, - build_get_workflow_request, - build_invoke_request, - build_list_workflows_connections_request, - build_list_workflows_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class LogicAppsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`logic_apps` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any - ) -> _models.LogicApp: - """Gets a logic app extension resource. - - Gets a logic app extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :return: LogicApp or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.LogicApp - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LogicApp] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("LogicApp", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - resource: _models.LogicApp, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LogicApp: - """Create or update a Logic App extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param resource: Logic app resource properties. Required. - :type resource: ~azure.mgmt.appcontainers.models.LogicApp - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: LogicApp or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.LogicApp - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LogicApp: - """Create or update a Logic App extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param resource: Logic app resource properties. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: LogicApp or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.LogicApp - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - resource: Union[_models.LogicApp, IO[bytes]], - **kwargs: Any - ) -> _models.LogicApp: - """Create or update a Logic App extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param resource: Logic app resource properties. Is either a LogicApp type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.appcontainers.models.LogicApp or IO[bytes] - :return: LogicApp or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.LogicApp - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LogicApp] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "LogicApp") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("LogicApp", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any - ) -> None: - """Deletes a Logic App extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_workflows( - self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any - ) -> AsyncIterable["_models.WorkflowEnvelope"]: - """List the workflows for a logic app. - - List the workflows for a logic app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :return: An iterator like instance of either WorkflowEnvelope or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.WorkflowEnvelope] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkflowEnvelopeCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_workflows_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkflowEnvelopeCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_workflow( - self, resource_group_name: str, container_app_name: str, logic_app_name: str, workflow_name: str, **kwargs: Any - ) -> _models.WorkflowEnvelope: - """Get workflow information by its name. - - Get workflow information by its name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param workflow_name: Workflow name. Required. - :type workflow_name: str - :return: WorkflowEnvelope or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.WorkflowEnvelope - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkflowEnvelope] = kwargs.pop("cls", None) - - _request = build_get_workflow_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - workflow_name=workflow_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkflowEnvelope", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - workflow_artifacts: Optional[_models.WorkflowArtifacts] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Creates or updates the artifacts for the logic app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param workflow_artifacts: Application settings and files of the workflow. Default value is - None. - :type workflow_artifacts: ~azure.mgmt.appcontainers.models.WorkflowArtifacts - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - workflow_artifacts: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Creates or updates the artifacts for the logic app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param workflow_artifacts: Application settings and files of the workflow. Default value is - None. - :type workflow_artifacts: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - workflow_artifacts: Optional[Union[_models.WorkflowArtifacts, IO[bytes]]] = None, - **kwargs: Any - ) -> None: - """Creates or updates the artifacts for the logic app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param workflow_artifacts: Application settings and files of the workflow. Is either a - WorkflowArtifacts type or a IO[bytes] type. Default value is None. - :type workflow_artifacts: ~azure.mgmt.appcontainers.models.WorkflowArtifacts or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - 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(workflow_artifacts, (IOBase, bytes)): - _content = workflow_artifacts - else: - if workflow_artifacts is not None: - _json = self._serialize.body(workflow_artifacts, "WorkflowArtifacts") - else: - _json = None - - _request = build_deploy_workflow_artifacts_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def list_workflows_connections( - self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any - ) -> _models.WorkflowEnvelope: - """Gets logic app's connections. - - Gets logic app's connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :return: WorkflowEnvelope or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.WorkflowEnvelope - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkflowEnvelope] = kwargs.pop("cls", None) - - _request = build_list_workflows_connections_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkflowEnvelope", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def invoke( - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - x_ms_logic_apps_proxy_path: str, - x_ms_logic_apps_proxy_method: Union[str, _models.LogicAppsProxyMethod], - **kwargs: Any - ) -> JSON: - """Proxies a the API call to the logic app backed by the container app. - - Proxies a the API call to the logic app backed by the container app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the LogicApp App, the extension resource. Required. - :type logic_app_name: str - :param x_ms_logic_apps_proxy_path: The proxy path for the API call. Required. - :type x_ms_logic_apps_proxy_path: str - :param x_ms_logic_apps_proxy_method: The proxy method for the API call. Known values are: "GET" - and "POST". Required. - :type x_ms_logic_apps_proxy_method: str or - ~azure.mgmt.appcontainers.models.LogicAppsProxyMethod - :return: JSON or the result of cls(response) - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_invoke_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - x_ms_logic_apps_proxy_path=x_ms_logic_apps_proxy_path, - x_ms_logic_apps_proxy_method=x_ms_logic_apps_proxy_method, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("object", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py index 39cff80465ea..091b88359471 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,7 +42,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,7 +85,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ManagedCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,15 +137,11 @@ async def _create_or_update_initial( managed_certificate_envelope: Optional[Union[_models.ManagedCertificate, IO[bytes]]] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 400: cast( - Type[HttpResponseError], - lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -355,7 +350,7 @@ def get_long_running_output(pipeline_response): ) @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, environment_name: str, managed_certificate_name: str, **kwargs: Any ) -> None: """Deletes the specified Managed Certificate. @@ -373,7 +368,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -507,7 +502,7 @@ async def update( :rtype: ~azure.mgmt.appcontainers.models.ManagedCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -587,7 +582,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedCertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py index a2b62113b50a..2d141c684651 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +72,7 @@ async def list_detectors( :rtype: ~azure.mgmt.appcontainers.models.DiagnosticsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -135,7 +134,7 @@ async def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_endpoint_connections_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_endpoint_connections_operations.py deleted file mode 100644 index c90077c27e4f..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_endpoint_connections_operations.py +++ /dev/null @@ -1,557 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, 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 ...operations._managed_environment_private_endpoint_connections_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ManagedEnvironmentPrivateEndpointConnectionsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`managed_environment_private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.PrivateEndpointConnection"]: - """List private endpoint connections for a given managed environment. - - List private endpoint connections for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either PrivateEndpointConnection or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, environment_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Get a private endpoint connection for a given managed environment. - - Get a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection_envelope: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(private_endpoint_connection_envelope, (IOBase, bytes)): - _content = private_endpoint_connection_envelope - else: - _json = self._serialize.body(private_endpoint_connection_envelope, "PrivateEndpointConnection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection_envelope: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Update the state of a private endpoint connection for a given managed environment. - - Update the state of a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection_envelope: The resource of private endpoint and its - properties. Required. - :type private_endpoint_connection_envelope: - ~azure.mgmt.appcontainers.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Update the state of a private endpoint connection for a given managed environment. - - Update the state of a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection_envelope: The resource of private endpoint and its - properties. Required. - :type private_endpoint_connection_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection_envelope: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Update the state of a private endpoint connection for a given managed environment. - - Update the state of a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection_envelope: The resource of private endpoint and its - properties. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type private_endpoint_connection_envelope: - ~azure.mgmt.appcontainers.models.PrivateEndpointConnection or IO[bytes] - :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - 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) - 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, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - private_endpoint_connection_envelope=private_endpoint_connection_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, environment_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, environment_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a private endpoint connection for a given managed environment. - - Delete a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_link_resources_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_link_resources_operations.py deleted file mode 100644 index 59636be922d3..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_private_link_resources_operations.py +++ /dev/null @@ -1,143 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._managed_environment_private_link_resources_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ManagedEnvironmentPrivateLinkResourcesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.aio.ContainerAppsAPIClient`'s - :attr:`managed_environment_private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> AsyncIterable["_models.PrivateLinkResource"]: - """List private link resources for a given managed environment. - - List private link resources for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either PrivateLinkResource or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.appcontainers.models.PrivateLinkResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_usages_operations.py index f41521e7076b..dd057f307cb5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environment_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -74,7 +73,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py index 913445a2aa38..2c65cd16f2ee 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +69,7 @@ async def get_root( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py index 58184362c225..4f500a905537 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -46,7 +45,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -87,7 +86,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ManagedE api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedEnvironmentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +169,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedEnvironmentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +246,7 @@ async def get(self, resource_group_name: str, environment_name: str, **kwargs: A :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -297,7 +296,7 @@ async def _create_or_update_initial( environment_envelope: Union[_models.ManagedEnvironment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -492,7 +491,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, environment_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,7 +603,7 @@ async def _update_initial( environment_envelope: Union[_models.ManagedEnvironment, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -813,7 +812,7 @@ async def get_auth_token( :rtype: ~azure.mgmt.appcontainers.models.EnvironmentAuthToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -881,7 +880,7 @@ def list_workload_profile_states( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadProfileStatesCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py index 4df31389d777..b64970565bf2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_managed_environments_storages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,7 +34,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -76,7 +75,7 @@ async def list( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStoragesCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +137,7 @@ async def get( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -273,7 +272,7 @@ async def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,9 +329,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, storage_name: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, environment_name: str, storage_name: str, **kwargs: Any) -> None: """Delete storage for a managedEnvironment. Delete storage for a managedEnvironment. @@ -348,7 +345,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py index 6c4b11ba1a03..208dcdec4cdf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_namespaces_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -138,7 +137,7 @@ async def check_name_availability( :rtype: ~azure.mgmt.appcontainers.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py index 05240797532c..3c05cd264bb5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -70,7 +69,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationDetail"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AvailableOperations] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_usages_operations.py index 3cb70b68e447..7e8582d07d35 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/aio/operations/_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,7 +71,7 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.Usage"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py index d6a2ce622d06..f17a3e93563f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/__init__.py @@ -5,381 +5,250 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import AllowedAudiencesValidation -from ._models_py3 import AllowedPrincipals -from ._models_py3 import AppInsightsConfiguration -from ._models_py3 import AppLogsConfiguration -from ._models_py3 import AppRegistration -from ._models_py3 import AppResiliency -from ._models_py3 import AppResiliencyCollection -from ._models_py3 import Apple -from ._models_py3 import AppleRegistration -from ._models_py3 import AuthConfig -from ._models_py3 import AuthConfigCollection -from ._models_py3 import AuthPlatform -from ._models_py3 import AvailableOperations -from ._models_py3 import AvailableWorkloadProfile -from ._models_py3 import AvailableWorkloadProfileProperties -from ._models_py3 import AvailableWorkloadProfilesCollection -from ._models_py3 import AzureActiveDirectory -from ._models_py3 import AzureActiveDirectoryLogin -from ._models_py3 import AzureActiveDirectoryRegistration -from ._models_py3 import AzureActiveDirectoryValidation -from ._models_py3 import AzureCredentials -from ._models_py3 import AzureFileProperties -from ._models_py3 import AzureStaticWebApps -from ._models_py3 import AzureStaticWebAppsRegistration -from ._models_py3 import BaseContainer -from ._models_py3 import BillingMeter -from ._models_py3 import BillingMeterCollection -from ._models_py3 import BillingMeterProperties -from ._models_py3 import BlobStorageTokenStore -from ._models_py3 import BuildCollection -from ._models_py3 import BuildConfiguration -from ._models_py3 import BuildResource -from ._models_py3 import BuildToken -from ._models_py3 import BuilderCollection -from ._models_py3 import BuilderResource -from ._models_py3 import BuilderResourceUpdate -from ._models_py3 import Certificate -from ._models_py3 import CertificateCollection -from ._models_py3 import CertificateKeyVaultProperties -from ._models_py3 import CertificatePatch -from ._models_py3 import CertificateProperties -from ._models_py3 import CheckNameAvailabilityRequest -from ._models_py3 import CheckNameAvailabilityResponse -from ._models_py3 import CircuitBreakerPolicy -from ._models_py3 import ClientRegistration -from ._models_py3 import Configuration -from ._models_py3 import ConnectedEnvironment -from ._models_py3 import ConnectedEnvironmentCollection -from ._models_py3 import ConnectedEnvironmentStorage -from ._models_py3 import ConnectedEnvironmentStorageProperties -from ._models_py3 import ConnectedEnvironmentStoragesCollection -from ._models_py3 import Container -from ._models_py3 import ContainerApp -from ._models_py3 import ContainerAppAuthToken -from ._models_py3 import ContainerAppCollection -from ._models_py3 import ContainerAppJobExecutions -from ._models_py3 import ContainerAppProbe -from ._models_py3 import ContainerAppProbeHttpGet -from ._models_py3 import ContainerAppProbeHttpGetHttpHeadersItem -from ._models_py3 import ContainerAppProbeTcpSocket -from ._models_py3 import ContainerAppPropertiesPatchingConfiguration -from ._models_py3 import ContainerAppSecret -from ._models_py3 import ContainerAppsBuildCollection -from ._models_py3 import ContainerAppsBuildConfiguration -from ._models_py3 import ContainerAppsBuildResource -from ._models_py3 import ContainerAppsPatchResource -from ._models_py3 import ContainerExecutionStatus -from ._models_py3 import ContainerRegistry -from ._models_py3 import ContainerRegistryWithCustomImage -from ._models_py3 import ContainerResources -from ._models_py3 import CookieExpiration -from ._models_py3 import CorsPolicy -from ._models_py3 import CustomContainerTemplate -from ._models_py3 import CustomDomain -from ._models_py3 import CustomDomainConfiguration -from ._models_py3 import CustomHostnameAnalysisResult -from ._models_py3 import CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo -from ._models_py3 import CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem -from ._models_py3 import CustomOpenIdConnectProvider -from ._models_py3 import CustomScaleRule -from ._models_py3 import Dapr -from ._models_py3 import DaprComponent -from ._models_py3 import DaprComponentResiliencyPoliciesCollection -from ._models_py3 import DaprComponentResiliencyPolicy -from ._models_py3 import DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration -from ._models_py3 import DaprComponentResiliencyPolicyConfiguration -from ._models_py3 import DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration -from ._models_py3 import DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration -from ._models_py3 import DaprComponentResiliencyPolicyTimeoutPolicyConfiguration -from ._models_py3 import DaprComponentServiceBinding -from ._models_py3 import DaprComponentsCollection -from ._models_py3 import DaprConfiguration -from ._models_py3 import DaprMetadata -from ._models_py3 import DaprSecret -from ._models_py3 import DaprSecretsCollection -from ._models_py3 import DaprServiceBindMetadata -from ._models_py3 import DaprSubscription -from ._models_py3 import DaprSubscriptionBulkSubscribeOptions -from ._models_py3 import DaprSubscriptionRouteRule -from ._models_py3 import DaprSubscriptionRoutes -from ._models_py3 import DaprSubscriptionsCollection -from ._models_py3 import DataDogConfiguration -from ._models_py3 import DefaultAuthorizationPolicy -from ._models_py3 import DefaultErrorResponse -from ._models_py3 import DefaultErrorResponseError -from ._models_py3 import DefaultErrorResponseErrorDetailsItem -from ._models_py3 import DestinationsConfiguration -from ._models_py3 import DiagnosticDataProviderMetadata -from ._models_py3 import DiagnosticDataProviderMetadataPropertyBagItem -from ._models_py3 import DiagnosticDataTableResponseColumn -from ._models_py3 import DiagnosticDataTableResponseObject -from ._models_py3 import DiagnosticRendering -from ._models_py3 import DiagnosticSupportTopic -from ._models_py3 import Diagnostics -from ._models_py3 import DiagnosticsCollection -from ._models_py3 import DiagnosticsDataApiResponse -from ._models_py3 import DiagnosticsDefinition -from ._models_py3 import DiagnosticsProperties -from ._models_py3 import DiagnosticsStatus -from ._models_py3 import DotNetComponent -from ._models_py3 import DotNetComponentConfigurationProperty -from ._models_py3 import DotNetComponentServiceBind -from ._models_py3 import DotNetComponentsCollection -from ._models_py3 import DynamicPoolConfiguration -from ._models_py3 import EncryptionSettings -from ._models_py3 import EnvironmentAuthToken -from ._models_py3 import EnvironmentVar -from ._models_py3 import EnvironmentVariable -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorEntity -from ._models_py3 import ErrorResponse -from ._models_py3 import ExecutionStatus -from ._models_py3 import ExtendedLocation -from ._models_py3 import Facebook -from ._models_py3 import ForwardProxy -from ._models_py3 import GitHub -from ._models_py3 import GithubActionConfiguration -from ._models_py3 import GlobalValidation -from ._models_py3 import Google -from ._models_py3 import Header -from ._models_py3 import HeaderMatch -from ._models_py3 import HttpConnectionPool -from ._models_py3 import HttpGet -from ._models_py3 import HttpRetryPolicy -from ._models_py3 import HttpScaleRule -from ._models_py3 import HttpSettings -from ._models_py3 import HttpSettingsRoutes -from ._models_py3 import IdentityProviders -from ._models_py3 import IdentitySettings -from ._models_py3 import Ingress -from ._models_py3 import IngressPortMapping -from ._models_py3 import IngressStickySessions -from ._models_py3 import InitContainer -from ._models_py3 import IpSecurityRestrictionRule -from ._models_py3 import JavaComponent -from ._models_py3 import JavaComponentConfigurationProperty -from ._models_py3 import JavaComponentIngress -from ._models_py3 import JavaComponentProperties -from ._models_py3 import JavaComponentPropertiesScale -from ._models_py3 import JavaComponentServiceBind -from ._models_py3 import JavaComponentsCollection -from ._models_py3 import Job -from ._models_py3 import JobConfiguration -from ._models_py3 import JobConfigurationEventTriggerConfig -from ._models_py3 import JobConfigurationManualTriggerConfig -from ._models_py3 import JobConfigurationScheduleTriggerConfig -from ._models_py3 import JobExecution -from ._models_py3 import JobExecutionBase -from ._models_py3 import JobExecutionContainer -from ._models_py3 import JobExecutionNamesCollection -from ._models_py3 import JobExecutionTemplate -from ._models_py3 import JobPatchProperties -from ._models_py3 import JobPatchPropertiesProperties -from ._models_py3 import JobScale -from ._models_py3 import JobScaleRule -from ._models_py3 import JobSecretsCollection -from ._models_py3 import JobTemplate -from ._models_py3 import JobsCollection -from ._models_py3 import JwtClaimChecks -from ._models_py3 import KedaConfiguration -from ._models_py3 import ListUsagesResult -from ._models_py3 import LogAnalyticsConfiguration -from ._models_py3 import LoggerSetting -from ._models_py3 import LogicApp -from ._models_py3 import Login -from ._models_py3 import LoginRoutes -from ._models_py3 import LoginScopes -from ._models_py3 import LogsConfiguration -from ._models_py3 import ManagedCertificate -from ._models_py3 import ManagedCertificateCollection -from ._models_py3 import ManagedCertificatePatch -from ._models_py3 import ManagedCertificateProperties -from ._models_py3 import ManagedEnvironment -from ._models_py3 import ManagedEnvironmentPropertiesPeerAuthentication -from ._models_py3 import ManagedEnvironmentPropertiesPeerTrafficConfiguration -from ._models_py3 import ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption -from ._models_py3 import ManagedEnvironmentStorage -from ._models_py3 import ManagedEnvironmentStorageProperties -from ._models_py3 import ManagedEnvironmentStoragesCollection -from ._models_py3 import ManagedEnvironmentsCollection -from ._models_py3 import ManagedServiceIdentity -from ._models_py3 import MetricsConfiguration -from ._models_py3 import Mtls -from ._models_py3 import NacosComponent -from ._models_py3 import NfsAzureFileProperties -from ._models_py3 import Nonce -from ._models_py3 import OpenIdConnectClientCredential -from ._models_py3 import OpenIdConnectConfig -from ._models_py3 import OpenIdConnectLogin -from ._models_py3 import OpenIdConnectRegistration -from ._models_py3 import OpenTelemetryConfiguration -from ._models_py3 import OperationDetail -from ._models_py3 import OperationDisplay -from ._models_py3 import OtlpConfiguration -from ._models_py3 import PatchCollection -from ._models_py3 import PatchDetails -from ._models_py3 import PatchDetailsNewLayer -from ._models_py3 import PatchDetailsOldLayer -from ._models_py3 import PatchProperties -from ._models_py3 import PatchSkipConfig -from ._models_py3 import PreBuildStep -from ._models_py3 import PrivateEndpoint -from ._models_py3 import PrivateEndpointConnection -from ._models_py3 import PrivateEndpointConnectionListResult -from ._models_py3 import PrivateLinkResource -from ._models_py3 import PrivateLinkResourceListResult -from ._models_py3 import PrivateLinkServiceConnectionState -from ._models_py3 import ProxyResource -from ._models_py3 import QueueScaleRule -from ._models_py3 import RegistryCredentials -from ._models_py3 import RegistryInfo -from ._models_py3 import Replica -from ._models_py3 import ReplicaCollection -from ._models_py3 import ReplicaContainer -from ._models_py3 import ReplicaExecutionStatus -from ._models_py3 import Resource -from ._models_py3 import Revision -from ._models_py3 import RevisionCollection -from ._models_py3 import Runtime -from ._models_py3 import RuntimeDotnet -from ._models_py3 import RuntimeJava -from ._models_py3 import RuntimeJavaAgent -from ._models_py3 import RuntimeJavaAgentLogging -from ._models_py3 import Scale -from ._models_py3 import ScaleConfiguration -from ._models_py3 import ScaleRule -from ._models_py3 import ScaleRuleAuth -from ._models_py3 import ScgRoute -from ._models_py3 import Secret -from ._models_py3 import SecretVolumeItem -from ._models_py3 import SecretsCollection -from ._models_py3 import Service -from ._models_py3 import ServiceBind -from ._models_py3 import SessionContainer -from ._models_py3 import SessionContainerResources -from ._models_py3 import SessionIngress -from ._models_py3 import SessionNetworkConfiguration -from ._models_py3 import SessionPool -from ._models_py3 import SessionPoolCollection -from ._models_py3 import SessionPoolSecret -from ._models_py3 import SessionPoolUpdatableProperties -from ._models_py3 import SessionRegistryCredentials -from ._models_py3 import SmbStorage -from ._models_py3 import SourceControl -from ._models_py3 import SourceControlCollection -from ._models_py3 import SpringBootAdminComponent -from ._models_py3 import SpringCloudConfigComponent -from ._models_py3 import SpringCloudEurekaComponent -from ._models_py3 import SpringCloudGatewayComponent -from ._models_py3 import SystemData -from ._models_py3 import TcpConnectionPool -from ._models_py3 import TcpRetryPolicy -from ._models_py3 import TcpScaleRule -from ._models_py3 import Template -from ._models_py3 import TimeoutPolicy -from ._models_py3 import TokenStore -from ._models_py3 import TracesConfiguration -from ._models_py3 import TrackedResource -from ._models_py3 import TrafficWeight -from ._models_py3 import Twitter -from ._models_py3 import TwitterRegistration -from ._models_py3 import Usage -from ._models_py3 import UsageName -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import VnetConfiguration -from ._models_py3 import Volume -from ._models_py3 import VolumeMount -from ._models_py3 import WorkflowArtifacts -from ._models_py3 import WorkflowEnvelope -from ._models_py3 import WorkflowEnvelopeCollection -from ._models_py3 import WorkflowEnvelopeProperties -from ._models_py3 import WorkflowHealth -from ._models_py3 import WorkloadProfile -from ._models_py3 import WorkloadProfileStates -from ._models_py3 import WorkloadProfileStatesCollection -from ._models_py3 import WorkloadProfileStatesProperties +from typing import TYPE_CHECKING -from ._container_apps_api_client_enums import AccessMode -from ._container_apps_api_client_enums import Action -from ._container_apps_api_client_enums import ActiveRevisionsMode -from ._container_apps_api_client_enums import Affinity -from ._container_apps_api_client_enums import AppProtocol -from ._container_apps_api_client_enums import Applicability -from ._container_apps_api_client_enums import BindingType -from ._container_apps_api_client_enums import BuildProvisioningState -from ._container_apps_api_client_enums import BuildStatus -from ._container_apps_api_client_enums import BuilderProvisioningState -from ._container_apps_api_client_enums import CertificateProvisioningState -from ._container_apps_api_client_enums import CertificateType -from ._container_apps_api_client_enums import CheckNameAvailabilityReason -from ._container_apps_api_client_enums import ConnectedEnvironmentProvisioningState -from ._container_apps_api_client_enums import ContainerAppContainerRunningState -from ._container_apps_api_client_enums import ContainerAppProvisioningState -from ._container_apps_api_client_enums import ContainerAppReplicaRunningState -from ._container_apps_api_client_enums import ContainerType -from ._container_apps_api_client_enums import CookieExpirationConvention -from ._container_apps_api_client_enums import CreatedByType -from ._container_apps_api_client_enums import DetectionStatus -from ._container_apps_api_client_enums import DnsVerificationTestResult -from ._container_apps_api_client_enums import DotNetComponentProvisioningState -from ._container_apps_api_client_enums import DotNetComponentType -from ._container_apps_api_client_enums import EnvironmentProvisioningState -from ._container_apps_api_client_enums import ExecutionType -from ._container_apps_api_client_enums import ExtendedLocationTypes -from ._container_apps_api_client_enums import ForwardProxyConvention -from ._container_apps_api_client_enums import IdentitySettingsLifeCycle -from ._container_apps_api_client_enums import ImageType -from ._container_apps_api_client_enums import IngressClientCertificateMode -from ._container_apps_api_client_enums import IngressTargetPortHttpScheme -from ._container_apps_api_client_enums import IngressTransportMethod -from ._container_apps_api_client_enums import JavaComponentProvisioningState -from ._container_apps_api_client_enums import JavaComponentType -from ._container_apps_api_client_enums import JobExecutionRunningState -from ._container_apps_api_client_enums import JobProvisioningState -from ._container_apps_api_client_enums import JobRunningState -from ._container_apps_api_client_enums import Kind -from ._container_apps_api_client_enums import Level -from ._container_apps_api_client_enums import LogLevel -from ._container_apps_api_client_enums import LogicAppsProxyMethod -from ._container_apps_api_client_enums import ManagedCertificateDomainControlValidation -from ._container_apps_api_client_enums import ManagedServiceIdentityType -from ._container_apps_api_client_enums import PatchApplyStatus -from ._container_apps_api_client_enums import PatchType -from ._container_apps_api_client_enums import PatchingMode -from ._container_apps_api_client_enums import PoolManagementType -from ._container_apps_api_client_enums import PrivateEndpointConnectionProvisioningState -from ._container_apps_api_client_enums import PrivateEndpointServiceConnectionStatus -from ._container_apps_api_client_enums import PublicNetworkAccess -from ._container_apps_api_client_enums import RevisionHealthState -from ._container_apps_api_client_enums import RevisionProvisioningState -from ._container_apps_api_client_enums import RevisionRunningState -from ._container_apps_api_client_enums import Scheme -from ._container_apps_api_client_enums import SessionNetworkStatus -from ._container_apps_api_client_enums import SessionPoolProvisioningState -from ._container_apps_api_client_enums import SourceControlOperationState -from ._container_apps_api_client_enums import StorageType -from ._container_apps_api_client_enums import TriggerType -from ._container_apps_api_client_enums import Type -from ._container_apps_api_client_enums import UnauthenticatedClientActionV2 -from ._container_apps_api_client_enums import WorkflowHealthState -from ._container_apps_api_client_enums import WorkflowState +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + AllowedAudiencesValidation, + AllowedPrincipals, + AppLogsConfiguration, + AppRegistration, + Apple, + AppleRegistration, + AuthConfig, + AuthConfigCollection, + AuthPlatform, + AvailableOperations, + AvailableWorkloadProfile, + AvailableWorkloadProfileProperties, + AvailableWorkloadProfilesCollection, + AzureActiveDirectory, + AzureActiveDirectoryLogin, + AzureActiveDirectoryRegistration, + AzureActiveDirectoryValidation, + AzureCredentials, + AzureFileProperties, + AzureStaticWebApps, + AzureStaticWebAppsRegistration, + BaseContainer, + BillingMeter, + BillingMeterCollection, + BillingMeterProperties, + BlobStorageTokenStore, + Certificate, + CertificateCollection, + CertificatePatch, + CertificateProperties, + CheckNameAvailabilityRequest, + CheckNameAvailabilityResponse, + ClientRegistration, + Configuration, + ConnectedEnvironment, + ConnectedEnvironmentCollection, + ConnectedEnvironmentStorage, + ConnectedEnvironmentStorageProperties, + ConnectedEnvironmentStoragesCollection, + Container, + ContainerApp, + ContainerAppAuthToken, + ContainerAppCollection, + ContainerAppJobExecutions, + ContainerAppProbe, + ContainerAppProbeHttpGet, + ContainerAppProbeHttpGetHttpHeadersItem, + ContainerAppProbeTcpSocket, + ContainerAppSecret, + ContainerResources, + CookieExpiration, + CorsPolicy, + CustomDomain, + CustomDomainConfiguration, + CustomHostnameAnalysisResult, + CustomHostnameAnalysisResultCustomDomainVerificationFailureInfo, + CustomHostnameAnalysisResultCustomDomainVerificationFailureInfoDetailsItem, + CustomOpenIdConnectProvider, + CustomScaleRule, + Dapr, + DaprComponent, + DaprComponentsCollection, + DaprConfiguration, + DaprMetadata, + DaprSecret, + DaprSecretsCollection, + DefaultAuthorizationPolicy, + DefaultErrorResponse, + DefaultErrorResponseError, + DefaultErrorResponseErrorDetailsItem, + DiagnosticDataProviderMetadata, + DiagnosticDataProviderMetadataPropertyBagItem, + DiagnosticDataTableResponseColumn, + DiagnosticDataTableResponseObject, + DiagnosticRendering, + DiagnosticSupportTopic, + Diagnostics, + DiagnosticsCollection, + DiagnosticsDataApiResponse, + DiagnosticsDefinition, + DiagnosticsProperties, + DiagnosticsStatus, + EncryptionSettings, + EnvironmentAuthToken, + EnvironmentVar, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + ExtendedLocation, + Facebook, + ForwardProxy, + GitHub, + GithubActionConfiguration, + GlobalValidation, + Google, + HttpScaleRule, + HttpSettings, + HttpSettingsRoutes, + IdentityProviders, + Ingress, + IngressPortMapping, + IngressStickySessions, + InitContainer, + IpSecurityRestrictionRule, + Job, + JobConfiguration, + JobConfigurationEventTriggerConfig, + JobConfigurationManualTriggerConfig, + JobConfigurationScheduleTriggerConfig, + JobExecution, + JobExecutionBase, + JobExecutionContainer, + JobExecutionNamesCollection, + JobExecutionTemplate, + JobPatchProperties, + JobPatchPropertiesProperties, + JobScale, + JobScaleRule, + JobSecretsCollection, + JobTemplate, + JobsCollection, + JwtClaimChecks, + KedaConfiguration, + ListUsagesResult, + LogAnalyticsConfiguration, + Login, + LoginRoutes, + LoginScopes, + ManagedCertificate, + ManagedCertificateCollection, + ManagedCertificatePatch, + ManagedCertificateProperties, + ManagedEnvironment, + ManagedEnvironmentPropertiesPeerAuthentication, + ManagedEnvironmentPropertiesPeerTrafficConfiguration, + ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption, + ManagedEnvironmentStorage, + ManagedEnvironmentStorageProperties, + ManagedEnvironmentStoragesCollection, + ManagedEnvironmentsCollection, + ManagedServiceIdentity, + Mtls, + Nonce, + OpenIdConnectClientCredential, + OpenIdConnectConfig, + OpenIdConnectLogin, + OpenIdConnectRegistration, + OperationDetail, + OperationDisplay, + ProxyResource, + QueueScaleRule, + RegistryCredentials, + RegistryInfo, + Replica, + ReplicaCollection, + ReplicaContainer, + Resource, + Revision, + RevisionCollection, + Scale, + ScaleRule, + ScaleRuleAuth, + Secret, + SecretVolumeItem, + SecretsCollection, + Service, + ServiceBind, + SourceControl, + SourceControlCollection, + SystemData, + TcpScaleRule, + Template, + TokenStore, + TrackedResource, + TrafficWeight, + Twitter, + TwitterRegistration, + Usage, + UsageName, + UserAssignedIdentity, + VnetConfiguration, + Volume, + VolumeMount, + WorkloadProfile, + WorkloadProfileStates, + WorkloadProfileStatesCollection, + WorkloadProfileStatesProperties, +) + +from ._container_apps_api_client_enums import ( # type: ignore + AccessMode, + Action, + ActiveRevisionsMode, + Affinity, + AppProtocol, + Applicability, + BindingType, + CertificateProvisioningState, + CheckNameAvailabilityReason, + ConnectedEnvironmentProvisioningState, + ContainerAppContainerRunningState, + ContainerAppProvisioningState, + ContainerAppReplicaRunningState, + CookieExpirationConvention, + CreatedByType, + DnsVerificationTestResult, + EnvironmentProvisioningState, + ExtendedLocationTypes, + ForwardProxyConvention, + IngressClientCertificateMode, + IngressTransportMethod, + JobExecutionRunningState, + JobProvisioningState, + LogLevel, + ManagedCertificateDomainControlValidation, + ManagedServiceIdentityType, + RevisionHealthState, + RevisionProvisioningState, + RevisionRunningState, + Scheme, + SourceControlOperationState, + StorageType, + TriggerType, + Type, + UnauthenticatedClientActionV2, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "AllowedAudiencesValidation", "AllowedPrincipals", - "AppInsightsConfiguration", "AppLogsConfiguration", "AppRegistration", - "AppResiliency", - "AppResiliencyCollection", "Apple", "AppleRegistration", "AuthConfig", @@ -402,21 +271,12 @@ "BillingMeterCollection", "BillingMeterProperties", "BlobStorageTokenStore", - "BuildCollection", - "BuildConfiguration", - "BuildResource", - "BuildToken", - "BuilderCollection", - "BuilderResource", - "BuilderResourceUpdate", "Certificate", "CertificateCollection", - "CertificateKeyVaultProperties", "CertificatePatch", "CertificateProperties", "CheckNameAvailabilityRequest", "CheckNameAvailabilityResponse", - "CircuitBreakerPolicy", "ClientRegistration", "Configuration", "ConnectedEnvironment", @@ -433,19 +293,10 @@ "ContainerAppProbeHttpGet", "ContainerAppProbeHttpGetHttpHeadersItem", "ContainerAppProbeTcpSocket", - "ContainerAppPropertiesPatchingConfiguration", "ContainerAppSecret", - "ContainerAppsBuildCollection", - "ContainerAppsBuildConfiguration", - "ContainerAppsBuildResource", - "ContainerAppsPatchResource", - "ContainerExecutionStatus", - "ContainerRegistry", - "ContainerRegistryWithCustomImage", "ContainerResources", "CookieExpiration", "CorsPolicy", - "CustomContainerTemplate", "CustomDomain", "CustomDomainConfiguration", "CustomHostnameAnalysisResult", @@ -455,31 +306,15 @@ "CustomScaleRule", "Dapr", "DaprComponent", - "DaprComponentResiliencyPoliciesCollection", - "DaprComponentResiliencyPolicy", - "DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration", - "DaprComponentResiliencyPolicyConfiguration", - "DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration", - "DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration", - "DaprComponentResiliencyPolicyTimeoutPolicyConfiguration", - "DaprComponentServiceBinding", "DaprComponentsCollection", "DaprConfiguration", "DaprMetadata", "DaprSecret", "DaprSecretsCollection", - "DaprServiceBindMetadata", - "DaprSubscription", - "DaprSubscriptionBulkSubscribeOptions", - "DaprSubscriptionRouteRule", - "DaprSubscriptionRoutes", - "DaprSubscriptionsCollection", - "DataDogConfiguration", "DefaultAuthorizationPolicy", "DefaultErrorResponse", "DefaultErrorResponseError", "DefaultErrorResponseErrorDetailsItem", - "DestinationsConfiguration", "DiagnosticDataProviderMetadata", "DiagnosticDataProviderMetadataPropertyBagItem", "DiagnosticDataTableResponseColumn", @@ -492,20 +327,12 @@ "DiagnosticsDefinition", "DiagnosticsProperties", "DiagnosticsStatus", - "DotNetComponent", - "DotNetComponentConfigurationProperty", - "DotNetComponentServiceBind", - "DotNetComponentsCollection", - "DynamicPoolConfiguration", "EncryptionSettings", "EnvironmentAuthToken", "EnvironmentVar", - "EnvironmentVariable", "ErrorAdditionalInfo", "ErrorDetail", - "ErrorEntity", "ErrorResponse", - "ExecutionStatus", "ExtendedLocation", "Facebook", "ForwardProxy", @@ -513,28 +340,15 @@ "GithubActionConfiguration", "GlobalValidation", "Google", - "Header", - "HeaderMatch", - "HttpConnectionPool", - "HttpGet", - "HttpRetryPolicy", "HttpScaleRule", "HttpSettings", "HttpSettingsRoutes", "IdentityProviders", - "IdentitySettings", "Ingress", "IngressPortMapping", "IngressStickySessions", "InitContainer", "IpSecurityRestrictionRule", - "JavaComponent", - "JavaComponentConfigurationProperty", - "JavaComponentIngress", - "JavaComponentProperties", - "JavaComponentPropertiesScale", - "JavaComponentServiceBind", - "JavaComponentsCollection", "Job", "JobConfiguration", "JobConfigurationEventTriggerConfig", @@ -556,12 +370,9 @@ "KedaConfiguration", "ListUsagesResult", "LogAnalyticsConfiguration", - "LoggerSetting", - "LogicApp", "Login", "LoginRoutes", "LoginScopes", - "LogsConfiguration", "ManagedCertificate", "ManagedCertificateCollection", "ManagedCertificatePatch", @@ -575,32 +386,14 @@ "ManagedEnvironmentStoragesCollection", "ManagedEnvironmentsCollection", "ManagedServiceIdentity", - "MetricsConfiguration", "Mtls", - "NacosComponent", - "NfsAzureFileProperties", "Nonce", "OpenIdConnectClientCredential", "OpenIdConnectConfig", "OpenIdConnectLogin", "OpenIdConnectRegistration", - "OpenTelemetryConfiguration", "OperationDetail", "OperationDisplay", - "OtlpConfiguration", - "PatchCollection", - "PatchDetails", - "PatchDetailsNewLayer", - "PatchDetailsOldLayer", - "PatchProperties", - "PatchSkipConfig", - "PreBuildStep", - "PrivateEndpoint", - "PrivateEndpointConnection", - "PrivateEndpointConnectionListResult", - "PrivateLinkResource", - "PrivateLinkResourceListResult", - "PrivateLinkServiceConnectionState", "ProxyResource", "QueueScaleRule", "RegistryCredentials", @@ -608,49 +401,23 @@ "Replica", "ReplicaCollection", "ReplicaContainer", - "ReplicaExecutionStatus", "Resource", "Revision", "RevisionCollection", - "Runtime", - "RuntimeDotnet", - "RuntimeJava", - "RuntimeJavaAgent", - "RuntimeJavaAgentLogging", "Scale", - "ScaleConfiguration", "ScaleRule", "ScaleRuleAuth", - "ScgRoute", "Secret", "SecretVolumeItem", "SecretsCollection", "Service", "ServiceBind", - "SessionContainer", - "SessionContainerResources", - "SessionIngress", - "SessionNetworkConfiguration", - "SessionPool", - "SessionPoolCollection", - "SessionPoolSecret", - "SessionPoolUpdatableProperties", - "SessionRegistryCredentials", - "SmbStorage", "SourceControl", "SourceControlCollection", - "SpringBootAdminComponent", - "SpringCloudConfigComponent", - "SpringCloudEurekaComponent", - "SpringCloudGatewayComponent", "SystemData", - "TcpConnectionPool", - "TcpRetryPolicy", "TcpScaleRule", "Template", - "TimeoutPolicy", "TokenStore", - "TracesConfiguration", "TrackedResource", "TrafficWeight", "Twitter", @@ -661,11 +428,6 @@ "VnetConfiguration", "Volume", "VolumeMount", - "WorkflowArtifacts", - "WorkflowEnvelope", - "WorkflowEnvelopeCollection", - "WorkflowEnvelopeProperties", - "WorkflowHealth", "WorkloadProfile", "WorkloadProfileStates", "WorkloadProfileStatesCollection", @@ -677,63 +439,34 @@ "AppProtocol", "Applicability", "BindingType", - "BuildProvisioningState", - "BuildStatus", - "BuilderProvisioningState", "CertificateProvisioningState", - "CertificateType", "CheckNameAvailabilityReason", "ConnectedEnvironmentProvisioningState", "ContainerAppContainerRunningState", "ContainerAppProvisioningState", "ContainerAppReplicaRunningState", - "ContainerType", "CookieExpirationConvention", "CreatedByType", - "DetectionStatus", "DnsVerificationTestResult", - "DotNetComponentProvisioningState", - "DotNetComponentType", "EnvironmentProvisioningState", - "ExecutionType", "ExtendedLocationTypes", "ForwardProxyConvention", - "IdentitySettingsLifeCycle", - "ImageType", "IngressClientCertificateMode", - "IngressTargetPortHttpScheme", "IngressTransportMethod", - "JavaComponentProvisioningState", - "JavaComponentType", "JobExecutionRunningState", "JobProvisioningState", - "JobRunningState", - "Kind", - "Level", "LogLevel", - "LogicAppsProxyMethod", "ManagedCertificateDomainControlValidation", "ManagedServiceIdentityType", - "PatchApplyStatus", - "PatchType", - "PatchingMode", - "PoolManagementType", - "PrivateEndpointConnectionProvisioningState", - "PrivateEndpointServiceConnectionStatus", - "PublicNetworkAccess", "RevisionHealthState", "RevisionProvisioningState", "RevisionRunningState", "Scheme", - "SessionNetworkStatus", - "SessionPoolProvisioningState", "SourceControlOperationState", "StorageType", "TriggerType", "Type", "UnauthenticatedClientActionV2", - "WorkflowHealthState", - "WorkflowState", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py index 5466c525adcb..694a6932ba5d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_container_apps_api_client_enums.py @@ -71,38 +71,6 @@ class BindingType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SNI_ENABLED = "SniEnabled" -class BuilderProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Resource instance provisioning state.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - - -class BuildProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Resource instance provisioning state.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - - -class BuildStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the build once it has been provisioned.""" - - NOT_STARTED = "NotStarted" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - FAILED = "Failed" - - class CertificateProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the certificate.""" @@ -113,15 +81,6 @@ class CertificateProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta) PENDING = "Pending" -class CertificateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the certificate. Allowed values are ``ServerSSLCertificate`` and - ``ImagePullTrustedCA``. - """ - - SERVER_SSL_CERTIFICATE = "ServerSSLCertificate" - IMAGE_PULL_TRUSTED_CA = "ImagePullTrustedCA" - - class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The reason why the given name is not available.""" @@ -168,13 +127,6 @@ class ContainerAppReplicaRunningState(str, Enum, metaclass=CaseInsensitiveEnumMe UNKNOWN = "Unknown" -class ContainerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The container type of the sessions.""" - - CUSTOM_CONTAINER = "CustomContainer" - PYTHON_LTS = "PythonLTS" - - class CookieExpirationConvention(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The convention used when determining the session cookie's expiration.""" @@ -191,14 +143,6 @@ class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): KEY = "Key" -class DetectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of the patch detection.""" - - SUCCEEDED = "Succeeded" - REGISTRY_LOGIN_FAILED = "RegistryLoginFailed" - FAILED = "Failed" - - class DnsVerificationTestResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): """DNS verification test result.""" @@ -207,22 +151,6 @@ class DnsVerificationTestResult(str, Enum, metaclass=CaseInsensitiveEnumMeta): SKIPPED = "Skipped" -class DotNetComponentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of the .NET Component.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - DELETING = "Deleting" - IN_PROGRESS = "InProgress" - - -class DotNetComponentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the .NET Component.""" - - ASPIRE_DASHBOARD = "AspireDashboard" - - class EnvironmentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Provisioning state of the Environment.""" @@ -238,12 +166,6 @@ class EnvironmentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta) UPGRADE_FAILED = "UpgradeFailed" -class ExecutionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The execution type of the session pool.""" - - TIMED = "Timed" - - class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of extendedLocation.""" @@ -258,26 +180,6 @@ class ForwardProxyConvention(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM = "Custom" -class IdentitySettingsLifeCycle(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Use to select the lifecycle stages of a Container App during which the Managed Identity should - be available. - """ - - INIT = "Init" - MAIN = "Main" - NONE = "None" - ALL = "All" - - -class ImageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of the image. Set to CloudBuild to let the system manages the image, where user will - not be able to update image through image field. Set to ContainerImage for user provided image. - """ - - CLOUD_BUILD = "CloudBuild" - CONTAINER_IMAGE = "ContainerImage" - - class IngressClientCertificateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Client certificate mode for mTLS authentication. Ignore indicates server drops client certificate on forwarding. Accept indicates server forwards client certificate but does not @@ -289,13 +191,6 @@ class IngressClientCertificateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta) REQUIRE = "require" -class IngressTargetPortHttpScheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Whether an http app listens on http or https.""" - - HTTP = "http" - HTTPS = "https" - - class IngressTransportMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Ingress transport protocol.""" @@ -305,26 +200,6 @@ class IngressTransportMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): TCP = "tcp" -class JavaComponentProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of the Java Component.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - DELETING = "Deleting" - IN_PROGRESS = "InProgress" - - -class JavaComponentType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the Java Component.""" - - SPRING_BOOT_ADMIN = "SpringBootAdmin" - SPRING_CLOUD_EUREKA = "SpringCloudEureka" - SPRING_CLOUD_CONFIG = "SpringCloudConfig" - SPRING_CLOUD_GATEWAY = "SpringCloudGateway" - NACOS = "Nacos" - - class JobExecutionRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Current running State of the job.""" @@ -347,41 +222,6 @@ class JobProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETING = "Deleting" -class JobRunningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Current running state of the job.""" - - READY = "Ready" - PROGRESSING = "Progressing" - SUSPENDED = "Suspended" - - -class Kind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Metadata used to render different experiences for resources of the same type; e.g. WorkflowApp - is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider must - validate and persist this value. - """ - - WORKFLOWAPP = "workflowapp" - - -class Level(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The specified logger's log level.""" - - OFF = "off" - ERROR = "error" - INFO = "info" - DEBUG = "debug" - TRACE = "trace" - WARN = "warn" - - -class LogicAppsProxyMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """LogicAppsProxyMethod.""" - - GET = "GET" - POST = "POST" - - class LogLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Sets the log level for the Dapr sidecar. Allowed values are debug, info, warn, error. Default is info. @@ -412,76 +252,6 @@ class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" -class PatchApplyStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The status of the patch once it has been provisioned.""" - - NOT_STARTED = "NotStarted" - REBASE_IN_PROGRESS = "RebaseInProgress" - CREATING_REVISION = "CreatingRevision" - SUCCEEDED = "Succeeded" - CANCELED = "Canceled" - REBASE_FAILED = "RebaseFailed" - REVISION_CREATION_FAILED = "RevisionCreationFailed" - IMAGE_PUSH_PULL_FAILED = "ImagePushPullFailed" - MANUALLY_SKIPPED = "ManuallySkipped" - - -class PatchingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Patching mode for the container app. Null or default in this field will be interpreted as - Automatic by RP. Automatic mode will automatically apply available patches. Manual mode will - require the user to manually apply patches. Disabled mode will stop patch detection and auto - patching. - """ - - AUTOMATIC = "Automatic" - MANUAL = "Manual" - DISABLED = "Disabled" - - -class PatchType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type for the patch.""" - - FRAMEWORK_SECURITY = "FrameworkSecurity" - OS_SECURITY = "OSSecurity" - FRAMEWORK_AND_OS_SECURITY = "FrameworkAndOSSecurity" - OTHER = "Other" - - -class PoolManagementType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The pool management type of the session pool.""" - - MANUAL = "Manual" - DYNAMIC = "Dynamic" - - -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state.""" - - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - WAITING = "Waiting" - UPDATING = "Updating" - DELETING = "Deleting" - PENDING = "Pending" - - -class PrivateEndpointServiceConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private endpoint connection status.""" - - PENDING = "Pending" - APPROVED = "Approved" - REJECTED = "Rejected" - DISCONNECTED = "Disconnected" - - -class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Property to allow or block all public traffic. Allowed Values: 'Enabled', 'Disabled'.""" - - ENABLED = "Enabled" - DISABLED = "Disabled" - - class RevisionHealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Current health State of the revision.""" @@ -518,23 +288,6 @@ class Scheme(str, Enum, metaclass=CaseInsensitiveEnumMeta): HTTPS = "HTTPS" -class SessionNetworkStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Network status for the sessions.""" - - EGRESS_ENABLED = "EgressEnabled" - EGRESS_DISABLED = "EgressDisabled" - - -class SessionPoolProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of the session pool.""" - - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - DELETING = "Deleting" - - class SourceControlOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Current provisioning State of the operation.""" @@ -550,8 +303,6 @@ class StorageType(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_FILE = "AzureFile" EMPTY_DIR = "EmptyDir" SECRET = "Secret" - NFS_AZURE_FILE = "NfsAzureFile" - SMB = "Smb" class TriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -577,23 +328,3 @@ class UnauthenticatedClientActionV2(str, Enum, metaclass=CaseInsensitiveEnumMeta ALLOW_ANONYMOUS = "AllowAnonymous" RETURN401 = "Return401" RETURN403 = "Return403" - - -class WorkflowHealthState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Gets or sets the workflow health state.""" - - NOT_SPECIFIED = "NotSpecified" - HEALTHY = "Healthy" - UNHEALTHY = "Unhealthy" - UNKNOWN = "Unknown" - - -class WorkflowState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The workflow state.""" - - NOT_SPECIFIED = "NotSpecified" - COMPLETED = "Completed" - ENABLED = "Enabled" - DISABLED = "Disabled" - DELETED = "Deleted" - SUSPENDED = "Suspended" diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py index fae7ddf612a3..21cc10357151 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/models/_models_py3.py @@ -1,5 +1,5 @@ -# coding=utf-8 # pylint: disable=too-many-lines +# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -16,10 +16,9 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -74,26 +73,6 @@ def __init__( self.identities = identities -class AppInsightsConfiguration(_serialization.Model): - """Configuration of Application Insights. - - :ivar connection_string: Application Insights connection string. - :vartype connection_string: str - """ - - _attribute_map = { - "connection_string": {"key": "connectionString", "type": "str"}, - } - - def __init__(self, *, connection_string: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword connection_string: Application Insights connection string. - :paramtype connection_string: str - """ - super().__init__(**kwargs) - self.connection_string = connection_string - - class Apple(_serialization.Model): """The configuration settings of the Apple provider. @@ -233,8 +212,8 @@ class Resource(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -275,27 +254,8 @@ class ProxyResource(Resource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - """ - - -class AppResiliency(ProxyResource): - """Configuration to setup App Resiliency. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -305,106 +265,8 @@ class AppResiliency(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar timeout_policy: Policy to set request timeouts. - :vartype timeout_policy: ~azure.mgmt.appcontainers.models.TimeoutPolicy - :ivar http_retry_policy: Policy that defines http request retry conditions. - :vartype http_retry_policy: ~azure.mgmt.appcontainers.models.HttpRetryPolicy - :ivar tcp_retry_policy: Policy that defines tcp request retry conditions. - :vartype tcp_retry_policy: ~azure.mgmt.appcontainers.models.TcpRetryPolicy - :ivar circuit_breaker_policy: Policy that defines circuit breaker conditions. - :vartype circuit_breaker_policy: ~azure.mgmt.appcontainers.models.CircuitBreakerPolicy - :ivar http_connection_pool: Defines parameters for http connection pooling. - :vartype http_connection_pool: ~azure.mgmt.appcontainers.models.HttpConnectionPool - :ivar tcp_connection_pool: Defines parameters for tcp connection pooling. - :vartype tcp_connection_pool: ~azure.mgmt.appcontainers.models.TcpConnectionPool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "timeout_policy": {"key": "properties.timeoutPolicy", "type": "TimeoutPolicy"}, - "http_retry_policy": {"key": "properties.httpRetryPolicy", "type": "HttpRetryPolicy"}, - "tcp_retry_policy": {"key": "properties.tcpRetryPolicy", "type": "TcpRetryPolicy"}, - "circuit_breaker_policy": {"key": "properties.circuitBreakerPolicy", "type": "CircuitBreakerPolicy"}, - "http_connection_pool": {"key": "properties.httpConnectionPool", "type": "HttpConnectionPool"}, - "tcp_connection_pool": {"key": "properties.tcpConnectionPool", "type": "TcpConnectionPool"}, - } - - def __init__( - self, - *, - timeout_policy: Optional["_models.TimeoutPolicy"] = None, - http_retry_policy: Optional["_models.HttpRetryPolicy"] = None, - tcp_retry_policy: Optional["_models.TcpRetryPolicy"] = None, - circuit_breaker_policy: Optional["_models.CircuitBreakerPolicy"] = None, - http_connection_pool: Optional["_models.HttpConnectionPool"] = None, - tcp_connection_pool: Optional["_models.TcpConnectionPool"] = None, - **kwargs: Any - ) -> None: - """ - :keyword timeout_policy: Policy to set request timeouts. - :paramtype timeout_policy: ~azure.mgmt.appcontainers.models.TimeoutPolicy - :keyword http_retry_policy: Policy that defines http request retry conditions. - :paramtype http_retry_policy: ~azure.mgmt.appcontainers.models.HttpRetryPolicy - :keyword tcp_retry_policy: Policy that defines tcp request retry conditions. - :paramtype tcp_retry_policy: ~azure.mgmt.appcontainers.models.TcpRetryPolicy - :keyword circuit_breaker_policy: Policy that defines circuit breaker conditions. - :paramtype circuit_breaker_policy: ~azure.mgmt.appcontainers.models.CircuitBreakerPolicy - :keyword http_connection_pool: Defines parameters for http connection pooling. - :paramtype http_connection_pool: ~azure.mgmt.appcontainers.models.HttpConnectionPool - :keyword tcp_connection_pool: Defines parameters for tcp connection pooling. - :paramtype tcp_connection_pool: ~azure.mgmt.appcontainers.models.TcpConnectionPool - """ - super().__init__(**kwargs) - self.timeout_policy = timeout_policy - self.http_retry_policy = http_retry_policy - self.tcp_retry_policy = tcp_retry_policy - self.circuit_breaker_policy = circuit_breaker_policy - self.http_connection_pool = http_connection_pool - self.tcp_connection_pool = tcp_connection_pool - - -class AppResiliencyCollection(_serialization.Model): - """Collection of AppResiliency policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.AppResiliency] - :ivar next_link: Link to next page of resources. - :vartype next_link: str """ - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AppResiliency]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.AppResiliency"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.AppResiliency] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - class AuthConfig(ProxyResource): """Configuration settings for the Azure ContainerApp Service Authentication / Authorization @@ -412,8 +274,8 @@ class AuthConfig(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -606,8 +468,8 @@ class AvailableWorkloadProfile(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1160,10 +1022,6 @@ class BaseContainer(_serialization.Model): :ivar image: Container image tag. :vartype image: str - :ivar image_type: The type of the image. Set to CloudBuild to let the system manages the image, - where user will not be able to update image through image field. Set to ContainerImage for user - provided image. Known values are: "CloudBuild" and "ContainerImage". - :vartype image_type: str or ~azure.mgmt.appcontainers.models.ImageType :ivar name: Custom container name. :vartype name: str :ivar command: Container start command. @@ -1180,7 +1038,6 @@ class BaseContainer(_serialization.Model): _attribute_map = { "image": {"key": "image", "type": "str"}, - "image_type": {"key": "imageType", "type": "str"}, "name": {"key": "name", "type": "str"}, "command": {"key": "command", "type": "[str]"}, "args": {"key": "args", "type": "[str]"}, @@ -1193,7 +1050,6 @@ def __init__( self, *, image: Optional[str] = None, - image_type: Optional[Union[str, "_models.ImageType"]] = None, name: Optional[str] = None, command: Optional[List[str]] = None, args: Optional[List[str]] = None, @@ -1205,10 +1061,6 @@ def __init__( """ :keyword image: Container image tag. :paramtype image: str - :keyword image_type: The type of the image. Set to CloudBuild to let the system manages the - image, where user will not be able to update image through image field. Set to ContainerImage - for user provided image. Known values are: "CloudBuild" and "ContainerImage". - :paramtype image_type: str or ~azure.mgmt.appcontainers.models.ImageType :keyword name: Custom container name. :paramtype name: str :keyword command: Container start command. @@ -1224,7 +1076,6 @@ def __init__( """ super().__init__(**kwargs) self.image = image - self.image_type = image_type self.name = name self.command = command self.args = args @@ -1233,7 +1084,7 @@ def __init__( self.volume_mounts = volume_mounts -class BillingMeter(_serialization.Model): +class BillingMeter(ProxyResource): """Billing meter. Variables are only populated by the server, and will be ignored when sending a request. @@ -1285,10 +1136,6 @@ def __init__( :paramtype properties: ~azure.mgmt.appcontainers.models.BillingMeterProperties """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None self.location = location self.properties = properties @@ -1386,127 +1233,6 @@ def __init__(self, *, sas_url_setting_name: str, **kwargs: Any) -> None: self.sas_url_setting_name = sas_url_setting_name -class BuildCollection(_serialization.Model): - """The response of a BuildResource list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The BuildResource items on this page. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.BuildResource] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[BuildResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.BuildResource"], next_link: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: The BuildResource items on this page. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.BuildResource] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class BuildConfiguration(_serialization.Model): - """Configuration of the build. - - :ivar base_os: Base OS used to build and run the app. - :vartype base_os: str - :ivar platform: Platform to be used to build and run the app. - :vartype platform: str - :ivar platform_version: Platform version to be used to build and run the app. - :vartype platform_version: str - :ivar environment_variables: List of environment variables to be passed to the build, secrets - should not be used in environment variable. - :vartype environment_variables: list[~azure.mgmt.appcontainers.models.EnvironmentVariable] - :ivar pre_build_steps: List of steps to perform before the build. - :vartype pre_build_steps: list[~azure.mgmt.appcontainers.models.PreBuildStep] - """ - - _attribute_map = { - "base_os": {"key": "baseOs", "type": "str"}, - "platform": {"key": "platform", "type": "str"}, - "platform_version": {"key": "platformVersion", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "[EnvironmentVariable]"}, - "pre_build_steps": {"key": "preBuildSteps", "type": "[PreBuildStep]"}, - } - - def __init__( - self, - *, - base_os: Optional[str] = None, - platform: Optional[str] = None, - platform_version: Optional[str] = None, - environment_variables: Optional[List["_models.EnvironmentVariable"]] = None, - pre_build_steps: Optional[List["_models.PreBuildStep"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword base_os: Base OS used to build and run the app. - :paramtype base_os: str - :keyword platform: Platform to be used to build and run the app. - :paramtype platform: str - :keyword platform_version: Platform version to be used to build and run the app. - :paramtype platform_version: str - :keyword environment_variables: List of environment variables to be passed to the build, - secrets should not be used in environment variable. - :paramtype environment_variables: list[~azure.mgmt.appcontainers.models.EnvironmentVariable] - :keyword pre_build_steps: List of steps to perform before the build. - :paramtype pre_build_steps: list[~azure.mgmt.appcontainers.models.PreBuildStep] - """ - super().__init__(**kwargs) - self.base_os = base_os - self.platform = platform - self.platform_version = platform_version - self.environment_variables = environment_variables - self.pre_build_steps = pre_build_steps - - -class BuilderCollection(_serialization.Model): - """The response of a BuilderResource list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The BuilderResource items on this page. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.BuilderResource] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[BuilderResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.BuilderResource"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The BuilderResource items on this page. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.BuilderResource] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - class TrackedResource(Resource): """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. @@ -1515,8 +1241,8 @@ class TrackedResource(Resource): All required parameters must be populated in order to send to server. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1561,15 +1287,15 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.location = location -class BuilderResource(TrackedResource): - """Information about the SourceToCloud builder resource. +class Certificate(TrackedResource): + """Certificate used for Custom Domain bindings of Container Apps in a Managed Environment. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -1583,17 +1309,8 @@ class BuilderResource(TrackedResource): :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :ivar provisioning_state: Provisioning state of a builder resource. Known values are: - "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.BuilderProvisioningState - :ivar environment_id: Resource ID of the container apps environment that the builder is - associated with. - :vartype environment_id: str - :ivar container_registries: List of mappings of container registries and the managed identity - used to connect to it. - :vartype container_registries: list[~azure.mgmt.appcontainers.models.ContainerRegistry] + :ivar properties: Certificate resource specific properties. + :vartype properties: ~azure.mgmt.appcontainers.models.CertificateProperties """ _validation = { @@ -1602,7 +1319,6 @@ class BuilderResource(TrackedResource): "type": {"readonly": True}, "system_data": {"readonly": True}, "location": {"required": True}, - "provisioning_state": {"readonly": True}, } _attribute_map = { @@ -1612,10 +1328,7 @@ class BuilderResource(TrackedResource): "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "environment_id": {"key": "properties.environmentId", "type": "str"}, - "container_registries": {"key": "properties.containerRegistries", "type": "[ContainerRegistry]"}, + "properties": {"key": "properties", "type": "CertificateProperties"}, } def __init__( @@ -1623,9 +1336,7 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - environment_id: Optional[str] = None, - container_registries: Optional[List["_models.ContainerRegistry"]] = None, + properties: Optional["_models.CertificateProperties"] = None, **kwargs: Any ) -> None: """ @@ -1633,329 +1344,68 @@ def __init__( :paramtype tags: dict[str, str] :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword identity: The managed service identities assigned to this resource. - :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :keyword environment_id: Resource ID of the container apps environment that the builder is - associated with. - :paramtype environment_id: str - :keyword container_registries: List of mappings of container registries and the managed - identity used to connect to it. - :paramtype container_registries: list[~azure.mgmt.appcontainers.models.ContainerRegistry] + :keyword properties: Certificate resource specific properties. + :paramtype properties: ~azure.mgmt.appcontainers.models.CertificateProperties """ super().__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.provisioning_state = None - self.environment_id = environment_id - self.container_registries = container_registries + self.properties = properties -class BuilderResourceUpdate(_serialization.Model): - """The type used for update operations of the BuilderResource. +class CertificateCollection(_serialization.Model): + """Collection of Certificates. - :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :ivar tags: Resource tags. + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.Certificate] + :ivar next_link: Link to next page of resources. + :vartype next_link: str + """ + + _validation = { + "value": {"required": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[Certificate]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: List["_models.Certificate"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.Certificate] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class CertificatePatch(_serialization.Model): + """A certificate to update. + + :ivar tags: Application-specific metadata in the form of key-value pairs. :vartype tags: dict[str, str] - :ivar environment_id: Resource ID of the container apps environment that the builder is - associated with. - :vartype environment_id: str """ _attribute_map = { - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "tags": {"key": "tags", "type": "{str}"}, - "environment_id": {"key": "properties.environmentId", "type": "str"}, } - def __init__( - self, - *, - identity: Optional["_models.ManagedServiceIdentity"] = None, - tags: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - :keyword identity: The managed service identities assigned to this resource. - :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :keyword tags: Resource tags. + :keyword tags: Application-specific metadata in the form of key-value pairs. :paramtype tags: dict[str, str] - :keyword environment_id: Resource ID of the container apps environment that the builder is - associated with. - :paramtype environment_id: str """ super().__init__(**kwargs) - self.identity = identity self.tags = tags - self.environment_id = environment_id -class BuildResource(ProxyResource): # pylint: disable=too-many-instance-attributes - """Information pertaining to an individual build. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar provisioning_state: Build provisioning state. Known values are: "Succeeded", "Failed", - "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.BuildProvisioningState - :ivar build_status: Status of the build once it has been provisioned. Known values are: - "NotStarted", "InProgress", "Succeeded", "Canceled", and "Failed". - :vartype build_status: str or ~azure.mgmt.appcontainers.models.BuildStatus - :ivar destination_container_registry: Container registry that the final image will be uploaded - to. - :vartype destination_container_registry: - ~azure.mgmt.appcontainers.models.ContainerRegistryWithCustomImage - :ivar configuration: Configuration of the build. - :vartype configuration: ~azure.mgmt.appcontainers.models.BuildConfiguration - :ivar upload_endpoint: Endpoint to which the source code should be uploaded. - :vartype upload_endpoint: str - :ivar log_stream_endpoint: Endpoint from which the build logs can be streamed. - :vartype log_stream_endpoint: str - :ivar token_endpoint: Endpoint to use to retrieve an authentication token for log streaming and - uploading source code. - :vartype token_endpoint: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "build_status": {"readonly": True}, - "upload_endpoint": {"readonly": True}, - "log_stream_endpoint": {"readonly": True}, - "token_endpoint": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "build_status": {"key": "properties.buildStatus", "type": "str"}, - "destination_container_registry": { - "key": "properties.destinationContainerRegistry", - "type": "ContainerRegistryWithCustomImage", - }, - "configuration": {"key": "properties.configuration", "type": "BuildConfiguration"}, - "upload_endpoint": {"key": "properties.uploadEndpoint", "type": "str"}, - "log_stream_endpoint": {"key": "properties.logStreamEndpoint", "type": "str"}, - "token_endpoint": {"key": "properties.tokenEndpoint", "type": "str"}, - } - - def __init__( - self, - *, - destination_container_registry: Optional["_models.ContainerRegistryWithCustomImage"] = None, - configuration: Optional["_models.BuildConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword destination_container_registry: Container registry that the final image will be - uploaded to. - :paramtype destination_container_registry: - ~azure.mgmt.appcontainers.models.ContainerRegistryWithCustomImage - :keyword configuration: Configuration of the build. - :paramtype configuration: ~azure.mgmt.appcontainers.models.BuildConfiguration - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.build_status = None - self.destination_container_registry = destination_container_registry - self.configuration = configuration - self.upload_endpoint = None - self.log_stream_endpoint = None - self.token_endpoint = None - - -class BuildToken(_serialization.Model): - """Build Auth Token. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar token: Authentication token. - :vartype token: str - :ivar expires: Token expiration date. - :vartype expires: ~datetime.datetime - """ - - _validation = { - "token": {"readonly": True}, - "expires": {"readonly": True}, - } - - _attribute_map = { - "token": {"key": "token", "type": "str"}, - "expires": {"key": "expires", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.token = None - self.expires = None - - -class Certificate(TrackedResource): - """Certificate used for Custom Domain bindings of Container Apps in a Managed Environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: Certificate resource specific properties. - :vartype properties: ~azure.mgmt.appcontainers.models.CertificateProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "CertificateProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.CertificateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: Certificate resource specific properties. - :paramtype properties: ~azure.mgmt.appcontainers.models.CertificateProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class CertificateCollection(_serialization.Model): - """Collection of Certificates. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.Certificate] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Certificate]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Certificate"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.Certificate] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class CertificateKeyVaultProperties(_serialization.Model): - """Properties for a certificate stored in a Key Vault. - - :ivar identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or - System to use a system-assigned identity. - :vartype identity: str - :ivar key_vault_url: URL pointing to the Azure Key Vault secret that holds the certificate. - :vartype key_vault_url: str - """ - - _attribute_map = { - "identity": {"key": "identity", "type": "str"}, - "key_vault_url": {"key": "keyVaultUrl", "type": "str"}, - } - - def __init__(self, *, identity: Optional[str] = None, key_vault_url: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or - System to use a system-assigned identity. - :paramtype identity: str - :keyword key_vault_url: URL pointing to the Azure Key Vault secret that holds the certificate. - :paramtype key_vault_url: str - """ - super().__init__(**kwargs) - self.identity = identity - self.key_vault_url = key_vault_url - - -class CertificatePatch(_serialization.Model): - """A certificate to update. - - :ivar tags: Application-specific metadata in the form of key-value pairs. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Application-specific metadata in the form of key-value pairs. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class CertificateProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Certificate resource specific properties. +class CertificateProperties(_serialization.Model): + """Certificate resource specific properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -1963,9 +1413,6 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i "Failed", "Canceled", "DeleteFailed", and "Pending". :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.CertificateProvisioningState - :ivar certificate_key_vault_properties: Properties for a certificate stored in a Key Vault. - :vartype certificate_key_vault_properties: - ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties :ivar password: Certificate password. :vartype password: str :ivar subject_name: Subject name of the certificate. @@ -1986,10 +1433,6 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i :vartype valid: bool :ivar public_key_hash: Public key hash. :vartype public_key_hash: str - :ivar certificate_type: The type of the certificate. Allowed values are - ``ServerSSLCertificate`` and ``ImagePullTrustedCA``. Known values are: "ServerSSLCertificate" - and "ImagePullTrustedCA". - :vartype certificate_type: str or ~azure.mgmt.appcontainers.models.CertificateType """ _validation = { @@ -2006,10 +1449,6 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i _attribute_map = { "provisioning_state": {"key": "provisioningState", "type": "str"}, - "certificate_key_vault_properties": { - "key": "certificateKeyVaultProperties", - "type": "CertificateKeyVaultProperties", - }, "password": {"key": "password", "type": "str"}, "subject_name": {"key": "subjectName", "type": "str"}, "subject_alternative_names": {"key": "subjectAlternativeNames", "type": "[str]"}, @@ -2020,34 +1459,17 @@ class CertificateProperties(_serialization.Model): # pylint: disable=too-many-i "thumbprint": {"key": "thumbprint", "type": "str"}, "valid": {"key": "valid", "type": "bool"}, "public_key_hash": {"key": "publicKeyHash", "type": "str"}, - "certificate_type": {"key": "certificateType", "type": "str"}, } - def __init__( - self, - *, - certificate_key_vault_properties: Optional["_models.CertificateKeyVaultProperties"] = None, - password: Optional[str] = None, - value: Optional[bytes] = None, - certificate_type: Optional[Union[str, "_models.CertificateType"]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, password: Optional[str] = None, value: Optional[bytes] = None, **kwargs: Any) -> None: """ - :keyword certificate_key_vault_properties: Properties for a certificate stored in a Key Vault. - :paramtype certificate_key_vault_properties: - ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties :keyword password: Certificate password. :paramtype password: str :keyword value: PFX or PEM blob. :paramtype value: bytes - :keyword certificate_type: The type of the certificate. Allowed values are - ``ServerSSLCertificate`` and ``ImagePullTrustedCA``. Known values are: "ServerSSLCertificate" - and "ImagePullTrustedCA". - :paramtype certificate_type: str or ~azure.mgmt.appcontainers.models.CertificateType """ super().__init__(**kwargs) self.provisioning_state = None - self.certificate_key_vault_properties = certificate_key_vault_properties self.password = password self.subject_name = None self.subject_alternative_names = None @@ -2058,7 +1480,6 @@ def __init__( self.thumbprint = None self.valid = None self.public_key_hash = None - self.certificate_type = certificate_type class CheckNameAvailabilityRequest(_serialization.Model): @@ -2128,51 +1549,6 @@ def __init__( self.message = message -class CircuitBreakerPolicy(_serialization.Model): - """Policy that defines circuit breaker conditions. - - :ivar consecutive_errors: Number of consecutive errors before the circuit breaker opens. - :vartype consecutive_errors: int - :ivar interval_in_seconds: The time interval, in seconds, between endpoint checks. This can - result in opening the circuit breaker if the check fails as well as closing the circuit breaker - if the check succeeds. Defaults to 10s. - :vartype interval_in_seconds: int - :ivar max_ejection_percent: Maximum percentage of hosts that will be ejected after failure - threshold has been met. - :vartype max_ejection_percent: int - """ - - _attribute_map = { - "consecutive_errors": {"key": "consecutiveErrors", "type": "int"}, - "interval_in_seconds": {"key": "intervalInSeconds", "type": "int"}, - "max_ejection_percent": {"key": "maxEjectionPercent", "type": "int"}, - } - - def __init__( - self, - *, - consecutive_errors: Optional[int] = None, - interval_in_seconds: Optional[int] = None, - max_ejection_percent: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword consecutive_errors: Number of consecutive errors before the circuit breaker opens. - :paramtype consecutive_errors: int - :keyword interval_in_seconds: The time interval, in seconds, between endpoint checks. This can - result in opening the circuit breaker if the check fails as well as closing the circuit breaker - if the check succeeds. Defaults to 10s. - :paramtype interval_in_seconds: int - :keyword max_ejection_percent: Maximum percentage of hosts that will be ejected after failure - threshold has been met. - :paramtype max_ejection_percent: int - """ - super().__init__(**kwargs) - self.consecutive_errors = consecutive_errors - self.interval_in_seconds = interval_in_seconds - self.max_ejection_percent = max_ejection_percent - - class ClientRegistration(_serialization.Model): """The configuration settings of the app registration for providers that have client ids and client secrets. @@ -2225,15 +1601,10 @@ class Configuration(_serialization.Model): :vartype registries: list[~azure.mgmt.appcontainers.models.RegistryCredentials] :ivar dapr: Dapr configuration for the Container App. :vartype dapr: ~azure.mgmt.appcontainers.models.Dapr - :ivar runtime: App runtime configuration for the Container App. - :vartype runtime: ~azure.mgmt.appcontainers.models.Runtime :ivar max_inactive_revisions: Optional. Max inactive revisions a Container App can have. :vartype max_inactive_revisions: int :ivar service: Container App to be a dev Container App Service. :vartype service: ~azure.mgmt.appcontainers.models.Service - :ivar identity_settings: Optional settings for Managed Identities that are assigned to the - Container App. If a Managed Identity is not specified here, default settings will be used. - :vartype identity_settings: list[~azure.mgmt.appcontainers.models.IdentitySettings] """ _attribute_map = { @@ -2242,10 +1613,8 @@ class Configuration(_serialization.Model): "ingress": {"key": "ingress", "type": "Ingress"}, "registries": {"key": "registries", "type": "[RegistryCredentials]"}, "dapr": {"key": "dapr", "type": "Dapr"}, - "runtime": {"key": "runtime", "type": "Runtime"}, "max_inactive_revisions": {"key": "maxInactiveRevisions", "type": "int"}, "service": {"key": "service", "type": "Service"}, - "identity_settings": {"key": "identitySettings", "type": "[IdentitySettings]"}, } def __init__( @@ -2256,10 +1625,8 @@ def __init__( ingress: Optional["_models.Ingress"] = None, registries: Optional[List["_models.RegistryCredentials"]] = None, dapr: Optional["_models.Dapr"] = None, - runtime: Optional["_models.Runtime"] = None, max_inactive_revisions: Optional[int] = None, service: Optional["_models.Service"] = None, - identity_settings: Optional[List["_models.IdentitySettings"]] = None, **kwargs: Any ) -> None: """ @@ -2282,15 +1649,10 @@ def __init__( :paramtype registries: list[~azure.mgmt.appcontainers.models.RegistryCredentials] :keyword dapr: Dapr configuration for the Container App. :paramtype dapr: ~azure.mgmt.appcontainers.models.Dapr - :keyword runtime: App runtime configuration for the Container App. - :paramtype runtime: ~azure.mgmt.appcontainers.models.Runtime :keyword max_inactive_revisions: Optional. Max inactive revisions a Container App can have. :paramtype max_inactive_revisions: int :keyword service: Container App to be a dev Container App Service. :paramtype service: ~azure.mgmt.appcontainers.models.Service - :keyword identity_settings: Optional settings for Managed Identities that are assigned to the - Container App. If a Managed Identity is not specified here, default settings will be used. - :paramtype identity_settings: list[~azure.mgmt.appcontainers.models.IdentitySettings] """ super().__init__(**kwargs) self.secrets = secrets @@ -2298,21 +1660,19 @@ def __init__( self.ingress = ingress self.registries = registries self.dapr = dapr - self.runtime = runtime self.max_inactive_revisions = max_inactive_revisions self.service = service - self.identity_settings = identity_settings -class ConnectedEnvironment(TrackedResource): # pylint: disable=too-many-instance-attributes +class ConnectedEnvironment(TrackedResource): """An environment for Kubernetes cluster specialized for web workloads by Azure App Service. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2449,8 +1809,8 @@ class ConnectedEnvironmentStorage(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2495,31 +1855,19 @@ class ConnectedEnvironmentStorageProperties(_serialization.Model): :ivar azure_file: Azure file properties. :vartype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties - :ivar smb: SMB storage properties. - :vartype smb: ~azure.mgmt.appcontainers.models.SmbStorage """ _attribute_map = { "azure_file": {"key": "azureFile", "type": "AzureFileProperties"}, - "smb": {"key": "smb", "type": "SmbStorage"}, } - def __init__( - self, - *, - azure_file: Optional["_models.AzureFileProperties"] = None, - smb: Optional["_models.SmbStorage"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, azure_file: Optional["_models.AzureFileProperties"] = None, **kwargs: Any) -> None: """ :keyword azure_file: Azure file properties. :paramtype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties - :keyword smb: SMB storage properties. - :paramtype smb: ~azure.mgmt.appcontainers.models.SmbStorage """ super().__init__(**kwargs) self.azure_file = azure_file - self.smb = smb class ConnectedEnvironmentStoragesCollection(_serialization.Model): @@ -2553,10 +1901,6 @@ class Container(BaseContainer): :ivar image: Container image tag. :vartype image: str - :ivar image_type: The type of the image. Set to CloudBuild to let the system manages the image, - where user will not be able to update image through image field. Set to ContainerImage for user - provided image. Known values are: "CloudBuild" and "ContainerImage". - :vartype image_type: str or ~azure.mgmt.appcontainers.models.ImageType :ivar name: Custom container name. :vartype name: str :ivar command: Container start command. @@ -2575,7 +1919,6 @@ class Container(BaseContainer): _attribute_map = { "image": {"key": "image", "type": "str"}, - "image_type": {"key": "imageType", "type": "str"}, "name": {"key": "name", "type": "str"}, "command": {"key": "command", "type": "[str]"}, "args": {"key": "args", "type": "[str]"}, @@ -2589,7 +1932,6 @@ def __init__( self, *, image: Optional[str] = None, - image_type: Optional[Union[str, "_models.ImageType"]] = None, name: Optional[str] = None, command: Optional[List[str]] = None, args: Optional[List[str]] = None, @@ -2602,10 +1944,6 @@ def __init__( """ :keyword image: Container image tag. :paramtype image: str - :keyword image_type: The type of the image. Set to CloudBuild to let the system manages the - image, where user will not be able to update image through image field. Set to ContainerImage - for user provided image. Known values are: "CloudBuild" and "ContainerImage". - :paramtype image_type: str or ~azure.mgmt.appcontainers.models.ImageType :keyword name: Custom container name. :paramtype name: str :keyword command: Container start command. @@ -2623,7 +1961,6 @@ def __init__( """ super().__init__( image=image, - image_type=image_type, name=name, command=command, args=args, @@ -2635,15 +1972,15 @@ def __init__( self.probes = probes -class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attributes +class ContainerApp(TrackedResource): """Container App. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2667,25 +2004,16 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. :vartype managed_by: str - :ivar kind: Metadata used to render different experiences for resources of the same type; e.g. - WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource provider - must validate and persist this value. "workflowapp" - :vartype kind: str or ~azure.mgmt.appcontainers.models.Kind :ivar provisioning_state: Provisioning state of the Container App. Known values are: "InProgress", "Succeeded", "Failed", "Canceled", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.ContainerAppProvisioningState - :ivar deployment_errors: Any errors that occurred during deployment. - :vartype deployment_errors: str :ivar managed_environment_id: Deprecated. Resource ID of the Container App's environment. :vartype managed_environment_id: str :ivar environment_id: Resource ID of environment. :vartype environment_id: str :ivar workload_profile_name: Workload profile name to pin for container app execution. :vartype workload_profile_name: str - :ivar patching_configuration: Container App auto patch configuration. - :vartype patching_configuration: - ~azure.mgmt.appcontainers.models.ContainerAppPropertiesPatchingConfiguration :ivar latest_revision_name: Name of the latest revision of the Container App. :vartype latest_revision_name: str :ivar latest_ready_revision_name: Name of the latest ready revision of the Container App. @@ -2712,7 +2040,6 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib "system_data": {"readonly": True}, "location": {"required": True}, "provisioning_state": {"readonly": True}, - "deployment_errors": {"readonly": True}, "latest_revision_name": {"readonly": True}, "latest_ready_revision_name": {"readonly": True}, "latest_revision_fqdn": {"readonly": True}, @@ -2731,16 +2058,10 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "managed_by": {"key": "managedBy", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "deployment_errors": {"key": "properties.deploymentErrors", "type": "str"}, "managed_environment_id": {"key": "properties.managedEnvironmentId", "type": "str"}, "environment_id": {"key": "properties.environmentId", "type": "str"}, "workload_profile_name": {"key": "properties.workloadProfileName", "type": "str"}, - "patching_configuration": { - "key": "properties.patchingConfiguration", - "type": "ContainerAppPropertiesPatchingConfiguration", - }, "latest_revision_name": {"key": "properties.latestRevisionName", "type": "str"}, "latest_ready_revision_name": {"key": "properties.latestReadyRevisionName", "type": "str"}, "latest_revision_fqdn": {"key": "properties.latestRevisionFqdn", "type": "str"}, @@ -2751,7 +2072,7 @@ class ContainerApp(TrackedResource): # pylint: disable=too-many-instance-attrib "event_stream_endpoint": {"key": "properties.eventStreamEndpoint", "type": "str"}, } - def __init__( # pylint: disable=too-many-locals + def __init__( self, *, location: str, @@ -2759,11 +2080,9 @@ def __init__( # pylint: disable=too-many-locals extended_location: Optional["_models.ExtendedLocation"] = None, identity: Optional["_models.ManagedServiceIdentity"] = None, managed_by: Optional[str] = None, - kind: Optional[Union[str, "_models.Kind"]] = None, managed_environment_id: Optional[str] = None, environment_id: Optional[str] = None, workload_profile_name: Optional[str] = None, - patching_configuration: Optional["_models.ContainerAppPropertiesPatchingConfiguration"] = None, configuration: Optional["_models.Configuration"] = None, template: Optional["_models.Template"] = None, **kwargs: Any @@ -2783,19 +2102,12 @@ def __init__( # pylint: disable=too-many-locals complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. :paramtype managed_by: str - :keyword kind: Metadata used to render different experiences for resources of the same type; - e.g. WorkflowApp is a kind of Microsoft.App/ContainerApps type. If supported, the resource - provider must validate and persist this value. "workflowapp" - :paramtype kind: str or ~azure.mgmt.appcontainers.models.Kind :keyword managed_environment_id: Deprecated. Resource ID of the Container App's environment. :paramtype managed_environment_id: str :keyword environment_id: Resource ID of environment. :paramtype environment_id: str :keyword workload_profile_name: Workload profile name to pin for container app execution. :paramtype workload_profile_name: str - :keyword patching_configuration: Container App auto patch configuration. - :paramtype patching_configuration: - ~azure.mgmt.appcontainers.models.ContainerAppPropertiesPatchingConfiguration :keyword configuration: Non versioned Container App configuration properties. :paramtype configuration: ~azure.mgmt.appcontainers.models.Configuration :keyword template: Container App versioned application definition. @@ -2805,13 +2117,10 @@ def __init__( # pylint: disable=too-many-locals self.extended_location = extended_location self.identity = identity self.managed_by = managed_by - self.kind = kind self.provisioning_state = None - self.deployment_errors = None self.managed_environment_id = managed_environment_id self.environment_id = environment_id self.workload_profile_name = workload_profile_name - self.patching_configuration = patching_configuration self.latest_revision_name = None self.latest_ready_revision_name = None self.latest_revision_fqdn = None @@ -2829,8 +2138,8 @@ class ContainerAppAuthToken(TrackedResource): All required parameters must be populated in order to send to server. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3195,201 +2504,28 @@ def __init__(self, *, port: int, host: Optional[str] = None, **kwargs: Any) -> N self.port = port -class ContainerAppPropertiesPatchingConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Container App auto patch configuration. +class ContainerAppSecret(_serialization.Model): + """Container App Secret. + + Variables are only populated by the server, and will be ignored when sending a request. - :ivar patching_mode: Patching mode for the container app. Null or default in this field will be - interpreted as Automatic by RP. Automatic mode will automatically apply available patches. - Manual mode will require the user to manually apply patches. Disabled mode will stop patch - detection and auto patching. Known values are: "Automatic", "Manual", and "Disabled". - :vartype patching_mode: str or ~azure.mgmt.appcontainers.models.PatchingMode + :ivar name: Secret Name. + :vartype name: str + :ivar value: Secret Value. + :vartype value: str + :ivar identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or + System to use a system-assigned identity. + :vartype identity: str + :ivar key_vault_url: Azure Key Vault URL pointing to the secret referenced by the container + app. + :vartype key_vault_url: str """ - _attribute_map = { - "patching_mode": {"key": "patchingMode", "type": "str"}, - } - - def __init__(self, *, patching_mode: Optional[Union[str, "_models.PatchingMode"]] = None, **kwargs: Any) -> None: - """ - :keyword patching_mode: Patching mode for the container app. Null or default in this field will - be interpreted as Automatic by RP. Automatic mode will automatically apply available patches. - Manual mode will require the user to manually apply patches. Disabled mode will stop patch - detection and auto patching. Known values are: "Automatic", "Manual", and "Disabled". - :paramtype patching_mode: str or ~azure.mgmt.appcontainers.models.PatchingMode - """ - super().__init__(**kwargs) - self.patching_mode = patching_mode - - -class ContainerAppsBuildCollection(_serialization.Model): - """The response of a Container Apps Build Resource list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The Container Apps Build Resource items on this page. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.ContainerAppsBuildResource] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ContainerAppsBuildResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: List["_models.ContainerAppsBuildResource"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The Container Apps Build Resource items on this page. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.ContainerAppsBuildResource] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ContainerAppsBuildConfiguration(_serialization.Model): - """Configuration of the build. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar base_os: Base OS used to build and run the app. - :vartype base_os: str - :ivar platform: Platform to be used to build and run the app. - :vartype platform: str - :ivar platform_version: Platform version to be used to build and run the app. - :vartype platform_version: str - :ivar environment_variables: List of environment variables to be passed to the build, secrets - should not be used in environment variable. - :vartype environment_variables: list[~azure.mgmt.appcontainers.models.EnvironmentVariable] - :ivar pre_build_steps: List of steps to perform before the build. - :vartype pre_build_steps: list[~azure.mgmt.appcontainers.models.PreBuildStep] - """ - - _validation = { - "base_os": {"readonly": True}, - "platform": {"readonly": True}, - "platform_version": {"readonly": True}, - "environment_variables": {"readonly": True}, - "pre_build_steps": {"readonly": True}, - } - - _attribute_map = { - "base_os": {"key": "baseOs", "type": "str"}, - "platform": {"key": "platform", "type": "str"}, - "platform_version": {"key": "platformVersion", "type": "str"}, - "environment_variables": {"key": "environmentVariables", "type": "[EnvironmentVariable]"}, - "pre_build_steps": {"key": "preBuildSteps", "type": "[PreBuildStep]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.base_os = None - self.platform = None - self.platform_version = None - self.environment_variables = None - self.pre_build_steps = None - - -class ContainerAppsBuildResource(ProxyResource): - """Information pertaining to an individual build. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar provisioning_state: Build provisioning state. Known values are: "Succeeded", "Failed", - "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.BuildProvisioningState - :ivar build_status: Status of the build once it has been provisioned. Known values are: - "NotStarted", "InProgress", "Succeeded", "Canceled", and "Failed". - :vartype build_status: str or ~azure.mgmt.appcontainers.models.BuildStatus - :ivar destination_container_registry: Container registry that the final image will be uploaded - to. - :vartype destination_container_registry: - ~azure.mgmt.appcontainers.models.ContainerRegistryWithCustomImage - :ivar configuration: Configuration of the build. - :vartype configuration: ~azure.mgmt.appcontainers.models.ContainerAppsBuildConfiguration - :ivar log_stream_endpoint: Endpoint from which the build logs can be streamed. - :vartype log_stream_endpoint: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "build_status": {"readonly": True}, - "destination_container_registry": {"readonly": True}, - "configuration": {"readonly": True}, - "log_stream_endpoint": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "build_status": {"key": "properties.buildStatus", "type": "str"}, - "destination_container_registry": { - "key": "properties.destinationContainerRegistry", - "type": "ContainerRegistryWithCustomImage", - }, - "configuration": {"key": "properties.configuration", "type": "ContainerAppsBuildConfiguration"}, - "log_stream_endpoint": {"key": "properties.logStreamEndpoint", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provisioning_state = None - self.build_status = None - self.destination_container_registry = None - self.configuration = None - self.log_stream_endpoint = None - - -class ContainerAppSecret(_serialization.Model): - """Container App Secret. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Secret Name. - :vartype name: str - :ivar value: Secret Value. - :vartype value: str - :ivar identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or - System to use a system-assigned identity. - :vartype identity: str - :ivar key_vault_url: Azure Key Vault URL pointing to the secret referenced by the container - app. - :vartype key_vault_url: str - """ - - _validation = { - "name": {"readonly": True}, - "value": {"readonly": True}, - "identity": {"readonly": True}, - "key_vault_url": {"readonly": True}, + _validation = { + "name": {"readonly": True}, + "value": {"readonly": True}, + "identity": {"readonly": True}, + "key_vault_url": {"readonly": True}, } _attribute_map = { @@ -3408,165 +2544,6 @@ def __init__(self, **kwargs: Any) -> None: self.key_vault_url = None -class ContainerAppsPatchResource(ProxyResource): - """Container App Patch. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar properties: Properties that describes current states of the patch resource. - :vartype properties: ~azure.mgmt.appcontainers.models.PatchProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "PatchProperties"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.properties = None - - -class ContainerExecutionStatus(_serialization.Model): - """Container Apps Job execution container status. Contains status code and reason. - - :ivar name: Container Name. - :vartype name: str - :ivar code: Exit code. - :vartype code: int - :ivar additional_information: Additional information for the container status. - :vartype additional_information: str - :ivar status: Status of the container. - :vartype status: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "code": {"key": "code", "type": "int"}, - "additional_information": {"key": "additionalInformation", "type": "str"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - code: Optional[int] = None, - additional_information: Optional[str] = None, - status: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Container Name. - :paramtype name: str - :keyword code: Exit code. - :paramtype code: int - :keyword additional_information: Additional information for the container status. - :paramtype additional_information: str - :keyword status: Status of the container. - :paramtype status: str - """ - super().__init__(**kwargs) - self.name = name - self.code = code - self.additional_information = additional_information - self.status = status - - -class ContainerRegistry(_serialization.Model): - """Model representing a mapping from a container registry to the identity used to connect to it. - - All required parameters must be populated in order to send to server. - - :ivar container_registry_server: Login server of the container registry. Required. - :vartype container_registry_server: str - :ivar identity_resource_id: Resource ID of the managed identity. Required. - :vartype identity_resource_id: str - """ - - _validation = { - "container_registry_server": {"required": True}, - "identity_resource_id": {"required": True}, - } - - _attribute_map = { - "container_registry_server": {"key": "containerRegistryServer", "type": "str"}, - "identity_resource_id": {"key": "identityResourceId", "type": "str"}, - } - - def __init__(self, *, container_registry_server: str, identity_resource_id: str, **kwargs: Any) -> None: - """ - :keyword container_registry_server: Login server of the container registry. Required. - :paramtype container_registry_server: str - :keyword identity_resource_id: Resource ID of the managed identity. Required. - :paramtype identity_resource_id: str - """ - super().__init__(**kwargs) - self.container_registry_server = container_registry_server - self.identity_resource_id = identity_resource_id - - -class ContainerRegistryWithCustomImage(_serialization.Model): - """Container registry that the final image will be uploaded to. - - All required parameters must be populated in order to send to server. - - :ivar server: Login server of the container registry that the final image should be uploaded - to. Builder resource needs to have this container registry defined along with an identity to - use to access it. Required. - :vartype server: str - :ivar image: Full name that the final image should be uploaded as, including both image name - and tag. - :vartype image: str - """ - - _validation = { - "server": {"required": True}, - } - - _attribute_map = { - "server": {"key": "server", "type": "str"}, - "image": {"key": "image", "type": "str"}, - } - - def __init__(self, *, server: str, image: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword server: Login server of the container registry that the final image should be uploaded - to. Builder resource needs to have this container registry defined along with an identity to - use to access it. Required. - :paramtype server: str - :keyword image: Full name that the final image should be uploaded as, including both image name - and tag. - :paramtype image: str - """ - super().__init__(**kwargs) - self.server = server - self.image = image - - class ContainerResources(_serialization.Model): """Container App container resource requirements. @@ -3707,47 +2684,6 @@ def __init__( self.allow_credentials = allow_credentials -class CustomContainerTemplate(_serialization.Model): - """Custom container configuration. - - :ivar registry_credentials: Private container registry credentials for containers used by the - sessions of the session pool. - :vartype registry_credentials: ~azure.mgmt.appcontainers.models.SessionRegistryCredentials - :ivar containers: List of container definitions for the sessions of the session pool. - :vartype containers: list[~azure.mgmt.appcontainers.models.SessionContainer] - :ivar ingress: Session pool ingress configuration. - :vartype ingress: ~azure.mgmt.appcontainers.models.SessionIngress - """ - - _attribute_map = { - "registry_credentials": {"key": "registryCredentials", "type": "SessionRegistryCredentials"}, - "containers": {"key": "containers", "type": "[SessionContainer]"}, - "ingress": {"key": "ingress", "type": "SessionIngress"}, - } - - def __init__( - self, - *, - registry_credentials: Optional["_models.SessionRegistryCredentials"] = None, - containers: Optional[List["_models.SessionContainer"]] = None, - ingress: Optional["_models.SessionIngress"] = None, - **kwargs: Any - ) -> None: - """ - :keyword registry_credentials: Private container registry credentials for containers used by - the sessions of the session pool. - :paramtype registry_credentials: ~azure.mgmt.appcontainers.models.SessionRegistryCredentials - :keyword containers: List of container definitions for the sessions of the session pool. - :paramtype containers: list[~azure.mgmt.appcontainers.models.SessionContainer] - :keyword ingress: Session pool ingress configuration. - :paramtype ingress: ~azure.mgmt.appcontainers.models.SessionIngress - """ - super().__init__(**kwargs) - self.registry_credentials = registry_credentials - self.containers = containers - self.ingress = ingress - - class CustomDomain(_serialization.Model): """Custom Domain of a Container App. @@ -3805,9 +2741,6 @@ class CustomDomainConfiguration(_serialization.Model): :vartype custom_domain_verification_id: str :ivar dns_suffix: Dns suffix for the environment domain. :vartype dns_suffix: str - :ivar certificate_key_vault_properties: Certificate stored in Azure Key Vault. - :vartype certificate_key_vault_properties: - ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties :ivar certificate_value: PFX or PEM blob. :vartype certificate_value: bytes :ivar certificate_password: Certificate password. @@ -3830,10 +2763,6 @@ class CustomDomainConfiguration(_serialization.Model): _attribute_map = { "custom_domain_verification_id": {"key": "customDomainVerificationId", "type": "str"}, "dns_suffix": {"key": "dnsSuffix", "type": "str"}, - "certificate_key_vault_properties": { - "key": "certificateKeyVaultProperties", - "type": "CertificateKeyVaultProperties", - }, "certificate_value": {"key": "certificateValue", "type": "bytearray"}, "certificate_password": {"key": "certificatePassword", "type": "str"}, "expiration_date": {"key": "expirationDate", "type": "iso-8601"}, @@ -3845,7 +2774,6 @@ def __init__( self, *, dns_suffix: Optional[str] = None, - certificate_key_vault_properties: Optional["_models.CertificateKeyVaultProperties"] = None, certificate_value: Optional[bytes] = None, certificate_password: Optional[str] = None, **kwargs: Any @@ -3853,9 +2781,6 @@ def __init__( """ :keyword dns_suffix: Dns suffix for the environment domain. :paramtype dns_suffix: str - :keyword certificate_key_vault_properties: Certificate stored in Azure Key Vault. - :paramtype certificate_key_vault_properties: - ~azure.mgmt.appcontainers.models.CertificateKeyVaultProperties :keyword certificate_value: PFX or PEM blob. :paramtype certificate_value: bytes :keyword certificate_password: Certificate password. @@ -3864,7 +2789,6 @@ def __init__( super().__init__(**kwargs) self.custom_domain_verification_id = None self.dns_suffix = dns_suffix - self.certificate_key_vault_properties = certificate_key_vault_properties self.certificate_value = certificate_value self.certificate_password = certificate_password self.expiration_date = None @@ -3872,7 +2796,7 @@ def __init__( self.subject_name = None -class CustomHostnameAnalysisResult(_serialization.Model): # pylint: disable=too-many-instance-attributes +class CustomHostnameAnalysisResult(_serialization.Model): """Custom domain analysis. Variables are only populated by the server, and will be ignored when sending a request. @@ -4243,13 +3167,13 @@ def __init__( self.enable_api_logging = enable_api_logging -class DaprComponent(ProxyResource): # pylint: disable=too-many-instance-attributes +class DaprComponent(ProxyResource): """Dapr Component. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4275,10 +3199,6 @@ class DaprComponent(ProxyResource): # pylint: disable=too-many-instance-attribu :vartype metadata: list[~azure.mgmt.appcontainers.models.DaprMetadata] :ivar scopes: Names of container apps that can use this Dapr component. :vartype scopes: list[str] - :ivar service_component_bind: List of container app services that are bound to the Dapr - component. - :vartype service_component_bind: - list[~azure.mgmt.appcontainers.models.DaprComponentServiceBinding] """ _validation = { @@ -4301,7 +3221,6 @@ class DaprComponent(ProxyResource): # pylint: disable=too-many-instance-attribu "secret_store_component": {"key": "properties.secretStoreComponent", "type": "str"}, "metadata": {"key": "properties.metadata", "type": "[DaprMetadata]"}, "scopes": {"key": "properties.scopes", "type": "[str]"}, - "service_component_bind": {"key": "properties.serviceComponentBind", "type": "[DaprComponentServiceBinding]"}, } def __init__( @@ -4315,7 +3234,6 @@ def __init__( secret_store_component: Optional[str] = None, metadata: Optional[List["_models.DaprMetadata"]] = None, scopes: Optional[List[str]] = None, - service_component_bind: Optional[List["_models.DaprComponentServiceBinding"]] = None, **kwargs: Any ) -> None: """ @@ -4335,10 +3253,6 @@ def __init__( :paramtype metadata: list[~azure.mgmt.appcontainers.models.DaprMetadata] :keyword scopes: Names of container apps that can use this Dapr component. :paramtype scopes: list[str] - :keyword service_component_bind: List of container app services that are bound to the Dapr - component. - :paramtype service_component_bind: - list[~azure.mgmt.appcontainers.models.DaprComponentServiceBinding] """ super().__init__(**kwargs) self.component_type = component_type @@ -4349,18 +3263,17 @@ def __init__( self.secret_store_component = secret_store_component self.metadata = metadata self.scopes = scopes - self.service_component_bind = service_component_bind -class DaprComponentResiliencyPoliciesCollection(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policies ARM resource. +class DaprComponentsCollection(_serialization.Model): + """Dapr Components ARM resource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy] + :vartype value: list[~azure.mgmt.appcontainers.models.DaprComponent] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -4371,357 +3284,35 @@ class DaprComponentResiliencyPoliciesCollection(_serialization.Model): # pylint } _attribute_map = { - "value": {"key": "value", "type": "[DaprComponentResiliencyPolicy]"}, + "value": {"key": "value", "type": "[DaprComponent]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.DaprComponentResiliencyPolicy"], **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.DaprComponent"], **kwargs: Any) -> None: """ :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy] + :paramtype value: list[~azure.mgmt.appcontainers.models.DaprComponent] """ super().__init__(**kwargs) self.value = value self.next_link = None -class DaprComponentResiliencyPolicy(ProxyResource): - """Dapr Component Resiliency Policy. +class DaprConfiguration(_serialization.Model): + """Configuration properties Dapr component. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar inbound_policy: The optional inbound component resiliency policy configuration. - :vartype inbound_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyConfiguration - :ivar outbound_policy: The optional outbound component resiliency policy configuration. - :vartype outbound_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyConfiguration + :ivar version: The version of Dapr. + :vartype version: str """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, + "version": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "inbound_policy": {"key": "properties.inboundPolicy", "type": "DaprComponentResiliencyPolicyConfiguration"}, - "outbound_policy": {"key": "properties.outboundPolicy", "type": "DaprComponentResiliencyPolicyConfiguration"}, - } - - def __init__( - self, - *, - inbound_policy: Optional["_models.DaprComponentResiliencyPolicyConfiguration"] = None, - outbound_policy: Optional["_models.DaprComponentResiliencyPolicyConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword inbound_policy: The optional inbound component resiliency policy configuration. - :paramtype inbound_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyConfiguration - :keyword outbound_policy: The optional outbound component resiliency policy configuration. - :paramtype outbound_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyConfiguration - """ - super().__init__(**kwargs) - self.inbound_policy = inbound_policy - self.outbound_policy = outbound_policy - - -class DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration( - _serialization.Model -): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy Circuit Breaker Policy Configuration. - - :ivar consecutive_errors: The number of consecutive errors before the circuit is opened. - :vartype consecutive_errors: int - :ivar timeout_in_seconds: The interval in seconds until a retry attempt is made after the - circuit is opened. - :vartype timeout_in_seconds: int - :ivar interval_in_seconds: The optional interval in seconds after which the error count resets - to 0. An interval of 0 will never reset. If not specified, the timeoutInSeconds value will be - used. - :vartype interval_in_seconds: int - """ - - _attribute_map = { - "consecutive_errors": {"key": "consecutiveErrors", "type": "int"}, - "timeout_in_seconds": {"key": "timeoutInSeconds", "type": "int"}, - "interval_in_seconds": {"key": "intervalInSeconds", "type": "int"}, - } - - def __init__( - self, - *, - consecutive_errors: Optional[int] = None, - timeout_in_seconds: Optional[int] = None, - interval_in_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword consecutive_errors: The number of consecutive errors before the circuit is opened. - :paramtype consecutive_errors: int - :keyword timeout_in_seconds: The interval in seconds until a retry attempt is made after the - circuit is opened. - :paramtype timeout_in_seconds: int - :keyword interval_in_seconds: The optional interval in seconds after which the error count - resets to 0. An interval of 0 will never reset. If not specified, the timeoutInSeconds value - will be used. - :paramtype interval_in_seconds: int - """ - super().__init__(**kwargs) - self.consecutive_errors = consecutive_errors - self.timeout_in_seconds = timeout_in_seconds - self.interval_in_seconds = interval_in_seconds - - -class DaprComponentResiliencyPolicyConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy Configuration. - - :ivar http_retry_policy: The optional HTTP retry policy configuration. - :vartype http_retry_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration - :ivar timeout_policy: The optional timeout policy configuration. - :vartype timeout_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration - :ivar circuit_breaker_policy: The optional circuit breaker policy configuration. - :vartype circuit_breaker_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration - """ - - _attribute_map = { - "http_retry_policy": { - "key": "httpRetryPolicy", - "type": "DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration", - }, - "timeout_policy": {"key": "timeoutPolicy", "type": "DaprComponentResiliencyPolicyTimeoutPolicyConfiguration"}, - "circuit_breaker_policy": { - "key": "circuitBreakerPolicy", - "type": "DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration", - }, - } - - def __init__( - self, - *, - http_retry_policy: Optional["_models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration"] = None, - timeout_policy: Optional["_models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration"] = None, - circuit_breaker_policy: Optional[ - "_models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration" - ] = None, - **kwargs: Any - ) -> None: - """ - :keyword http_retry_policy: The optional HTTP retry policy configuration. - :paramtype http_retry_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration - :keyword timeout_policy: The optional timeout policy configuration. - :paramtype timeout_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyTimeoutPolicyConfiguration - :keyword circuit_breaker_policy: The optional circuit breaker policy configuration. - :paramtype circuit_breaker_policy: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyCircuitBreakerPolicyConfiguration - """ - super().__init__(**kwargs) - self.http_retry_policy = http_retry_policy - self.timeout_policy = timeout_policy - self.circuit_breaker_policy = circuit_breaker_policy - - -class DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy HTTP Retry Backoff Configuration. - - :ivar initial_delay_in_milliseconds: The optional initial delay in milliseconds before an - operation is retried. - :vartype initial_delay_in_milliseconds: int - :ivar max_interval_in_milliseconds: The optional maximum time interval in milliseconds between - retry attempts. - :vartype max_interval_in_milliseconds: int - """ - - _attribute_map = { - "initial_delay_in_milliseconds": {"key": "initialDelayInMilliseconds", "type": "int"}, - "max_interval_in_milliseconds": {"key": "maxIntervalInMilliseconds", "type": "int"}, - } - - def __init__( - self, - *, - initial_delay_in_milliseconds: Optional[int] = None, - max_interval_in_milliseconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword initial_delay_in_milliseconds: The optional initial delay in milliseconds before an - operation is retried. - :paramtype initial_delay_in_milliseconds: int - :keyword max_interval_in_milliseconds: The optional maximum time interval in milliseconds - between retry attempts. - :paramtype max_interval_in_milliseconds: int - """ - super().__init__(**kwargs) - self.initial_delay_in_milliseconds = initial_delay_in_milliseconds - self.max_interval_in_milliseconds = max_interval_in_milliseconds - - -class DaprComponentResiliencyPolicyHttpRetryPolicyConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy HTTP Retry Policy Configuration. - - :ivar max_retries: The optional maximum number of retries. - :vartype max_retries: int - :ivar retry_back_off: The optional retry backoff configuration. - :vartype retry_back_off: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration - """ - - _attribute_map = { - "max_retries": {"key": "maxRetries", "type": "int"}, - "retry_back_off": {"key": "retryBackOff", "type": "DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration"}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = None, - retry_back_off: Optional["_models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword max_retries: The optional maximum number of retries. - :paramtype max_retries: int - :keyword retry_back_off: The optional retry backoff configuration. - :paramtype retry_back_off: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicyHttpRetryBackOffConfiguration - """ - super().__init__(**kwargs) - self.max_retries = max_retries - self.retry_back_off = retry_back_off - - -class DaprComponentResiliencyPolicyTimeoutPolicyConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Dapr Component Resiliency Policy Timeout Policy Configuration. - - :ivar response_timeout_in_seconds: The optional response timeout in seconds. - :vartype response_timeout_in_seconds: int - """ - - _attribute_map = { - "response_timeout_in_seconds": {"key": "responseTimeoutInSeconds", "type": "int"}, - } - - def __init__(self, *, response_timeout_in_seconds: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword response_timeout_in_seconds: The optional response timeout in seconds. - :paramtype response_timeout_in_seconds: int - """ - super().__init__(**kwargs) - self.response_timeout_in_seconds = response_timeout_in_seconds - - -class DaprComponentsCollection(_serialization.Model): - """Dapr Components ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.DaprComponent] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DaprComponent]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DaprComponent"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.DaprComponent] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class DaprComponentServiceBinding(_serialization.Model): - """Configuration to bind a Dapr Component to a dev ContainerApp Service. - - :ivar name: Name of the service bind. - :vartype name: str - :ivar service_id: Resource id of the target service. - :vartype service_id: str - :ivar metadata: Service bind metadata. - :vartype metadata: ~azure.mgmt.appcontainers.models.DaprServiceBindMetadata - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "service_id": {"key": "serviceId", "type": "str"}, - "metadata": {"key": "metadata", "type": "DaprServiceBindMetadata"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - service_id: Optional[str] = None, - metadata: Optional["_models.DaprServiceBindMetadata"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the service bind. - :paramtype name: str - :keyword service_id: Resource id of the target service. - :paramtype service_id: str - :keyword metadata: Service bind metadata. - :paramtype metadata: ~azure.mgmt.appcontainers.models.DaprServiceBindMetadata - """ - super().__init__(**kwargs) - self.name = name - self.service_id = service_id - self.metadata = metadata - - -class DaprConfiguration(_serialization.Model): - """Configuration properties Dapr component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar version: The version of Dapr. - :vartype version: str - """ - - _validation = { - "version": {"readonly": True}, - } - - _attribute_map = { - "version": {"key": "version", "type": "str"}, + "version": {"key": "version", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: @@ -4825,352 +3416,69 @@ def __init__(self, *, value: List["_models.DaprSecret"], **kwargs: Any) -> None: self.value = value -class DaprServiceBindMetadata(_serialization.Model): - """Dapr component metadata. +class DefaultAuthorizationPolicy(_serialization.Model): + """The configuration settings of the Azure Active Directory default authorization policy. - :ivar name: Service bind metadata property name. - :vartype name: str - :ivar value: Service bind metadata property value. - :vartype value: str + :ivar allowed_principals: The configuration settings of the Azure Active Directory allowed + principals. + :vartype allowed_principals: ~azure.mgmt.appcontainers.models.AllowedPrincipals + :ivar allowed_applications: The configuration settings of the Azure Active Directory allowed + applications. + :vartype allowed_applications: list[str] """ _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, + "allowed_principals": {"key": "allowedPrincipals", "type": "AllowedPrincipals"}, + "allowed_applications": {"key": "allowedApplications", "type": "[str]"}, } - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + allowed_principals: Optional["_models.AllowedPrincipals"] = None, + allowed_applications: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ - :keyword name: Service bind metadata property name. - :paramtype name: str - :keyword value: Service bind metadata property value. - :paramtype value: str + :keyword allowed_principals: The configuration settings of the Azure Active Directory allowed + principals. + :paramtype allowed_principals: ~azure.mgmt.appcontainers.models.AllowedPrincipals + :keyword allowed_applications: The configuration settings of the Azure Active Directory allowed + applications. + :paramtype allowed_applications: list[str] """ super().__init__(**kwargs) - self.name = name - self.value = value + self.allowed_principals = allowed_principals + self.allowed_applications = allowed_applications -class DaprSubscription(ProxyResource): # pylint: disable=too-many-instance-attributes - """Dapr PubSub Event Subscription. +class DefaultErrorResponse(_serialization.Model): + """App Service error response. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar pubsub_name: Dapr PubSub component name. - :vartype pubsub_name: str - :ivar topic: Topic name. - :vartype topic: str - :ivar dead_letter_topic: Deadletter topic name. - :vartype dead_letter_topic: str - :ivar routes: Subscription routes. - :vartype routes: ~azure.mgmt.appcontainers.models.DaprSubscriptionRoutes - :ivar scopes: Application scopes to restrict the subscription to specific apps. - :vartype scopes: list[str] - :ivar metadata: Subscription metadata. - :vartype metadata: dict[str, str] - :ivar bulk_subscribe: Bulk subscription options. - :vartype bulk_subscribe: ~azure.mgmt.appcontainers.models.DaprSubscriptionBulkSubscribeOptions + :ivar error: Error model. + :vartype error: ~azure.mgmt.appcontainers.models.DefaultErrorResponseError """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, + "error": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "pubsub_name": {"key": "properties.pubsubName", "type": "str"}, - "topic": {"key": "properties.topic", "type": "str"}, - "dead_letter_topic": {"key": "properties.deadLetterTopic", "type": "str"}, - "routes": {"key": "properties.routes", "type": "DaprSubscriptionRoutes"}, - "scopes": {"key": "properties.scopes", "type": "[str]"}, - "metadata": {"key": "properties.metadata", "type": "{str}"}, - "bulk_subscribe": {"key": "properties.bulkSubscribe", "type": "DaprSubscriptionBulkSubscribeOptions"}, + "error": {"key": "error", "type": "DefaultErrorResponseError"}, } - def __init__( - self, - *, - pubsub_name: Optional[str] = None, - topic: Optional[str] = None, - dead_letter_topic: Optional[str] = None, - routes: Optional["_models.DaprSubscriptionRoutes"] = None, - scopes: Optional[List[str]] = None, - metadata: Optional[Dict[str, str]] = None, - bulk_subscribe: Optional["_models.DaprSubscriptionBulkSubscribeOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword pubsub_name: Dapr PubSub component name. - :paramtype pubsub_name: str - :keyword topic: Topic name. - :paramtype topic: str - :keyword dead_letter_topic: Deadletter topic name. - :paramtype dead_letter_topic: str - :keyword routes: Subscription routes. - :paramtype routes: ~azure.mgmt.appcontainers.models.DaprSubscriptionRoutes - :keyword scopes: Application scopes to restrict the subscription to specific apps. - :paramtype scopes: list[str] - :keyword metadata: Subscription metadata. - :paramtype metadata: dict[str, str] - :keyword bulk_subscribe: Bulk subscription options. - :paramtype bulk_subscribe: - ~azure.mgmt.appcontainers.models.DaprSubscriptionBulkSubscribeOptions - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.pubsub_name = pubsub_name - self.topic = topic - self.dead_letter_topic = dead_letter_topic - self.routes = routes - self.scopes = scopes - self.metadata = metadata - self.bulk_subscribe = bulk_subscribe - + self.error = None -class DaprSubscriptionBulkSubscribeOptions(_serialization.Model): - """Dapr PubSub Bulk Subscription Options. - :ivar enabled: Enable bulk subscription. - :vartype enabled: bool - :ivar max_messages_count: Maximum number of messages to deliver in a bulk message. - :vartype max_messages_count: int - :ivar max_await_duration_ms: Maximum duration in milliseconds to wait before a bulk message is - sent to the app. - :vartype max_await_duration_ms: int - """ +class DefaultErrorResponseError(_serialization.Model): + """Error model. - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "max_messages_count": {"key": "maxMessagesCount", "type": "int"}, - "max_await_duration_ms": {"key": "maxAwaitDurationMs", "type": "int"}, - } - - def __init__( - self, - *, - enabled: bool = False, - max_messages_count: Optional[int] = None, - max_await_duration_ms: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Enable bulk subscription. - :paramtype enabled: bool - :keyword max_messages_count: Maximum number of messages to deliver in a bulk message. - :paramtype max_messages_count: int - :keyword max_await_duration_ms: Maximum duration in milliseconds to wait before a bulk message - is sent to the app. - :paramtype max_await_duration_ms: int - """ - super().__init__(**kwargs) - self.enabled = enabled - self.max_messages_count = max_messages_count - self.max_await_duration_ms = max_await_duration_ms - - -class DaprSubscriptionRouteRule(_serialization.Model): - """Dapr Pubsub Event Subscription Route Rule is used to specify the condition for sending a - message to a specific path. - - :ivar match: The optional CEL expression used to match the event. If the match is not - specified, then the route is considered the default. The rules are tested in the order - specified, so they should be define from most-to-least specific. The default route should - appear last in the list. - :vartype match: str - :ivar path: The path for events that match this rule. - :vartype path: str - """ - - _attribute_map = { - "match": {"key": "match", "type": "str"}, - "path": {"key": "path", "type": "str"}, - } - - def __init__(self, *, match: Optional[str] = None, path: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword match: The optional CEL expression used to match the event. If the match is not - specified, then the route is considered the default. The rules are tested in the order - specified, so they should be define from most-to-least specific. The default route should - appear last in the list. - :paramtype match: str - :keyword path: The path for events that match this rule. - :paramtype path: str - """ - super().__init__(**kwargs) - self.match = match - self.path = path - - -class DaprSubscriptionRoutes(_serialization.Model): - """Dapr PubSub Event Subscription Routes configuration. - - :ivar rules: The list of Dapr PubSub Event Subscription Route Rules. - :vartype rules: list[~azure.mgmt.appcontainers.models.DaprSubscriptionRouteRule] - :ivar default: The default path to deliver events that do not match any of the rules. - :vartype default: str - """ - - _attribute_map = { - "rules": {"key": "rules", "type": "[DaprSubscriptionRouteRule]"}, - "default": {"key": "default", "type": "str"}, - } - - def __init__( - self, - *, - rules: Optional[List["_models.DaprSubscriptionRouteRule"]] = None, - default: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword rules: The list of Dapr PubSub Event Subscription Route Rules. - :paramtype rules: list[~azure.mgmt.appcontainers.models.DaprSubscriptionRouteRule] - :keyword default: The default path to deliver events that do not match any of the rules. - :paramtype default: str - """ - super().__init__(**kwargs) - self.rules = rules - self.default = default - - -class DaprSubscriptionsCollection(_serialization.Model): - """Dapr Subscriptions ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.DaprSubscription] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DaprSubscription]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DaprSubscription"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.DaprSubscription] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class DataDogConfiguration(_serialization.Model): - """Configuration of datadog. - - :ivar site: The data dog site. - :vartype site: str - :ivar key: The data dog api key. - :vartype key: str - """ - - _attribute_map = { - "site": {"key": "site", "type": "str"}, - "key": {"key": "key", "type": "str"}, - } - - def __init__(self, *, site: Optional[str] = None, key: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword site: The data dog site. - :paramtype site: str - :keyword key: The data dog api key. - :paramtype key: str - """ - super().__init__(**kwargs) - self.site = site - self.key = key - - -class DefaultAuthorizationPolicy(_serialization.Model): - """The configuration settings of the Azure Active Directory default authorization policy. - - :ivar allowed_principals: The configuration settings of the Azure Active Directory allowed - principals. - :vartype allowed_principals: ~azure.mgmt.appcontainers.models.AllowedPrincipals - :ivar allowed_applications: The configuration settings of the Azure Active Directory allowed - applications. - :vartype allowed_applications: list[str] - """ - - _attribute_map = { - "allowed_principals": {"key": "allowedPrincipals", "type": "AllowedPrincipals"}, - "allowed_applications": {"key": "allowedApplications", "type": "[str]"}, - } - - def __init__( - self, - *, - allowed_principals: Optional["_models.AllowedPrincipals"] = None, - allowed_applications: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword allowed_principals: The configuration settings of the Azure Active Directory allowed - principals. - :paramtype allowed_principals: ~azure.mgmt.appcontainers.models.AllowedPrincipals - :keyword allowed_applications: The configuration settings of the Azure Active Directory allowed - applications. - :paramtype allowed_applications: list[str] - """ - super().__init__(**kwargs) - self.allowed_principals = allowed_principals - self.allowed_applications = allowed_applications - - -class DefaultErrorResponse(_serialization.Model): - """App Service error response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: Error model. - :vartype error: ~azure.mgmt.appcontainers.models.DefaultErrorResponseError - """ - - _validation = { - "error": {"readonly": True}, - } - - _attribute_map = { - "error": {"key": "error", "type": "DefaultErrorResponseError"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.error = None - - -class DefaultErrorResponseError(_serialization.Model): - """Error model. - - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar code: Standardized string to programmatically identify the error. :vartype code: str @@ -5247,38 +3555,6 @@ def __init__(self, **kwargs: Any) -> None: self.target = None -class DestinationsConfiguration(_serialization.Model): - """Configuration of Open Telemetry destinations. - - :ivar data_dog_configuration: Open telemetry datadog destination configuration. - :vartype data_dog_configuration: ~azure.mgmt.appcontainers.models.DataDogConfiguration - :ivar otlp_configurations: Open telemetry otlp configurations. - :vartype otlp_configurations: list[~azure.mgmt.appcontainers.models.OtlpConfiguration] - """ - - _attribute_map = { - "data_dog_configuration": {"key": "dataDogConfiguration", "type": "DataDogConfiguration"}, - "otlp_configurations": {"key": "otlpConfigurations", "type": "[OtlpConfiguration]"}, - } - - def __init__( - self, - *, - data_dog_configuration: Optional["_models.DataDogConfiguration"] = None, - otlp_configurations: Optional[List["_models.OtlpConfiguration"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword data_dog_configuration: Open telemetry datadog destination configuration. - :paramtype data_dog_configuration: ~azure.mgmt.appcontainers.models.DataDogConfiguration - :keyword otlp_configurations: Open telemetry otlp configurations. - :paramtype otlp_configurations: list[~azure.mgmt.appcontainers.models.OtlpConfiguration] - """ - super().__init__(**kwargs) - self.data_dog_configuration = data_dog_configuration - self.otlp_configurations = otlp_configurations - - class DiagnosticDataProviderMetadata(_serialization.Model): """Details of a diagnostics data provider. @@ -5468,8 +3744,8 @@ class Diagnostics(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5746,13 +4022,52 @@ def __init__(self, **kwargs: Any) -> None: self.pes_id = None -class DotNetComponent(ProxyResource): - """.NET Component. +class EncryptionSettings(_serialization.Model): + """The configuration settings of the secrets references of encryption key and signing key for + ContainerApp Service Authentication/Authorization. + + :ivar container_app_auth_encryption_secret_name: The secret name which is referenced for + EncryptionKey. + :vartype container_app_auth_encryption_secret_name: str + :ivar container_app_auth_signing_secret_name: The secret name which is referenced for + SigningKey. + :vartype container_app_auth_signing_secret_name: str + """ + + _attribute_map = { + "container_app_auth_encryption_secret_name": {"key": "containerAppAuthEncryptionSecretName", "type": "str"}, + "container_app_auth_signing_secret_name": {"key": "containerAppAuthSigningSecretName", "type": "str"}, + } + + def __init__( + self, + *, + container_app_auth_encryption_secret_name: Optional[str] = None, + container_app_auth_signing_secret_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword container_app_auth_encryption_secret_name: The secret name which is referenced for + EncryptionKey. + :paramtype container_app_auth_encryption_secret_name: str + :keyword container_app_auth_signing_secret_name: The secret name which is referenced for + SigningKey. + :paramtype container_app_auth_signing_secret_name: str + """ + super().__init__(**kwargs) + self.container_app_auth_encryption_secret_name = container_app_auth_encryption_secret_name + self.container_app_auth_signing_secret_name = container_app_auth_signing_secret_name + + +class EnvironmentAuthToken(TrackedResource): + """Environment Auth Token. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5762,17 +4077,14 @@ class DotNetComponent(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar component_type: Type of the .NET Component. "AspireDashboard" - :vartype component_type: str or ~azure.mgmt.appcontainers.models.DotNetComponentType - :ivar provisioning_state: Provisioning state of the .NET Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.DotNetComponentProvisioningState - :ivar configurations: List of .NET Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.DotNetComponentConfigurationProperty] - :ivar service_binds: List of .NET Components that are bound to the .NET component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.DotNetComponentServiceBind] + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar token: Auth token value. + :vartype token: str + :ivar expires: Token expiration date. + :vartype expires: ~datetime.datetime """ _validation = { @@ -5780,7 +4092,9 @@ class DotNetComponent(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, + "location": {"required": True}, + "token": {"readonly": True}, + "expires": {"readonly": True}, } _attribute_map = { @@ -5788,267 +4102,40 @@ class DotNetComponent(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "component_type": {"key": "properties.componentType", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "configurations": {"key": "properties.configurations", "type": "[DotNetComponentConfigurationProperty]"}, - "service_binds": {"key": "properties.serviceBinds", "type": "[DotNetComponentServiceBind]"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "token": {"key": "properties.token", "type": "str"}, + "expires": {"key": "properties.expires", "type": "iso-8601"}, } - def __init__( - self, - *, - component_type: Optional[Union[str, "_models.DotNetComponentType"]] = None, - configurations: Optional[List["_models.DotNetComponentConfigurationProperty"]] = None, - service_binds: Optional[List["_models.DotNetComponentServiceBind"]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - :keyword component_type: Type of the .NET Component. "AspireDashboard" - :paramtype component_type: str or ~azure.mgmt.appcontainers.models.DotNetComponentType - :keyword configurations: List of .NET Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.DotNetComponentConfigurationProperty] - :keyword service_binds: List of .NET Components that are bound to the .NET component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.DotNetComponentServiceBind] + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str """ - super().__init__(**kwargs) - self.component_type = component_type - self.provisioning_state = None - self.configurations = configurations - self.service_binds = service_binds + super().__init__(tags=tags, location=location, **kwargs) + self.token = None + self.expires = None -class DotNetComponentConfigurationProperty(_serialization.Model): - """Configuration properties for a .NET Component. +class EnvironmentVar(_serialization.Model): + """Container App container environment variable. - :ivar property_name: The name of the property. - :vartype property_name: str - :ivar value: The value of the property. + :ivar name: Environment variable name. + :vartype name: str + :ivar value: Non-secret environment variable value. :vartype value: str + :ivar secret_ref: Name of the Container App secret from which to pull the environment variable + value. + :vartype secret_ref: str """ _attribute_map = { - "property_name": {"key": "propertyName", "type": "str"}, + "name": {"key": "name", "type": "str"}, "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, property_name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword property_name: The name of the property. - :paramtype property_name: str - :keyword value: The value of the property. - :paramtype value: str - """ - super().__init__(**kwargs) - self.property_name = property_name - self.value = value - - -class DotNetComponentsCollection(_serialization.Model): - """.NET Components ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.DotNetComponent] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DotNetComponent]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.DotNetComponent"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.DotNetComponent] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class DotNetComponentServiceBind(_serialization.Model): - """Configuration to bind a .NET Component to another .NET Component. - - :ivar name: Name of the service bind. - :vartype name: str - :ivar service_id: Resource id of the target service. - :vartype service_id: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "service_id": {"key": "serviceId", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, service_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Name of the service bind. - :paramtype name: str - :keyword service_id: Resource id of the target service. - :paramtype service_id: str - """ - super().__init__(**kwargs) - self.name = name - self.service_id = service_id - - -class DynamicPoolConfiguration(_serialization.Model): - """Dynamic pool configuration. - - :ivar execution_type: The execution type of the session pool. "Timed" - :vartype execution_type: str or ~azure.mgmt.appcontainers.models.ExecutionType - :ivar cooldown_period_in_seconds: The cooldown period of a session in seconds. - :vartype cooldown_period_in_seconds: int - """ - - _attribute_map = { - "execution_type": {"key": "executionType", "type": "str"}, - "cooldown_period_in_seconds": {"key": "cooldownPeriodInSeconds", "type": "int"}, - } - - def __init__( - self, - *, - execution_type: Optional[Union[str, "_models.ExecutionType"]] = None, - cooldown_period_in_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword execution_type: The execution type of the session pool. "Timed" - :paramtype execution_type: str or ~azure.mgmt.appcontainers.models.ExecutionType - :keyword cooldown_period_in_seconds: The cooldown period of a session in seconds. - :paramtype cooldown_period_in_seconds: int - """ - super().__init__(**kwargs) - self.execution_type = execution_type - self.cooldown_period_in_seconds = cooldown_period_in_seconds - - -class EncryptionSettings(_serialization.Model): - """The configuration settings of the secrets references of encryption key and signing key for - ContainerApp Service Authentication/Authorization. - - :ivar container_app_auth_encryption_secret_name: The secret name which is referenced for - EncryptionKey. - :vartype container_app_auth_encryption_secret_name: str - :ivar container_app_auth_signing_secret_name: The secret name which is referenced for - SigningKey. - :vartype container_app_auth_signing_secret_name: str - """ - - _attribute_map = { - "container_app_auth_encryption_secret_name": {"key": "containerAppAuthEncryptionSecretName", "type": "str"}, - "container_app_auth_signing_secret_name": {"key": "containerAppAuthSigningSecretName", "type": "str"}, - } - - def __init__( - self, - *, - container_app_auth_encryption_secret_name: Optional[str] = None, - container_app_auth_signing_secret_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword container_app_auth_encryption_secret_name: The secret name which is referenced for - EncryptionKey. - :paramtype container_app_auth_encryption_secret_name: str - :keyword container_app_auth_signing_secret_name: The secret name which is referenced for - SigningKey. - :paramtype container_app_auth_signing_secret_name: str - """ - super().__init__(**kwargs) - self.container_app_auth_encryption_secret_name = container_app_auth_encryption_secret_name - self.container_app_auth_signing_secret_name = container_app_auth_signing_secret_name - - -class EnvironmentAuthToken(TrackedResource): - """Environment Auth Token. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar token: Auth token value. - :vartype token: str - :ivar expires: Token expiration date. - :vartype expires: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "token": {"readonly": True}, - "expires": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "token": {"key": "properties.token", "type": "str"}, - "expires": {"key": "properties.expires", "type": "iso-8601"}, - } - - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(tags=tags, location=location, **kwargs) - self.token = None - self.expires = None - - -class EnvironmentVar(_serialization.Model): - """Container App container environment variable. - - :ivar name: Environment variable name. - :vartype name: str - :ivar value: Non-secret environment variable value. - :vartype value: str - :ivar secret_ref: Name of the Container App secret from which to pull the environment variable - value. - :vartype secret_ref: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - "secret_ref": {"key": "secretRef", "type": "str"}, + "secret_ref": {"key": "secretRef", "type": "str"}, } def __init__( @@ -6074,39 +4161,6 @@ def __init__( self.secret_ref = secret_ref -class EnvironmentVariable(_serialization.Model): - """Model representing an environment variable. - - All required parameters must be populated in order to send to server. - - :ivar name: Environment variable name. Required. - :vartype name: str - :ivar value: Environment variable value. Required. - :vartype value: str - """ - - _validation = { - "name": {"required": True}, - "value": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, name: str, value: str, **kwargs: Any) -> None: - """ - :keyword name: Environment variable name. Required. - :paramtype name: str - :keyword value: Environment variable value. Required. - :paramtype value: str - """ - super().__init__(**kwargs) - self.name = name - self.value = value - - class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. @@ -6178,80 +4232,6 @@ def __init__(self, **kwargs: Any) -> None: self.additional_info = None -class ErrorEntity(_serialization.Model): - """Body of the error response returned from the API. - - :ivar extended_code: Type of error. - :vartype extended_code: str - :ivar message_template: Message template. - :vartype message_template: str - :ivar parameters: Parameters for the template. - :vartype parameters: list[str] - :ivar inner_errors: Inner errors. - :vartype inner_errors: list[~azure.mgmt.appcontainers.models.ErrorEntity] - :ivar details: Error Details. - :vartype details: list[~azure.mgmt.appcontainers.models.ErrorEntity] - :ivar target: The error target. - :vartype target: str - :ivar code: Basic error code. - :vartype code: str - :ivar message: Any details of the error. - :vartype message: str - """ - - _attribute_map = { - "extended_code": {"key": "extendedCode", "type": "str"}, - "message_template": {"key": "messageTemplate", "type": "str"}, - "parameters": {"key": "parameters", "type": "[str]"}, - "inner_errors": {"key": "innerErrors", "type": "[ErrorEntity]"}, - "details": {"key": "details", "type": "[ErrorEntity]"}, - "target": {"key": "target", "type": "str"}, - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__( - self, - *, - extended_code: Optional[str] = None, - message_template: Optional[str] = None, - parameters: Optional[List[str]] = None, - inner_errors: Optional[List["_models.ErrorEntity"]] = None, - details: Optional[List["_models.ErrorEntity"]] = None, - target: Optional[str] = None, - code: Optional[str] = None, - message: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword extended_code: Type of error. - :paramtype extended_code: str - :keyword message_template: Message template. - :paramtype message_template: str - :keyword parameters: Parameters for the template. - :paramtype parameters: list[str] - :keyword inner_errors: Inner errors. - :paramtype inner_errors: list[~azure.mgmt.appcontainers.models.ErrorEntity] - :keyword details: Error Details. - :paramtype details: list[~azure.mgmt.appcontainers.models.ErrorEntity] - :keyword target: The error target. - :paramtype target: str - :keyword code: Basic error code. - :paramtype code: str - :keyword message: Any details of the error. - :paramtype message: str - """ - super().__init__(**kwargs) - self.extended_code = extended_code - self.message_template = message_template - self.parameters = parameters - self.inner_errors = inner_errors - self.details = details - self.target = target - self.code = code - self.message = message - - class ErrorResponse(_serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). @@ -6273,26 +4253,6 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A self.error = error -class ExecutionStatus(_serialization.Model): - """Container Apps Job execution status. - - :ivar replicas: Replicas in the execution. - :vartype replicas: list[~azure.mgmt.appcontainers.models.ReplicaExecutionStatus] - """ - - _attribute_map = { - "replicas": {"key": "replicas", "type": "[ReplicaExecutionStatus]"}, - } - - def __init__(self, *, replicas: Optional[List["_models.ReplicaExecutionStatus"]] = None, **kwargs: Any) -> None: - """ - :keyword replicas: Replicas in the execution. - :paramtype replicas: list[~azure.mgmt.appcontainers.models.ReplicaExecutionStatus] - """ - super().__init__(**kwargs) - self.replicas = replicas - - class ExtendedLocation(_serialization.Model): """The complex type of the extended location. @@ -6458,7 +4418,7 @@ def __init__( self.login = login -class GithubActionConfiguration(_serialization.Model): # pylint: disable=too-many-instance-attributes +class GithubActionConfiguration(_serialization.Model): """Configuration properties that define the mutable settings of a Container App SourceControl. :ivar registry_info: Registry configurations. @@ -6467,8 +4427,6 @@ class GithubActionConfiguration(_serialization.Model): # pylint: disable=too-ma :vartype azure_credentials: ~azure.mgmt.appcontainers.models.AzureCredentials :ivar context_path: Context path. :vartype context_path: str - :ivar dockerfile_path: Dockerfile path. - :vartype dockerfile_path: str :ivar github_personal_access_token: One time Github PAT to configure github environment. :vartype github_personal_access_token: str :ivar image: Image name. @@ -6481,23 +4439,18 @@ class GithubActionConfiguration(_serialization.Model): # pylint: disable=too-ma :vartype runtime_stack: str :ivar runtime_version: Runtime version. :vartype runtime_version: str - :ivar build_environment_variables: List of environment variables to be passed to the build. - :vartype build_environment_variables: - list[~azure.mgmt.appcontainers.models.EnvironmentVariable] """ _attribute_map = { "registry_info": {"key": "registryInfo", "type": "RegistryInfo"}, "azure_credentials": {"key": "azureCredentials", "type": "AzureCredentials"}, "context_path": {"key": "contextPath", "type": "str"}, - "dockerfile_path": {"key": "dockerfilePath", "type": "str"}, "github_personal_access_token": {"key": "githubPersonalAccessToken", "type": "str"}, "image": {"key": "image", "type": "str"}, "publish_type": {"key": "publishType", "type": "str"}, "os": {"key": "os", "type": "str"}, "runtime_stack": {"key": "runtimeStack", "type": "str"}, "runtime_version": {"key": "runtimeVersion", "type": "str"}, - "build_environment_variables": {"key": "buildEnvironmentVariables", "type": "[EnvironmentVariable]"}, } def __init__( @@ -6506,14 +4459,12 @@ def __init__( registry_info: Optional["_models.RegistryInfo"] = None, azure_credentials: Optional["_models.AzureCredentials"] = None, context_path: Optional[str] = None, - dockerfile_path: Optional[str] = None, github_personal_access_token: Optional[str] = None, image: Optional[str] = None, publish_type: Optional[str] = None, os: Optional[str] = None, runtime_stack: Optional[str] = None, runtime_version: Optional[str] = None, - build_environment_variables: Optional[List["_models.EnvironmentVariable"]] = None, **kwargs: Any ) -> None: """ @@ -6523,8 +4474,6 @@ def __init__( :paramtype azure_credentials: ~azure.mgmt.appcontainers.models.AzureCredentials :keyword context_path: Context path. :paramtype context_path: str - :keyword dockerfile_path: Dockerfile path. - :paramtype dockerfile_path: str :keyword github_personal_access_token: One time Github PAT to configure github environment. :paramtype github_personal_access_token: str :keyword image: Image name. @@ -6537,22 +4486,17 @@ def __init__( :paramtype runtime_stack: str :keyword runtime_version: Runtime version. :paramtype runtime_version: str - :keyword build_environment_variables: List of environment variables to be passed to the build. - :paramtype build_environment_variables: - list[~azure.mgmt.appcontainers.models.EnvironmentVariable] """ super().__init__(**kwargs) self.registry_info = registry_info self.azure_credentials = azure_credentials self.context_path = context_path - self.dockerfile_path = dockerfile_path self.github_personal_access_token = github_personal_access_token self.image = image self.publish_type = publish_type self.os = os self.runtime_stack = runtime_stack self.runtime_version = runtime_version - self.build_environment_variables = build_environment_variables class GlobalValidation(_serialization.Model): @@ -6662,228 +4606,16 @@ def __init__( self.validation = validation -class Header(_serialization.Model): - """Header of otlp configuration. +class HttpScaleRule(_serialization.Model): + """Container App container Http scaling rule. - :ivar key: The key of otlp configuration header. - :vartype key: str - :ivar value: The value of otlp configuration header. - :vartype value: str - """ - - _attribute_map = { - "key": {"key": "key", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, key: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword key: The key of otlp configuration header. - :paramtype key: str - :keyword value: The value of otlp configuration header. - :paramtype value: str - """ - super().__init__(**kwargs) - self.key = key - self.value = value - - -class HeaderMatch(_serialization.Model): - """Conditions required to match a header. - - :ivar header: Name of the header. - :vartype header: str - :ivar exact_match: Exact value of the header. - :vartype exact_match: str - :ivar prefix_match: Prefix value of the header. - :vartype prefix_match: str - :ivar suffix_match: Suffix value of the header. - :vartype suffix_match: str - :ivar regex_match: Regex value of the header. - :vartype regex_match: str - """ - - _attribute_map = { - "header": {"key": "header", "type": "str"}, - "exact_match": {"key": "match.exactMatch", "type": "str"}, - "prefix_match": {"key": "match.prefixMatch", "type": "str"}, - "suffix_match": {"key": "match.suffixMatch", "type": "str"}, - "regex_match": {"key": "match.regexMatch", "type": "str"}, - } - - def __init__( - self, - *, - header: Optional[str] = None, - exact_match: Optional[str] = None, - prefix_match: Optional[str] = None, - suffix_match: Optional[str] = None, - regex_match: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword header: Name of the header. - :paramtype header: str - :keyword exact_match: Exact value of the header. - :paramtype exact_match: str - :keyword prefix_match: Prefix value of the header. - :paramtype prefix_match: str - :keyword suffix_match: Suffix value of the header. - :paramtype suffix_match: str - :keyword regex_match: Regex value of the header. - :paramtype regex_match: str - """ - super().__init__(**kwargs) - self.header = header - self.exact_match = exact_match - self.prefix_match = prefix_match - self.suffix_match = suffix_match - self.regex_match = regex_match - - -class HttpConnectionPool(_serialization.Model): - """Defines parameters for http connection pooling. - - :ivar http1_max_pending_requests: Maximum number of pending http1 requests allowed. - :vartype http1_max_pending_requests: int - :ivar http2_max_requests: Maximum number of http2 requests allowed. - :vartype http2_max_requests: int - """ - - _attribute_map = { - "http1_max_pending_requests": {"key": "http1MaxPendingRequests", "type": "int"}, - "http2_max_requests": {"key": "http2MaxRequests", "type": "int"}, - } - - def __init__( - self, - *, - http1_max_pending_requests: Optional[int] = None, - http2_max_requests: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword http1_max_pending_requests: Maximum number of pending http1 requests allowed. - :paramtype http1_max_pending_requests: int - :keyword http2_max_requests: Maximum number of http2 requests allowed. - :paramtype http2_max_requests: int - """ - super().__init__(**kwargs) - self.http1_max_pending_requests = http1_max_pending_requests - self.http2_max_requests = http2_max_requests - - -class HttpGet(_serialization.Model): - """Model representing a http get request. - - All required parameters must be populated in order to send to server. - - :ivar url: URL to make HTTP GET request against. Required. - :vartype url: str - :ivar file_name: Name of the file that the request should be saved to. - :vartype file_name: str - :ivar headers: List of headers to send with the request. - :vartype headers: list[str] - """ - - _validation = { - "url": {"required": True}, - } - - _attribute_map = { - "url": {"key": "url", "type": "str"}, - "file_name": {"key": "fileName", "type": "str"}, - "headers": {"key": "headers", "type": "[str]"}, - } - - def __init__( - self, *, url: str, file_name: Optional[str] = None, headers: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword url: URL to make HTTP GET request against. Required. - :paramtype url: str - :keyword file_name: Name of the file that the request should be saved to. - :paramtype file_name: str - :keyword headers: List of headers to send with the request. - :paramtype headers: list[str] - """ - super().__init__(**kwargs) - self.url = url - self.file_name = file_name - self.headers = headers - - -class HttpRetryPolicy(_serialization.Model): - """Policy that defines http request retry conditions. - - :ivar max_retries: Maximum number of times a request will retry. - :vartype max_retries: int - :ivar headers: Headers that must be present for a request to be retried. - :vartype headers: list[~azure.mgmt.appcontainers.models.HeaderMatch] - :ivar http_status_codes: Additional http status codes that can trigger a retry. - :vartype http_status_codes: list[int] - :ivar errors: Errors that can trigger a retry. - :vartype errors: list[str] - :ivar initial_delay_in_milliseconds: Initial delay, in milliseconds, before retrying a request. - :vartype initial_delay_in_milliseconds: int - :ivar max_interval_in_milliseconds: Maximum interval, in milliseconds, between retries. - :vartype max_interval_in_milliseconds: int - """ - - _attribute_map = { - "max_retries": {"key": "maxRetries", "type": "int"}, - "headers": {"key": "matches.headers", "type": "[HeaderMatch]"}, - "http_status_codes": {"key": "matches.httpStatusCodes", "type": "[int]"}, - "errors": {"key": "matches.errors", "type": "[str]"}, - "initial_delay_in_milliseconds": {"key": "retryBackOff.initialDelayInMilliseconds", "type": "int"}, - "max_interval_in_milliseconds": {"key": "retryBackOff.maxIntervalInMilliseconds", "type": "int"}, - } - - def __init__( - self, - *, - max_retries: Optional[int] = None, - headers: Optional[List["_models.HeaderMatch"]] = None, - http_status_codes: Optional[List[int]] = None, - errors: Optional[List[str]] = None, - initial_delay_in_milliseconds: Optional[int] = None, - max_interval_in_milliseconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword max_retries: Maximum number of times a request will retry. - :paramtype max_retries: int - :keyword headers: Headers that must be present for a request to be retried. - :paramtype headers: list[~azure.mgmt.appcontainers.models.HeaderMatch] - :keyword http_status_codes: Additional http status codes that can trigger a retry. - :paramtype http_status_codes: list[int] - :keyword errors: Errors that can trigger a retry. - :paramtype errors: list[str] - :keyword initial_delay_in_milliseconds: Initial delay, in milliseconds, before retrying a - request. - :paramtype initial_delay_in_milliseconds: int - :keyword max_interval_in_milliseconds: Maximum interval, in milliseconds, between retries. - :paramtype max_interval_in_milliseconds: int - """ - super().__init__(**kwargs) - self.max_retries = max_retries - self.headers = headers - self.http_status_codes = http_status_codes - self.errors = errors - self.initial_delay_in_milliseconds = initial_delay_in_milliseconds - self.max_interval_in_milliseconds = max_interval_in_milliseconds - - -class HttpScaleRule(_serialization.Model): - """Container App container Http scaling rule. - - :ivar metadata: Metadata properties to describe http scale rule. - :vartype metadata: dict[str, str] - :ivar auth: Authentication secrets for the custom scale rule. - :vartype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] - :ivar identity: The resource ID of a user-assigned managed identity that is assigned to the - Container App, or 'system' for system-assigned identity. - :vartype identity: str + :ivar metadata: Metadata properties to describe http scale rule. + :vartype metadata: dict[str, str] + :ivar auth: Authentication secrets for the custom scale rule. + :vartype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] + :ivar identity: The resource ID of a user-assigned managed identity that is assigned to the + Container App, or 'system' for system-assigned identity. + :vartype identity: str """ _attribute_map = { @@ -7065,45 +4797,7 @@ def __init__( self.custom_open_id_connect_providers = custom_open_id_connect_providers -class IdentitySettings(_serialization.Model): - """Optional settings for a Managed Identity that is assigned to the Container App. - - All required parameters must be populated in order to send to server. - - :ivar identity: The resource ID of a user-assigned managed identity that is assigned to the - Container App, or 'system' for system-assigned identity. Required. - :vartype identity: str - :ivar lifecycle: Use to select the lifecycle stages of a Container App during which the Managed - Identity should be available. Known values are: "Init", "Main", "None", and "All". - :vartype lifecycle: str or ~azure.mgmt.appcontainers.models.IdentitySettingsLifeCycle - """ - - _validation = { - "identity": {"required": True}, - } - - _attribute_map = { - "identity": {"key": "identity", "type": "str"}, - "lifecycle": {"key": "lifecycle", "type": "str"}, - } - - def __init__( - self, *, identity: str, lifecycle: Union[str, "_models.IdentitySettingsLifeCycle"] = "All", **kwargs: Any - ) -> None: - """ - :keyword identity: The resource ID of a user-assigned managed identity that is assigned to the - Container App, or 'system' for system-assigned identity. Required. - :paramtype identity: str - :keyword lifecycle: Use to select the lifecycle stages of a Container App during which the - Managed Identity should be available. Known values are: "Init", "Main", "None", and "All". - :paramtype lifecycle: str or ~azure.mgmt.appcontainers.models.IdentitySettingsLifeCycle - """ - super().__init__(**kwargs) - self.identity = identity - self.lifecycle = lifecycle - - -class Ingress(_serialization.Model): # pylint: disable=too-many-instance-attributes +class Ingress(_serialization.Model): """Container App Ingress configuration. Variables are only populated by the server, and will be ignored when sending a request. @@ -7141,10 +4835,6 @@ class Ingress(_serialization.Model): # pylint: disable=too-many-instance-attrib :vartype cors_policy: ~azure.mgmt.appcontainers.models.CorsPolicy :ivar additional_port_mappings: Settings to expose additional ports on container app. :vartype additional_port_mappings: list[~azure.mgmt.appcontainers.models.IngressPortMapping] - :ivar target_port_http_scheme: Whether an http app listens on http or https. Known values are: - "http" and "https". - :vartype target_port_http_scheme: str or - ~azure.mgmt.appcontainers.models.IngressTargetPortHttpScheme """ _validation = { @@ -7165,7 +4855,6 @@ class Ingress(_serialization.Model): # pylint: disable=too-many-instance-attrib "client_certificate_mode": {"key": "clientCertificateMode", "type": "str"}, "cors_policy": {"key": "corsPolicy", "type": "CorsPolicy"}, "additional_port_mappings": {"key": "additionalPortMappings", "type": "[IngressPortMapping]"}, - "target_port_http_scheme": {"key": "targetPortHttpScheme", "type": "str"}, } def __init__( @@ -7183,7 +4872,6 @@ def __init__( client_certificate_mode: Optional[Union[str, "_models.IngressClientCertificateMode"]] = None, cors_policy: Optional["_models.CorsPolicy"] = None, additional_port_mappings: Optional[List["_models.IngressPortMapping"]] = None, - target_port_http_scheme: Optional[Union[str, "_models.IngressTargetPortHttpScheme"]] = None, **kwargs: Any ) -> None: """ @@ -7218,10 +4906,6 @@ def __init__( :paramtype cors_policy: ~azure.mgmt.appcontainers.models.CorsPolicy :keyword additional_port_mappings: Settings to expose additional ports on container app. :paramtype additional_port_mappings: list[~azure.mgmt.appcontainers.models.IngressPortMapping] - :keyword target_port_http_scheme: Whether an http app listens on http or https. Known values - are: "http" and "https". - :paramtype target_port_http_scheme: str or - ~azure.mgmt.appcontainers.models.IngressTargetPortHttpScheme """ super().__init__(**kwargs) self.fqdn = None @@ -7237,7 +4921,6 @@ def __init__( self.client_certificate_mode = client_certificate_mode self.cors_policy = cors_policy self.additional_port_mappings = additional_port_mappings - self.target_port_http_scheme = target_port_http_scheme class IngressPortMapping(_serialization.Model): @@ -7308,10 +4991,6 @@ class InitContainer(BaseContainer): :ivar image: Container image tag. :vartype image: str - :ivar image_type: The type of the image. Set to CloudBuild to let the system manages the image, - where user will not be able to update image through image field. Set to ContainerImage for user - provided image. Known values are: "CloudBuild" and "ContainerImage". - :vartype image_type: str or ~azure.mgmt.appcontainers.models.ImageType :ivar name: Custom container name. :vartype name: str :ivar command: Container start command. @@ -7385,13 +5064,15 @@ def __init__( self.action = action -class JavaComponent(ProxyResource): - """Java Component. +class Job(TrackedResource): + """Container App Job. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -7401,8 +5082,28 @@ class JavaComponent(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar properties: Java Component resource specific properties. - :vartype properties: ~azure.mgmt.appcontainers.models.JavaComponentProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar identity: Managed identities needed by a container app job to interact with other Azure + services to not maintain any secrets or credentials in code. + :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity + :ivar provisioning_state: Provisioning state of the Container Apps Job. Known values are: + "InProgress", "Succeeded", "Failed", "Canceled", and "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.JobProvisioningState + :ivar environment_id: Resource ID of environment. + :vartype environment_id: str + :ivar workload_profile_name: Workload profile name to pin for container apps job execution. + :vartype workload_profile_name: str + :ivar configuration: Container Apps Job configuration properties. + :vartype configuration: ~azure.mgmt.appcontainers.models.JobConfiguration + :ivar template: Container Apps job definition. + :vartype template: ~azure.mgmt.appcontainers.models.JobTemplate + :ivar outbound_ip_addresses: Outbound IP Addresses of a container apps job. + :vartype outbound_ip_addresses: list[str] + :ivar event_stream_endpoint: The endpoint of the eventstream of the container apps job. + :vartype event_stream_endpoint: str """ _validation = { @@ -7410,6 +5111,10 @@ class JavaComponent(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "outbound_ip_addresses": {"readonly": True}, + "event_stream_endpoint": {"readonly": True}, } _attribute_map = { @@ -7417,3122 +5122,1027 @@ class JavaComponent(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "JavaComponentProperties"}, - } - - def __init__(self, *, properties: Optional["_models.JavaComponentProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Java Component resource specific properties. - :paramtype properties: ~azure.mgmt.appcontainers.models.JavaComponentProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class JavaComponentConfigurationProperty(_serialization.Model): - """Configuration properties for a Java Component. - - :ivar property_name: The name of the property. - :vartype property_name: str - :ivar value: The value of the property. - :vartype value: str - """ - - _attribute_map = { - "property_name": {"key": "propertyName", "type": "str"}, - "value": {"key": "value", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "environment_id": {"key": "properties.environmentId", "type": "str"}, + "workload_profile_name": {"key": "properties.workloadProfileName", "type": "str"}, + "configuration": {"key": "properties.configuration", "type": "JobConfiguration"}, + "template": {"key": "properties.template", "type": "JobTemplate"}, + "outbound_ip_addresses": {"key": "properties.outboundIpAddresses", "type": "[str]"}, + "event_stream_endpoint": {"key": "properties.eventStreamEndpoint", "type": "str"}, } - def __init__(self, *, property_name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + environment_id: Optional[str] = None, + workload_profile_name: Optional[str] = None, + configuration: Optional["_models.JobConfiguration"] = None, + template: Optional["_models.JobTemplate"] = None, + **kwargs: Any + ) -> None: """ - :keyword property_name: The name of the property. - :paramtype property_name: str - :keyword value: The value of the property. - :paramtype value: str + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword identity: Managed identities needed by a container app job to interact with other + Azure services to not maintain any secrets or credentials in code. + :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity + :keyword environment_id: Resource ID of environment. + :paramtype environment_id: str + :keyword workload_profile_name: Workload profile name to pin for container apps job execution. + :paramtype workload_profile_name: str + :keyword configuration: Container Apps Job configuration properties. + :paramtype configuration: ~azure.mgmt.appcontainers.models.JobConfiguration + :keyword template: Container Apps job definition. + :paramtype template: ~azure.mgmt.appcontainers.models.JobTemplate """ - super().__init__(**kwargs) - self.property_name = property_name - self.value = value + super().__init__(tags=tags, location=location, **kwargs) + self.identity = identity + self.provisioning_state = None + self.environment_id = environment_id + self.workload_profile_name = workload_profile_name + self.configuration = configuration + self.template = template + self.outbound_ip_addresses = None + self.event_stream_endpoint = None -class JavaComponentIngress(_serialization.Model): - """Container App Ingress configuration. +class JobConfiguration(_serialization.Model): + """Non versioned Container Apps Job configuration properties. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to server. - :ivar fqdn: Hostname of the Java Component endpoint. - :vartype fqdn: str + :ivar secrets: Collection of secrets used by a Container Apps Job. + :vartype secrets: list[~azure.mgmt.appcontainers.models.Secret] + :ivar trigger_type: Trigger type of the job. Known values are: "Schedule", "Event", and + "Manual". + :vartype trigger_type: str or ~azure.mgmt.appcontainers.models.TriggerType + :ivar replica_timeout: Maximum number of seconds a replica is allowed to run. Required. + :vartype replica_timeout: int + :ivar replica_retry_limit: Maximum number of retries before failing the job. + :vartype replica_retry_limit: int + :ivar manual_trigger_config: Manual trigger configuration for a single execution job. + Properties replicaCompletionCount and parallelism would be set to 1 by default. + :vartype manual_trigger_config: + ~azure.mgmt.appcontainers.models.JobConfigurationManualTriggerConfig + :ivar schedule_trigger_config: Cron formatted repeating trigger schedule ("\\ * * * * *") for + cronjobs. Properties completions and parallelism would be set to 1 by default. + :vartype schedule_trigger_config: + ~azure.mgmt.appcontainers.models.JobConfigurationScheduleTriggerConfig + :ivar event_trigger_config: Trigger configuration of an event driven job. + :vartype event_trigger_config: + ~azure.mgmt.appcontainers.models.JobConfigurationEventTriggerConfig + :ivar registries: Collection of private container registry credentials used by a Container apps + job. + :vartype registries: list[~azure.mgmt.appcontainers.models.RegistryCredentials] """ _validation = { - "fqdn": {"readonly": True}, + "trigger_type": {"required": True}, + "replica_timeout": {"required": True}, } _attribute_map = { - "fqdn": {"key": "fqdn", "type": "str"}, + "secrets": {"key": "secrets", "type": "[Secret]"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "replica_timeout": {"key": "replicaTimeout", "type": "int"}, + "replica_retry_limit": {"key": "replicaRetryLimit", "type": "int"}, + "manual_trigger_config": {"key": "manualTriggerConfig", "type": "JobConfigurationManualTriggerConfig"}, + "schedule_trigger_config": {"key": "scheduleTriggerConfig", "type": "JobConfigurationScheduleTriggerConfig"}, + "event_trigger_config": {"key": "eventTriggerConfig", "type": "JobConfigurationEventTriggerConfig"}, + "registries": {"key": "registries", "type": "[RegistryCredentials]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.fqdn = None - - -class JavaComponentProperties(_serialization.Model): - """Java Component common properties. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - NacosComponent, SpringBootAdminComponent, SpringCloudConfigComponent, - SpringCloudEurekaComponent, SpringCloudGatewayComponent - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. + def __init__( + self, + *, + trigger_type: Union[str, "_models.TriggerType"] = "Manual", + replica_timeout: int, + secrets: Optional[List["_models.Secret"]] = None, + replica_retry_limit: Optional[int] = None, + manual_trigger_config: Optional["_models.JobConfigurationManualTriggerConfig"] = None, + schedule_trigger_config: Optional["_models.JobConfigurationScheduleTriggerConfig"] = None, + event_trigger_config: Optional["_models.JobConfigurationEventTriggerConfig"] = None, + registries: Optional[List["_models.RegistryCredentials"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword secrets: Collection of secrets used by a Container Apps Job. + :paramtype secrets: list[~azure.mgmt.appcontainers.models.Secret] + :keyword trigger_type: Trigger type of the job. Known values are: "Schedule", "Event", and + "Manual". + :paramtype trigger_type: str or ~azure.mgmt.appcontainers.models.TriggerType + :keyword replica_timeout: Maximum number of seconds a replica is allowed to run. Required. + :paramtype replica_timeout: int + :keyword replica_retry_limit: Maximum number of retries before failing the job. + :paramtype replica_retry_limit: int + :keyword manual_trigger_config: Manual trigger configuration for a single execution job. + Properties replicaCompletionCount and parallelism would be set to 1 by default. + :paramtype manual_trigger_config: + ~azure.mgmt.appcontainers.models.JobConfigurationManualTriggerConfig + :keyword schedule_trigger_config: Cron formatted repeating trigger schedule ("\\ * * * * *") + for cronjobs. Properties completions and parallelism would be set to 1 by default. + :paramtype schedule_trigger_config: + ~azure.mgmt.appcontainers.models.JobConfigurationScheduleTriggerConfig + :keyword event_trigger_config: Trigger configuration of an event driven job. + :paramtype event_trigger_config: + ~azure.mgmt.appcontainers.models.JobConfigurationEventTriggerConfig + :keyword registries: Collection of private container registry credentials used by a Container + apps job. + :paramtype registries: list[~azure.mgmt.appcontainers.models.RegistryCredentials] + """ + super().__init__(**kwargs) + self.secrets = secrets + self.trigger_type = trigger_type + self.replica_timeout = replica_timeout + self.replica_retry_limit = replica_retry_limit + self.manual_trigger_config = manual_trigger_config + self.schedule_trigger_config = schedule_trigger_config + self.event_trigger_config = event_trigger_config + self.registries = registries - :ivar component_type: Type of the Java Component. Required. Known values are: - "SpringBootAdmin", "SpringCloudEureka", "SpringCloudConfig", "SpringCloudGateway", and "Nacos". - :vartype component_type: str or ~azure.mgmt.appcontainers.models.JavaComponentType - :ivar provisioning_state: Provisioning state of the Java Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.JavaComponentProvisioningState - :ivar configurations: List of Java Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :ivar scale: Java component scaling configurations. - :vartype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :ivar service_binds: List of Java Components that are bound to the Java component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - """ - _validation = { - "component_type": {"required": True}, - "provisioning_state": {"readonly": True}, - } +class JobConfigurationEventTriggerConfig(_serialization.Model): + """Trigger configuration of an event driven job. - _attribute_map = { - "component_type": {"key": "componentType", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "configurations": {"key": "configurations", "type": "[JavaComponentConfigurationProperty]"}, - "scale": {"key": "scale", "type": "JavaComponentPropertiesScale"}, - "service_binds": {"key": "serviceBinds", "type": "[JavaComponentServiceBind]"}, - } + :ivar replica_completion_count: Minimum number of successful replica completions before overall + job completion. + :vartype replica_completion_count: int + :ivar parallelism: Number of parallel replicas of a job that can run at a given time. + :vartype parallelism: int + :ivar scale: Scaling configurations for event driven jobs. + :vartype scale: ~azure.mgmt.appcontainers.models.JobScale + """ - _subtype_map = { - "component_type": { - "Nacos": "NacosComponent", - "SpringBootAdmin": "SpringBootAdminComponent", - "SpringCloudConfig": "SpringCloudConfigComponent", - "SpringCloudEureka": "SpringCloudEurekaComponent", - "SpringCloudGateway": "SpringCloudGatewayComponent", - } + _attribute_map = { + "replica_completion_count": {"key": "replicaCompletionCount", "type": "int"}, + "parallelism": {"key": "parallelism", "type": "int"}, + "scale": {"key": "scale", "type": "JobScale"}, } def __init__( self, *, - configurations: Optional[List["_models.JavaComponentConfigurationProperty"]] = None, - scale: Optional["_models.JavaComponentPropertiesScale"] = None, - service_binds: Optional[List["_models.JavaComponentServiceBind"]] = None, + replica_completion_count: Optional[int] = None, + parallelism: Optional[int] = None, + scale: Optional["_models.JobScale"] = None, **kwargs: Any ) -> None: """ - :keyword configurations: List of Java Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :keyword scale: Java component scaling configurations. - :paramtype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :keyword service_binds: List of Java Components that are bound to the Java component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] + :keyword replica_completion_count: Minimum number of successful replica completions before + overall job completion. + :paramtype replica_completion_count: int + :keyword parallelism: Number of parallel replicas of a job that can run at a given time. + :paramtype parallelism: int + :keyword scale: Scaling configurations for event driven jobs. + :paramtype scale: ~azure.mgmt.appcontainers.models.JobScale """ super().__init__(**kwargs) - self.component_type: Optional[str] = None - self.provisioning_state = None - self.configurations = configurations + self.replica_completion_count = replica_completion_count + self.parallelism = parallelism self.scale = scale - self.service_binds = service_binds -class JavaComponentPropertiesScale(_serialization.Model): - """Java component scaling configurations. +class JobConfigurationManualTriggerConfig(_serialization.Model): + """Manual trigger configuration for a single execution job. Properties replicaCompletionCount and + parallelism would be set to 1 by default. - :ivar min_replicas: Optional. Minimum number of Java component replicas. Defaults to 1 if not - set. - :vartype min_replicas: int - :ivar max_replicas: Optional. Maximum number of Java component replicas. - :vartype max_replicas: int + :ivar replica_completion_count: Minimum number of successful replica completions before overall + job completion. + :vartype replica_completion_count: int + :ivar parallelism: Number of parallel replicas of a job that can run at a given time. + :vartype parallelism: int """ _attribute_map = { - "min_replicas": {"key": "minReplicas", "type": "int"}, - "max_replicas": {"key": "maxReplicas", "type": "int"}, + "replica_completion_count": {"key": "replicaCompletionCount", "type": "int"}, + "parallelism": {"key": "parallelism", "type": "int"}, } def __init__( - self, *, min_replicas: Optional[int] = None, max_replicas: Optional[int] = None, **kwargs: Any + self, *, replica_completion_count: Optional[int] = None, parallelism: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword min_replicas: Optional. Minimum number of Java component replicas. Defaults to 1 if - not set. - :paramtype min_replicas: int - :keyword max_replicas: Optional. Maximum number of Java component replicas. - :paramtype max_replicas: int + :keyword replica_completion_count: Minimum number of successful replica completions before + overall job completion. + :paramtype replica_completion_count: int + :keyword parallelism: Number of parallel replicas of a job that can run at a given time. + :paramtype parallelism: int """ super().__init__(**kwargs) - self.min_replicas = min_replicas - self.max_replicas = max_replicas - + self.replica_completion_count = replica_completion_count + self.parallelism = parallelism -class JavaComponentsCollection(_serialization.Model): - """Java Components ARM resource. - Variables are only populated by the server, and will be ignored when sending a request. +class JobConfigurationScheduleTriggerConfig(_serialization.Model): + """Cron formatted repeating trigger schedule ("\\ * * * * *") for cronjobs. Properties completions + and parallelism would be set to 1 by default. All required parameters must be populated in order to send to server. - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.JavaComponent] - :ivar next_link: Link to next page of resources. - :vartype next_link: str + :ivar replica_completion_count: Minimum number of successful replica completions before overall + job completion. + :vartype replica_completion_count: int + :ivar cron_expression: Cron formatted repeating schedule ("\\ * * * * *") of a Cron Job. + Required. + :vartype cron_expression: str + :ivar parallelism: Number of parallel replicas of a job that can run at a given time. + :vartype parallelism: int """ _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, + "cron_expression": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[JavaComponent]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "replica_completion_count": {"key": "replicaCompletionCount", "type": "int"}, + "cron_expression": {"key": "cronExpression", "type": "str"}, + "parallelism": {"key": "parallelism", "type": "int"}, } - def __init__(self, *, value: List["_models.JavaComponent"], **kwargs: Any) -> None: + def __init__( + self, + *, + cron_expression: str, + replica_completion_count: Optional[int] = None, + parallelism: Optional[int] = None, + **kwargs: Any + ) -> None: """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.JavaComponent] + :keyword replica_completion_count: Minimum number of successful replica completions before + overall job completion. + :paramtype replica_completion_count: int + :keyword cron_expression: Cron formatted repeating schedule ("\\ * * * * *") of a Cron Job. + Required. + :paramtype cron_expression: str + :keyword parallelism: Number of parallel replicas of a job that can run at a given time. + :paramtype parallelism: int """ super().__init__(**kwargs) - self.value = value - self.next_link = None + self.replica_completion_count = replica_completion_count + self.cron_expression = cron_expression + self.parallelism = parallelism -class JavaComponentServiceBind(_serialization.Model): - """Configuration to bind a Java Component to another Java Component. +class JobExecution(_serialization.Model): + """Container Apps Job execution. - :ivar name: Name of the service bind. + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Job execution Name. :vartype name: str - :ivar service_id: Resource id of the target service. - :vartype service_id: str + :ivar id: Job execution Id. + :vartype id: str + :ivar type: Job execution type. + :vartype type: str + :ivar status: Current running State of the job. Known values are: "Running", "Processing", + "Stopped", "Degraded", "Failed", "Unknown", and "Succeeded". + :vartype status: str or ~azure.mgmt.appcontainers.models.JobExecutionRunningState + :ivar start_time: Job execution start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Job execution end time. + :vartype end_time: ~datetime.datetime + :ivar template: Job's execution container. + :vartype template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate """ + _validation = { + "status": {"readonly": True}, + } + _attribute_map = { "name": {"key": "name", "type": "str"}, - "service_id": {"key": "serviceId", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "status": {"key": "properties.status", "type": "str"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "end_time": {"key": "properties.endTime", "type": "iso-8601"}, + "template": {"key": "properties.template", "type": "JobExecutionTemplate"}, } - def __init__(self, *, name: Optional[str] = None, service_id: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[str] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + template: Optional["_models.JobExecutionTemplate"] = None, + **kwargs: Any + ) -> None: """ - :keyword name: Name of the service bind. + :keyword name: Job execution Name. :paramtype name: str - :keyword service_id: Resource id of the target service. - :paramtype service_id: str + :keyword id: Job execution Id. + :paramtype id: str + :keyword type: Job execution type. + :paramtype type: str + :keyword start_time: Job execution start time. + :paramtype start_time: ~datetime.datetime + :keyword end_time: Job execution end time. + :paramtype end_time: ~datetime.datetime + :keyword template: Job's execution container. + :paramtype template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate """ super().__init__(**kwargs) self.name = name - self.service_id = service_id + self.id = id + self.type = type + self.status = None + self.start_time = start_time + self.end_time = end_time + self.template = template -class Job(TrackedResource): # pylint: disable=too-many-instance-attributes - """Container App Job. +class JobExecutionBase(_serialization.Model): + """Container App's Job execution name. - Variables are only populated by the server, and will be ignored when sending a request. + :ivar name: Job execution name. + :vartype name: str + :ivar id: Job execution Id. + :vartype id: str + """ - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar extended_location: The complex type of the extended location. - :vartype extended_location: ~azure.mgmt.appcontainers.models.ExtendedLocation - :ivar identity: Managed identities needed by a container app job to interact with other Azure - services to not maintain any secrets or credentials in code. - :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :ivar provisioning_state: Provisioning state of the Container Apps Job. Known values are: - "InProgress", "Succeeded", "Failed", "Canceled", and "Deleting". - :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.JobProvisioningState - :ivar running_state: Current running state of the job. Known values are: "Ready", - "Progressing", and "Suspended". - :vartype running_state: str or ~azure.mgmt.appcontainers.models.JobRunningState - :ivar environment_id: Resource ID of environment. - :vartype environment_id: str - :ivar workload_profile_name: Workload profile name to pin for container apps job execution. - :vartype workload_profile_name: str - :ivar configuration: Container Apps Job configuration properties. - :vartype configuration: ~azure.mgmt.appcontainers.models.JobConfiguration - :ivar template: Container Apps job definition. - :vartype template: ~azure.mgmt.appcontainers.models.JobTemplate - :ivar outbound_ip_addresses: Outbound IP Addresses of a container apps job. - :vartype outbound_ip_addresses: list[str] - :ivar event_stream_endpoint: The endpoint of the eventstream of the container apps job. - :vartype event_stream_endpoint: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "provisioning_state": {"readonly": True}, - "running_state": {"readonly": True}, - "outbound_ip_addresses": {"readonly": True}, - "event_stream_endpoint": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "running_state": {"key": "properties.runningState", "type": "str"}, - "environment_id": {"key": "properties.environmentId", "type": "str"}, - "workload_profile_name": {"key": "properties.workloadProfileName", "type": "str"}, - "configuration": {"key": "properties.configuration", "type": "JobConfiguration"}, - "template": {"key": "properties.template", "type": "JobTemplate"}, - "outbound_ip_addresses": {"key": "properties.outboundIpAddresses", "type": "[str]"}, - "event_stream_endpoint": {"key": "properties.eventStreamEndpoint", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - environment_id: Optional[str] = None, - workload_profile_name: Optional[str] = None, - configuration: Optional["_models.JobConfiguration"] = None, - template: Optional["_models.JobTemplate"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword extended_location: The complex type of the extended location. - :paramtype extended_location: ~azure.mgmt.appcontainers.models.ExtendedLocation - :keyword identity: Managed identities needed by a container app job to interact with other - Azure services to not maintain any secrets or credentials in code. - :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :keyword environment_id: Resource ID of environment. - :paramtype environment_id: str - :keyword workload_profile_name: Workload profile name to pin for container apps job execution. - :paramtype workload_profile_name: str - :keyword configuration: Container Apps Job configuration properties. - :paramtype configuration: ~azure.mgmt.appcontainers.models.JobConfiguration - :keyword template: Container Apps job definition. - :paramtype template: ~azure.mgmt.appcontainers.models.JobTemplate - """ - super().__init__(tags=tags, location=location, **kwargs) - self.extended_location = extended_location - self.identity = identity - self.provisioning_state = None - self.running_state = None - self.environment_id = environment_id - self.workload_profile_name = workload_profile_name - self.configuration = configuration - self.template = template - self.outbound_ip_addresses = None - self.event_stream_endpoint = None - - -class JobConfiguration(_serialization.Model): - """Non versioned Container Apps Job configuration properties. - - All required parameters must be populated in order to send to server. - - :ivar secrets: Collection of secrets used by a Container Apps Job. - :vartype secrets: list[~azure.mgmt.appcontainers.models.Secret] - :ivar trigger_type: Trigger type of the job. Known values are: "Schedule", "Event", and - "Manual". - :vartype trigger_type: str or ~azure.mgmt.appcontainers.models.TriggerType - :ivar replica_timeout: Maximum number of seconds a replica is allowed to run. Required. - :vartype replica_timeout: int - :ivar replica_retry_limit: Maximum number of retries before failing the job. - :vartype replica_retry_limit: int - :ivar manual_trigger_config: Manual trigger configuration for a single execution job. - Properties replicaCompletionCount and parallelism would be set to 1 by default. - :vartype manual_trigger_config: - ~azure.mgmt.appcontainers.models.JobConfigurationManualTriggerConfig - :ivar schedule_trigger_config: Cron formatted repeating trigger schedule ("\\ * * * * *") for - cronjobs. Properties completions and parallelism would be set to 1 by default. - :vartype schedule_trigger_config: - ~azure.mgmt.appcontainers.models.JobConfigurationScheduleTriggerConfig - :ivar event_trigger_config: Trigger configuration of an event driven job. - :vartype event_trigger_config: - ~azure.mgmt.appcontainers.models.JobConfigurationEventTriggerConfig - :ivar registries: Collection of private container registry credentials used by a Container apps - job. - :vartype registries: list[~azure.mgmt.appcontainers.models.RegistryCredentials] - :ivar identity_settings: Optional settings for Managed Identities that are assigned to the - Container App Job. If a Managed Identity is not specified here, default settings will be used. - :vartype identity_settings: list[~azure.mgmt.appcontainers.models.IdentitySettings] - """ - - _validation = { - "trigger_type": {"required": True}, - "replica_timeout": {"required": True}, - } - - _attribute_map = { - "secrets": {"key": "secrets", "type": "[Secret]"}, - "trigger_type": {"key": "triggerType", "type": "str"}, - "replica_timeout": {"key": "replicaTimeout", "type": "int"}, - "replica_retry_limit": {"key": "replicaRetryLimit", "type": "int"}, - "manual_trigger_config": {"key": "manualTriggerConfig", "type": "JobConfigurationManualTriggerConfig"}, - "schedule_trigger_config": {"key": "scheduleTriggerConfig", "type": "JobConfigurationScheduleTriggerConfig"}, - "event_trigger_config": {"key": "eventTriggerConfig", "type": "JobConfigurationEventTriggerConfig"}, - "registries": {"key": "registries", "type": "[RegistryCredentials]"}, - "identity_settings": {"key": "identitySettings", "type": "[IdentitySettings]"}, - } - - def __init__( - self, - *, - trigger_type: Union[str, "_models.TriggerType"] = "Manual", - replica_timeout: int, - secrets: Optional[List["_models.Secret"]] = None, - replica_retry_limit: Optional[int] = None, - manual_trigger_config: Optional["_models.JobConfigurationManualTriggerConfig"] = None, - schedule_trigger_config: Optional["_models.JobConfigurationScheduleTriggerConfig"] = None, - event_trigger_config: Optional["_models.JobConfigurationEventTriggerConfig"] = None, - registries: Optional[List["_models.RegistryCredentials"]] = None, - identity_settings: Optional[List["_models.IdentitySettings"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword secrets: Collection of secrets used by a Container Apps Job. - :paramtype secrets: list[~azure.mgmt.appcontainers.models.Secret] - :keyword trigger_type: Trigger type of the job. Known values are: "Schedule", "Event", and - "Manual". - :paramtype trigger_type: str or ~azure.mgmt.appcontainers.models.TriggerType - :keyword replica_timeout: Maximum number of seconds a replica is allowed to run. Required. - :paramtype replica_timeout: int - :keyword replica_retry_limit: Maximum number of retries before failing the job. - :paramtype replica_retry_limit: int - :keyword manual_trigger_config: Manual trigger configuration for a single execution job. - Properties replicaCompletionCount and parallelism would be set to 1 by default. - :paramtype manual_trigger_config: - ~azure.mgmt.appcontainers.models.JobConfigurationManualTriggerConfig - :keyword schedule_trigger_config: Cron formatted repeating trigger schedule ("\\ * * * * *") - for cronjobs. Properties completions and parallelism would be set to 1 by default. - :paramtype schedule_trigger_config: - ~azure.mgmt.appcontainers.models.JobConfigurationScheduleTriggerConfig - :keyword event_trigger_config: Trigger configuration of an event driven job. - :paramtype event_trigger_config: - ~azure.mgmt.appcontainers.models.JobConfigurationEventTriggerConfig - :keyword registries: Collection of private container registry credentials used by a Container - apps job. - :paramtype registries: list[~azure.mgmt.appcontainers.models.RegistryCredentials] - :keyword identity_settings: Optional settings for Managed Identities that are assigned to the - Container App Job. If a Managed Identity is not specified here, default settings will be used. - :paramtype identity_settings: list[~azure.mgmt.appcontainers.models.IdentitySettings] - """ - super().__init__(**kwargs) - self.secrets = secrets - self.trigger_type = trigger_type - self.replica_timeout = replica_timeout - self.replica_retry_limit = replica_retry_limit - self.manual_trigger_config = manual_trigger_config - self.schedule_trigger_config = schedule_trigger_config - self.event_trigger_config = event_trigger_config - self.registries = registries - self.identity_settings = identity_settings - - -class JobConfigurationEventTriggerConfig(_serialization.Model): - """Trigger configuration of an event driven job. - - :ivar replica_completion_count: Minimum number of successful replica completions before overall - job completion. - :vartype replica_completion_count: int - :ivar parallelism: Number of parallel replicas of a job that can run at a given time. - :vartype parallelism: int - :ivar scale: Scaling configurations for event driven jobs. - :vartype scale: ~azure.mgmt.appcontainers.models.JobScale - """ - - _attribute_map = { - "replica_completion_count": {"key": "replicaCompletionCount", "type": "int"}, - "parallelism": {"key": "parallelism", "type": "int"}, - "scale": {"key": "scale", "type": "JobScale"}, - } - - def __init__( - self, - *, - replica_completion_count: Optional[int] = None, - parallelism: Optional[int] = None, - scale: Optional["_models.JobScale"] = None, - **kwargs: Any - ) -> None: - """ - :keyword replica_completion_count: Minimum number of successful replica completions before - overall job completion. - :paramtype replica_completion_count: int - :keyword parallelism: Number of parallel replicas of a job that can run at a given time. - :paramtype parallelism: int - :keyword scale: Scaling configurations for event driven jobs. - :paramtype scale: ~azure.mgmt.appcontainers.models.JobScale - """ - super().__init__(**kwargs) - self.replica_completion_count = replica_completion_count - self.parallelism = parallelism - self.scale = scale - - -class JobConfigurationManualTriggerConfig(_serialization.Model): - """Manual trigger configuration for a single execution job. Properties replicaCompletionCount and - parallelism would be set to 1 by default. - - :ivar replica_completion_count: Minimum number of successful replica completions before overall - job completion. - :vartype replica_completion_count: int - :ivar parallelism: Number of parallel replicas of a job that can run at a given time. - :vartype parallelism: int - """ - - _attribute_map = { - "replica_completion_count": {"key": "replicaCompletionCount", "type": "int"}, - "parallelism": {"key": "parallelism", "type": "int"}, - } - - def __init__( - self, *, replica_completion_count: Optional[int] = None, parallelism: Optional[int] = None, **kwargs: Any - ) -> None: - """ - :keyword replica_completion_count: Minimum number of successful replica completions before - overall job completion. - :paramtype replica_completion_count: int - :keyword parallelism: Number of parallel replicas of a job that can run at a given time. - :paramtype parallelism: int - """ - super().__init__(**kwargs) - self.replica_completion_count = replica_completion_count - self.parallelism = parallelism - - -class JobConfigurationScheduleTriggerConfig(_serialization.Model): - """Cron formatted repeating trigger schedule ("\\ * * * * *") for cronjobs. Properties completions - and parallelism would be set to 1 by default. - - All required parameters must be populated in order to send to server. - - :ivar replica_completion_count: Minimum number of successful replica completions before overall - job completion. - :vartype replica_completion_count: int - :ivar cron_expression: Cron formatted repeating schedule ("\\ * * * * *") of a Cron Job. - Required. - :vartype cron_expression: str - :ivar parallelism: Number of parallel replicas of a job that can run at a given time. - :vartype parallelism: int - """ - - _validation = { - "cron_expression": {"required": True}, - } - - _attribute_map = { - "replica_completion_count": {"key": "replicaCompletionCount", "type": "int"}, - "cron_expression": {"key": "cronExpression", "type": "str"}, - "parallelism": {"key": "parallelism", "type": "int"}, - } - - def __init__( - self, - *, - cron_expression: str, - replica_completion_count: Optional[int] = None, - parallelism: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword replica_completion_count: Minimum number of successful replica completions before - overall job completion. - :paramtype replica_completion_count: int - :keyword cron_expression: Cron formatted repeating schedule ("\\ * * * * *") of a Cron Job. - Required. - :paramtype cron_expression: str - :keyword parallelism: Number of parallel replicas of a job that can run at a given time. - :paramtype parallelism: int - """ - super().__init__(**kwargs) - self.replica_completion_count = replica_completion_count - self.cron_expression = cron_expression - self.parallelism = parallelism - - -class JobExecution(_serialization.Model): - """Container Apps Job execution. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Job execution Name. - :vartype name: str - :ivar id: Job execution Id. - :vartype id: str - :ivar type: Job execution type. - :vartype type: str - :ivar status: Current running State of the job. Known values are: "Running", "Processing", - "Stopped", "Degraded", "Failed", "Unknown", and "Succeeded". - :vartype status: str or ~azure.mgmt.appcontainers.models.JobExecutionRunningState - :ivar start_time: Job execution start time. - :vartype start_time: ~datetime.datetime - :ivar end_time: Job execution end time. - :vartype end_time: ~datetime.datetime - :ivar template: Job's execution container. - :vartype template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate - :ivar detailed_status: Detailed status of the job execution. - :vartype detailed_status: ~azure.mgmt.appcontainers.models.ExecutionStatus - """ - - _validation = { - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "end_time": {"key": "properties.endTime", "type": "iso-8601"}, - "template": {"key": "properties.template", "type": "JobExecutionTemplate"}, - "detailed_status": {"key": "properties.detailedStatus", "type": "ExecutionStatus"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - type: Optional[str] = None, - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = None, - template: Optional["_models.JobExecutionTemplate"] = None, - detailed_status: Optional["_models.ExecutionStatus"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Job execution Name. - :paramtype name: str - :keyword id: Job execution Id. - :paramtype id: str - :keyword type: Job execution type. - :paramtype type: str - :keyword start_time: Job execution start time. - :paramtype start_time: ~datetime.datetime - :keyword end_time: Job execution end time. - :paramtype end_time: ~datetime.datetime - :keyword template: Job's execution container. - :paramtype template: ~azure.mgmt.appcontainers.models.JobExecutionTemplate - :keyword detailed_status: Detailed status of the job execution. - :paramtype detailed_status: ~azure.mgmt.appcontainers.models.ExecutionStatus - """ - super().__init__(**kwargs) - self.name = name - self.id = id - self.type = type - self.status = None - self.start_time = start_time - self.end_time = end_time - self.template = template - self.detailed_status = detailed_status - - -class JobExecutionBase(_serialization.Model): - """Container App's Job execution name. - - :ivar name: Job execution name. - :vartype name: str - :ivar id: Job execution Id. - :vartype id: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "id": {"key": "id", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - id: Optional[str] = None, # pylint: disable=redefined-builtin - **kwargs: Any - ) -> None: - """ - :keyword name: Job execution name. - :paramtype name: str - :keyword id: Job execution Id. - :paramtype id: str - """ - super().__init__(**kwargs) - self.name = name - self.id = id - - -class JobExecutionContainer(_serialization.Model): - """Container Apps Jobs execution container definition. - - :ivar image: Container image tag. - :vartype image: str - :ivar name: Custom container name. - :vartype name: str - :ivar command: Container start command. - :vartype command: list[str] - :ivar args: Container start command arguments. - :vartype args: list[str] - :ivar env: Container environment variables. - :vartype env: list[~azure.mgmt.appcontainers.models.EnvironmentVar] - :ivar resources: Container resource requirements. - :vartype resources: ~azure.mgmt.appcontainers.models.ContainerResources - """ - - _attribute_map = { - "image": {"key": "image", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "command": {"key": "command", "type": "[str]"}, - "args": {"key": "args", "type": "[str]"}, - "env": {"key": "env", "type": "[EnvironmentVar]"}, - "resources": {"key": "resources", "type": "ContainerResources"}, - } - - def __init__( - self, - *, - image: Optional[str] = None, - name: Optional[str] = None, - command: Optional[List[str]] = None, - args: Optional[List[str]] = None, - env: Optional[List["_models.EnvironmentVar"]] = None, - resources: Optional["_models.ContainerResources"] = None, - **kwargs: Any - ) -> None: - """ - :keyword image: Container image tag. - :paramtype image: str - :keyword name: Custom container name. - :paramtype name: str - :keyword command: Container start command. - :paramtype command: list[str] - :keyword args: Container start command arguments. - :paramtype args: list[str] - :keyword env: Container environment variables. - :paramtype env: list[~azure.mgmt.appcontainers.models.EnvironmentVar] - :keyword resources: Container resource requirements. - :paramtype resources: ~azure.mgmt.appcontainers.models.ContainerResources - """ - super().__init__(**kwargs) - self.image = image - self.name = name - self.command = command - self.args = args - self.env = env - self.resources = resources - - -class JobExecutionNamesCollection(_serialization.Model): - """Container App executions names list. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.JobExecutionBase] - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JobExecutionBase]"}, - } - - def __init__(self, *, value: List["_models.JobExecutionBase"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.JobExecutionBase] - """ - super().__init__(**kwargs) - self.value = value - - -class JobExecutionTemplate(_serialization.Model): - """Job's execution template, containing container configuration for a job's execution. - - :ivar containers: List of container definitions for the Container Apps Job. - :vartype containers: list[~azure.mgmt.appcontainers.models.JobExecutionContainer] - :ivar init_containers: List of specialized containers that run before job containers. - :vartype init_containers: list[~azure.mgmt.appcontainers.models.JobExecutionContainer] - """ - - _attribute_map = { - "containers": {"key": "containers", "type": "[JobExecutionContainer]"}, - "init_containers": {"key": "initContainers", "type": "[JobExecutionContainer]"}, - } - - def __init__( - self, - *, - containers: Optional[List["_models.JobExecutionContainer"]] = None, - init_containers: Optional[List["_models.JobExecutionContainer"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword containers: List of container definitions for the Container Apps Job. - :paramtype containers: list[~azure.mgmt.appcontainers.models.JobExecutionContainer] - :keyword init_containers: List of specialized containers that run before job containers. - :paramtype init_containers: list[~azure.mgmt.appcontainers.models.JobExecutionContainer] - """ - super().__init__(**kwargs) - self.containers = containers - self.init_containers = init_containers - - -class JobPatchProperties(_serialization.Model): - """Container Apps Job resource specific properties. - - :ivar extended_location: The complex type of the extended location. - :vartype extended_location: ~azure.mgmt.appcontainers.models.ExtendedLocation - :ivar identity: Managed identities needed by a container app job to interact with other Azure - services to not maintain any secrets or credentials in code. - :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar properties: - :vartype properties: ~azure.mgmt.appcontainers.models.JobPatchPropertiesProperties - """ - - _attribute_map = { - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "tags": {"key": "tags", "type": "{str}"}, - "properties": {"key": "properties", "type": "JobPatchPropertiesProperties"}, - } - - def __init__( - self, - *, - extended_location: Optional["_models.ExtendedLocation"] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.JobPatchPropertiesProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword extended_location: The complex type of the extended location. - :paramtype extended_location: ~azure.mgmt.appcontainers.models.ExtendedLocation - :keyword identity: Managed identities needed by a container app job to interact with other - Azure services to not maintain any secrets or credentials in code. - :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword properties: - :paramtype properties: ~azure.mgmt.appcontainers.models.JobPatchPropertiesProperties - """ - super().__init__(**kwargs) - self.extended_location = extended_location - self.identity = identity - self.tags = tags - self.properties = properties - - -class JobPatchPropertiesProperties(_serialization.Model): - """JobPatchPropertiesProperties. - - :ivar environment_id: Resource ID of environment. - :vartype environment_id: str - :ivar configuration: Container Apps Job configuration properties. - :vartype configuration: ~azure.mgmt.appcontainers.models.JobConfiguration - :ivar template: Container Apps job definition. - :vartype template: ~azure.mgmt.appcontainers.models.JobTemplate - :ivar outbound_ip_addresses: Outbound IP Addresses of a container apps job. - :vartype outbound_ip_addresses: list[str] - :ivar event_stream_endpoint: The endpoint of the eventstream of the container apps job. - :vartype event_stream_endpoint: str - """ - - _attribute_map = { - "environment_id": {"key": "environmentId", "type": "str"}, - "configuration": {"key": "configuration", "type": "JobConfiguration"}, - "template": {"key": "template", "type": "JobTemplate"}, - "outbound_ip_addresses": {"key": "outboundIpAddresses", "type": "[str]"}, - "event_stream_endpoint": {"key": "eventStreamEndpoint", "type": "str"}, - } - - def __init__( - self, - *, - environment_id: Optional[str] = None, - configuration: Optional["_models.JobConfiguration"] = None, - template: Optional["_models.JobTemplate"] = None, - outbound_ip_addresses: Optional[List[str]] = None, - event_stream_endpoint: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword environment_id: Resource ID of environment. - :paramtype environment_id: str - :keyword configuration: Container Apps Job configuration properties. - :paramtype configuration: ~azure.mgmt.appcontainers.models.JobConfiguration - :keyword template: Container Apps job definition. - :paramtype template: ~azure.mgmt.appcontainers.models.JobTemplate - :keyword outbound_ip_addresses: Outbound IP Addresses of a container apps job. - :paramtype outbound_ip_addresses: list[str] - :keyword event_stream_endpoint: The endpoint of the eventstream of the container apps job. - :paramtype event_stream_endpoint: str - """ - super().__init__(**kwargs) - self.environment_id = environment_id - self.configuration = configuration - self.template = template - self.outbound_ip_addresses = outbound_ip_addresses - self.event_stream_endpoint = event_stream_endpoint - - -class JobScale(_serialization.Model): - """Scaling configurations for event driven jobs. - - :ivar polling_interval: Interval to check each event source in seconds. Defaults to 30s. - :vartype polling_interval: int - :ivar min_executions: Minimum number of job executions that are created for a trigger, default - 0. - :vartype min_executions: int - :ivar max_executions: Maximum number of job executions that are created for a trigger, default - 100. - :vartype max_executions: int - :ivar rules: Scaling rules. - :vartype rules: list[~azure.mgmt.appcontainers.models.JobScaleRule] - """ - - _attribute_map = { - "polling_interval": {"key": "pollingInterval", "type": "int"}, - "min_executions": {"key": "minExecutions", "type": "int"}, - "max_executions": {"key": "maxExecutions", "type": "int"}, - "rules": {"key": "rules", "type": "[JobScaleRule]"}, - } - - def __init__( - self, - *, - polling_interval: Optional[int] = None, - min_executions: int = 0, - max_executions: int = 100, - rules: Optional[List["_models.JobScaleRule"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword polling_interval: Interval to check each event source in seconds. Defaults to 30s. - :paramtype polling_interval: int - :keyword min_executions: Minimum number of job executions that are created for a trigger, - default 0. - :paramtype min_executions: int - :keyword max_executions: Maximum number of job executions that are created for a trigger, - default 100. - :paramtype max_executions: int - :keyword rules: Scaling rules. - :paramtype rules: list[~azure.mgmt.appcontainers.models.JobScaleRule] - """ - super().__init__(**kwargs) - self.polling_interval = polling_interval - self.min_executions = min_executions - self.max_executions = max_executions - self.rules = rules - - -class JobScaleRule(_serialization.Model): - """Scaling rule. - - :ivar name: Scale Rule Name. - :vartype name: str - :ivar type: Type of the scale rule - eg: azure-servicebus, redis etc. - :vartype type: str - :ivar metadata: Metadata properties to describe the scale rule. - :vartype metadata: JSON - :ivar auth: Authentication secrets for the scale rule. - :vartype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] - :ivar identity: The resource ID of a user-assigned managed identity that is assigned to the - job, or 'system' for system-assigned identity. - :vartype identity: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "metadata": {"key": "metadata", "type": "object"}, - "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, - "identity": {"key": "identity", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[str] = None, - metadata: Optional[JSON] = None, - auth: Optional[List["_models.ScaleRuleAuth"]] = None, - identity: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Scale Rule Name. - :paramtype name: str - :keyword type: Type of the scale rule - eg: azure-servicebus, redis etc. - :paramtype type: str - :keyword metadata: Metadata properties to describe the scale rule. - :paramtype metadata: JSON - :keyword auth: Authentication secrets for the scale rule. - :paramtype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] - :keyword identity: The resource ID of a user-assigned managed identity that is assigned to the - job, or 'system' for system-assigned identity. - :paramtype identity: str - """ - super().__init__(**kwargs) - self.name = name - self.type = type - self.metadata = metadata - self.auth = auth - self.identity = identity - - -class JobsCollection(_serialization.Model): - """Container Apps Jobs collection ARM resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.Job] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Job]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.Job"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.Job] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class JobSecretsCollection(_serialization.Model): - """Container Apps Job Secrets Collection ARM resource. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.Secret] - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Secret]"}, - } - - def __init__(self, *, value: List["_models.Secret"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.Secret] - """ - super().__init__(**kwargs) - self.value = value - - -class JobTemplate(_serialization.Model): - """Container Apps Job versioned application definition. Defines the desired state of an immutable - revision. Any changes to this section Will result in a new revision being created. - - :ivar init_containers: List of specialized containers that run before app containers. - :vartype init_containers: list[~azure.mgmt.appcontainers.models.InitContainer] - :ivar containers: List of container definitions for the Container App. - :vartype containers: list[~azure.mgmt.appcontainers.models.Container] - :ivar volumes: List of volume definitions for the Container App. - :vartype volumes: list[~azure.mgmt.appcontainers.models.Volume] - """ - - _attribute_map = { - "init_containers": {"key": "initContainers", "type": "[InitContainer]"}, - "containers": {"key": "containers", "type": "[Container]"}, - "volumes": {"key": "volumes", "type": "[Volume]"}, - } - - def __init__( - self, - *, - init_containers: Optional[List["_models.InitContainer"]] = None, - containers: Optional[List["_models.Container"]] = None, - volumes: Optional[List["_models.Volume"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword init_containers: List of specialized containers that run before app containers. - :paramtype init_containers: list[~azure.mgmt.appcontainers.models.InitContainer] - :keyword containers: List of container definitions for the Container App. - :paramtype containers: list[~azure.mgmt.appcontainers.models.Container] - :keyword volumes: List of volume definitions for the Container App. - :paramtype volumes: list[~azure.mgmt.appcontainers.models.Volume] - """ - super().__init__(**kwargs) - self.init_containers = init_containers - self.containers = containers - self.volumes = volumes - - -class JwtClaimChecks(_serialization.Model): - """The configuration settings of the checks that should be made while validating the JWT Claims. - - :ivar allowed_groups: The list of the allowed groups. - :vartype allowed_groups: list[str] - :ivar allowed_client_applications: The list of the allowed client applications. - :vartype allowed_client_applications: list[str] - """ - - _attribute_map = { - "allowed_groups": {"key": "allowedGroups", "type": "[str]"}, - "allowed_client_applications": {"key": "allowedClientApplications", "type": "[str]"}, - } - - def __init__( - self, - *, - allowed_groups: Optional[List[str]] = None, - allowed_client_applications: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword allowed_groups: The list of the allowed groups. - :paramtype allowed_groups: list[str] - :keyword allowed_client_applications: The list of the allowed client applications. - :paramtype allowed_client_applications: list[str] - """ - super().__init__(**kwargs) - self.allowed_groups = allowed_groups - self.allowed_client_applications = allowed_client_applications - - -class KedaConfiguration(_serialization.Model): - """Configuration properties Keda component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar version: The version of Keda. - :vartype version: str - """ - - _validation = { - "version": {"readonly": True}, - } - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.version = None - - -class ListUsagesResult(_serialization.Model): - """ListUsagesResult. - - :ivar value: The list of compute resource usages. - :vartype value: list[~azure.mgmt.appcontainers.models.Usage] - :ivar next_link: The URI to fetch the next page of compute resource usage information. Call - ListNext() with this to fetch the next page of compute resource usage information. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[Usage]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: Optional[List["_models.Usage"]] = None, next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The list of compute resource usages. - :paramtype value: list[~azure.mgmt.appcontainers.models.Usage] - :keyword next_link: The URI to fetch the next page of compute resource usage information. Call - ListNext() with this to fetch the next page of compute resource usage information. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class LogAnalyticsConfiguration(_serialization.Model): - """Log Analytics configuration, must only be provided when destination is configured as - 'log-analytics'. - - :ivar customer_id: Log analytics customer id. - :vartype customer_id: str - :ivar shared_key: Log analytics customer key. - :vartype shared_key: str - :ivar dynamic_json_columns: Boolean indicating whether to parse json string log into dynamic - json columns. - :vartype dynamic_json_columns: bool - """ - - _attribute_map = { - "customer_id": {"key": "customerId", "type": "str"}, - "shared_key": {"key": "sharedKey", "type": "str"}, - "dynamic_json_columns": {"key": "dynamicJsonColumns", "type": "bool"}, - } - - def __init__( - self, - *, - customer_id: Optional[str] = None, - shared_key: Optional[str] = None, - dynamic_json_columns: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword customer_id: Log analytics customer id. - :paramtype customer_id: str - :keyword shared_key: Log analytics customer key. - :paramtype shared_key: str - :keyword dynamic_json_columns: Boolean indicating whether to parse json string log into dynamic - json columns. - :paramtype dynamic_json_columns: bool - """ - super().__init__(**kwargs) - self.customer_id = customer_id - self.shared_key = shared_key - self.dynamic_json_columns = dynamic_json_columns - - -class LoggerSetting(_serialization.Model): - """Logger settings for java workloads. - - All required parameters must be populated in order to send to server. - - :ivar logger: Logger name. Required. - :vartype logger: str - :ivar level: The specified logger's log level. Required. Known values are: "off", "error", - "info", "debug", "trace", and "warn". - :vartype level: str or ~azure.mgmt.appcontainers.models.Level - """ - - _validation = { - "logger": {"required": True}, - "level": {"required": True}, - } - - _attribute_map = { - "logger": {"key": "logger", "type": "str"}, - "level": {"key": "level", "type": "str"}, - } - - def __init__(self, *, logger: str, level: Union[str, "_models.Level"], **kwargs: Any) -> None: - """ - :keyword logger: Logger name. Required. - :paramtype logger: str - :keyword level: The specified logger's log level. Required. Known values are: "off", "error", - "info", "debug", "trace", and "warn". - :paramtype level: str or ~azure.mgmt.appcontainers.models.Level - """ - super().__init__(**kwargs) - self.logger = logger - self.level = level - - -class LogicApp(ProxyResource): - """A logic app extension resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: JSON - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "object"}, - } - - def __init__(self, *, properties: Optional[JSON] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: JSON - """ - super().__init__(**kwargs) - self.properties = properties - - -class Login(_serialization.Model): - """The configuration settings of the login flow of users using ContainerApp Service - Authentication/Authorization. - - :ivar routes: The routes that specify the endpoints used for login and logout requests. - :vartype routes: ~azure.mgmt.appcontainers.models.LoginRoutes - :ivar token_store: The configuration settings of the token store. - :vartype token_store: ~azure.mgmt.appcontainers.models.TokenStore - :ivar preserve_url_fragments_for_logins: :code:`true` if the fragments from the - request are preserved after the login request is made; otherwise, :code:`false`. - :vartype preserve_url_fragments_for_logins: bool - :ivar allowed_external_redirect_urls: External URLs that can be redirected to as part of - logging in or logging out of the app. Note that the query string part of the URL is ignored. - This is an advanced setting typically only needed by Windows Store application backends. - Note that URLs within the current domain are always implicitly allowed. - :vartype allowed_external_redirect_urls: list[str] - :ivar cookie_expiration: The configuration settings of the session cookie's expiration. - :vartype cookie_expiration: ~azure.mgmt.appcontainers.models.CookieExpiration - :ivar nonce: The configuration settings of the nonce used in the login flow. - :vartype nonce: ~azure.mgmt.appcontainers.models.Nonce - """ - - _attribute_map = { - "routes": {"key": "routes", "type": "LoginRoutes"}, - "token_store": {"key": "tokenStore", "type": "TokenStore"}, - "preserve_url_fragments_for_logins": {"key": "preserveUrlFragmentsForLogins", "type": "bool"}, - "allowed_external_redirect_urls": {"key": "allowedExternalRedirectUrls", "type": "[str]"}, - "cookie_expiration": {"key": "cookieExpiration", "type": "CookieExpiration"}, - "nonce": {"key": "nonce", "type": "Nonce"}, - } - - def __init__( - self, - *, - routes: Optional["_models.LoginRoutes"] = None, - token_store: Optional["_models.TokenStore"] = None, - preserve_url_fragments_for_logins: Optional[bool] = None, - allowed_external_redirect_urls: Optional[List[str]] = None, - cookie_expiration: Optional["_models.CookieExpiration"] = None, - nonce: Optional["_models.Nonce"] = None, - **kwargs: Any - ) -> None: - """ - :keyword routes: The routes that specify the endpoints used for login and logout requests. - :paramtype routes: ~azure.mgmt.appcontainers.models.LoginRoutes - :keyword token_store: The configuration settings of the token store. - :paramtype token_store: ~azure.mgmt.appcontainers.models.TokenStore - :keyword preserve_url_fragments_for_logins: :code:`true` if the fragments from the - request are preserved after the login request is made; otherwise, :code:`false`. - :paramtype preserve_url_fragments_for_logins: bool - :keyword allowed_external_redirect_urls: External URLs that can be redirected to as part of - logging in or logging out of the app. Note that the query string part of the URL is ignored. - This is an advanced setting typically only needed by Windows Store application backends. - Note that URLs within the current domain are always implicitly allowed. - :paramtype allowed_external_redirect_urls: list[str] - :keyword cookie_expiration: The configuration settings of the session cookie's expiration. - :paramtype cookie_expiration: ~azure.mgmt.appcontainers.models.CookieExpiration - :keyword nonce: The configuration settings of the nonce used in the login flow. - :paramtype nonce: ~azure.mgmt.appcontainers.models.Nonce - """ - super().__init__(**kwargs) - self.routes = routes - self.token_store = token_store - self.preserve_url_fragments_for_logins = preserve_url_fragments_for_logins - self.allowed_external_redirect_urls = allowed_external_redirect_urls - self.cookie_expiration = cookie_expiration - self.nonce = nonce - - -class LoginRoutes(_serialization.Model): - """The routes that specify the endpoints used for login and logout requests. - - :ivar logout_endpoint: The endpoint at which a logout request should be made. - :vartype logout_endpoint: str - """ - - _attribute_map = { - "logout_endpoint": {"key": "logoutEndpoint", "type": "str"}, - } - - def __init__(self, *, logout_endpoint: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword logout_endpoint: The endpoint at which a logout request should be made. - :paramtype logout_endpoint: str - """ - super().__init__(**kwargs) - self.logout_endpoint = logout_endpoint - - -class LoginScopes(_serialization.Model): - """The configuration settings of the login flow, including the scopes that should be requested. - - :ivar scopes: A list of the scopes that should be requested while authenticating. - :vartype scopes: list[str] - """ - - _attribute_map = { - "scopes": {"key": "scopes", "type": "[str]"}, - } - - def __init__(self, *, scopes: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword scopes: A list of the scopes that should be requested while authenticating. - :paramtype scopes: list[str] - """ - super().__init__(**kwargs) - self.scopes = scopes - - -class LogsConfiguration(_serialization.Model): - """Configuration of Open Telemetry logs. - - :ivar destinations: Open telemetry logs destinations. - :vartype destinations: list[str] - """ - - _attribute_map = { - "destinations": {"key": "destinations", "type": "[str]"}, - } - - def __init__(self, *, destinations: Optional[List[str]] = None, **kwargs: Any) -> None: - """ - :keyword destinations: Open telemetry logs destinations. - :paramtype destinations: list[str] - """ - super().__init__(**kwargs) - self.destinations = destinations - - -class ManagedCertificate(TrackedResource): - """Managed certificates used for Custom Domain bindings of Container Apps in a Managed - Environment. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar properties: Certificate resource specific properties. - :vartype properties: ~azure.mgmt.appcontainers.models.ManagedCertificateProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "ManagedCertificateProperties"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - properties: Optional["_models.ManagedCertificateProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword properties: Certificate resource specific properties. - :paramtype properties: ~azure.mgmt.appcontainers.models.ManagedCertificateProperties - """ - super().__init__(tags=tags, location=location, **kwargs) - self.properties = properties - - -class ManagedCertificateCollection(_serialization.Model): - """Collection of Managed Certificates. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.ManagedCertificate] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedCertificate]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.ManagedCertificate"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.ManagedCertificate] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ManagedCertificatePatch(_serialization.Model): - """A managed certificate to update. - - :ivar tags: Application-specific metadata in the form of key-value pairs. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Application-specific metadata in the form of key-value pairs. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class ManagedCertificateProperties(_serialization.Model): - """Certificate resource specific properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: Provisioning state of the certificate. Known values are: "Succeeded", - "Failed", "Canceled", "DeleteFailed", and "Pending". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.CertificateProvisioningState - :ivar subject_name: Subject name of the certificate. - :vartype subject_name: str - :ivar error: Any error occurred during the certificate provision. - :vartype error: str - :ivar domain_control_validation: Selected type of domain control validation for managed - certificates. Known values are: "CNAME", "HTTP", and "TXT". - :vartype domain_control_validation: str or - ~azure.mgmt.appcontainers.models.ManagedCertificateDomainControlValidation - :ivar validation_token: A TXT token used for DNS TXT domain control validation when issuing - this type of managed certificates. - :vartype validation_token: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "error": {"readonly": True}, - "validation_token": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "subject_name": {"key": "subjectName", "type": "str"}, - "error": {"key": "error", "type": "str"}, - "domain_control_validation": {"key": "domainControlValidation", "type": "str"}, - "validation_token": {"key": "validationToken", "type": "str"}, - } - - def __init__( - self, - *, - subject_name: Optional[str] = None, - domain_control_validation: Optional[Union[str, "_models.ManagedCertificateDomainControlValidation"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword subject_name: Subject name of the certificate. - :paramtype subject_name: str - :keyword domain_control_validation: Selected type of domain control validation for managed - certificates. Known values are: "CNAME", "HTTP", and "TXT". - :paramtype domain_control_validation: str or - ~azure.mgmt.appcontainers.models.ManagedCertificateDomainControlValidation - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.subject_name = subject_name - self.error = None - self.domain_control_validation = domain_control_validation - self.validation_token = None - - -class ManagedEnvironment(TrackedResource): # pylint: disable=too-many-instance-attributes - """An environment for hosting container apps. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar kind: Kind of the Environment. - :vartype kind: str - :ivar identity: Managed identities for the Managed Environment to interact with other Azure - services without maintaining any secrets or credentials in code. - :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :ivar provisioning_state: Provisioning state of the Environment. Known values are: "Succeeded", - "Failed", "Canceled", "Waiting", "InitializationInProgress", "InfrastructureSetupInProgress", - "InfrastructureSetupComplete", "ScheduledForDelete", "UpgradeRequested", and "UpgradeFailed". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.EnvironmentProvisioningState - :ivar dapr_ai_instrumentation_key: Azure Monitor instrumentation key used by Dapr to export - Service to Service communication telemetry. - :vartype dapr_ai_instrumentation_key: str - :ivar dapr_ai_connection_string: Application Insights connection string used by Dapr to export - Service to Service communication telemetry. - :vartype dapr_ai_connection_string: str - :ivar vnet_configuration: Vnet configuration for the environment. - :vartype vnet_configuration: ~azure.mgmt.appcontainers.models.VnetConfiguration - :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. - :vartype deployment_errors: str - :ivar default_domain: Default Domain Name for the cluster. - :vartype default_domain: str - :ivar static_ip: Static IP of the Environment. - :vartype static_ip: str - :ivar app_logs_configuration: Cluster configuration which enables the log daemon to export - app logs to a destination. Currently only "log-analytics" is - supported. - :vartype app_logs_configuration: ~azure.mgmt.appcontainers.models.AppLogsConfiguration - :ivar app_insights_configuration: Environment level Application Insights configuration. - :vartype app_insights_configuration: ~azure.mgmt.appcontainers.models.AppInsightsConfiguration - :ivar open_telemetry_configuration: Environment Open Telemetry configuration. - :vartype open_telemetry_configuration: - ~azure.mgmt.appcontainers.models.OpenTelemetryConfiguration - :ivar zone_redundant: Whether or not this Managed Environment is zone-redundant. - :vartype zone_redundant: bool - :ivar custom_domain_configuration: Custom domain configuration for the environment. - :vartype custom_domain_configuration: - ~azure.mgmt.appcontainers.models.CustomDomainConfiguration - :ivar event_stream_endpoint: The endpoint of the eventstream of the Environment. - :vartype event_stream_endpoint: str - :ivar workload_profiles: Workload profiles configured for the Managed Environment. - :vartype workload_profiles: list[~azure.mgmt.appcontainers.models.WorkloadProfile] - :ivar keda_configuration: The configuration of Keda component. - :vartype keda_configuration: ~azure.mgmt.appcontainers.models.KedaConfiguration - :ivar dapr_configuration: The configuration of Dapr component. - :vartype dapr_configuration: ~azure.mgmt.appcontainers.models.DaprConfiguration - :ivar infrastructure_resource_group: Name of the platform-managed resource group created for - the Managed Environment to host infrastructure resources. If a subnet ID is provided, this - resource group will be created in the same subscription as the subnet. - :vartype infrastructure_resource_group: str - :ivar peer_authentication: Peer authentication settings for the Managed Environment. - :vartype peer_authentication: - ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication - :ivar peer_traffic_configuration: Peer traffic settings for the Managed Environment. - :vartype peer_traffic_configuration: - ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration - :ivar private_endpoint_connections: Private endpoint connections to the resource. - :vartype private_endpoint_connections: - list[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :ivar public_network_access: Property to allow or block all public traffic. Allowed Values: - 'Enabled', 'Disabled'. Known values are: "Enabled" and "Disabled". - :vartype public_network_access: str or ~azure.mgmt.appcontainers.models.PublicNetworkAccess - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "provisioning_state": {"readonly": True}, - "deployment_errors": {"readonly": True}, - "default_domain": {"readonly": True}, - "static_ip": {"readonly": True}, - "event_stream_endpoint": {"readonly": True}, - "private_endpoint_connections": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "dapr_ai_instrumentation_key": {"key": "properties.daprAIInstrumentationKey", "type": "str"}, - "dapr_ai_connection_string": {"key": "properties.daprAIConnectionString", "type": "str"}, - "vnet_configuration": {"key": "properties.vnetConfiguration", "type": "VnetConfiguration"}, - "deployment_errors": {"key": "properties.deploymentErrors", "type": "str"}, - "default_domain": {"key": "properties.defaultDomain", "type": "str"}, - "static_ip": {"key": "properties.staticIp", "type": "str"}, - "app_logs_configuration": {"key": "properties.appLogsConfiguration", "type": "AppLogsConfiguration"}, - "app_insights_configuration": { - "key": "properties.appInsightsConfiguration", - "type": "AppInsightsConfiguration", - }, - "open_telemetry_configuration": { - "key": "properties.openTelemetryConfiguration", - "type": "OpenTelemetryConfiguration", - }, - "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, - "custom_domain_configuration": { - "key": "properties.customDomainConfiguration", - "type": "CustomDomainConfiguration", - }, - "event_stream_endpoint": {"key": "properties.eventStreamEndpoint", "type": "str"}, - "workload_profiles": {"key": "properties.workloadProfiles", "type": "[WorkloadProfile]"}, - "keda_configuration": {"key": "properties.kedaConfiguration", "type": "KedaConfiguration"}, - "dapr_configuration": {"key": "properties.daprConfiguration", "type": "DaprConfiguration"}, - "infrastructure_resource_group": {"key": "properties.infrastructureResourceGroup", "type": "str"}, - "peer_authentication": { - "key": "properties.peerAuthentication", - "type": "ManagedEnvironmentPropertiesPeerAuthentication", - }, - "peer_traffic_configuration": { - "key": "properties.peerTrafficConfiguration", - "type": "ManagedEnvironmentPropertiesPeerTrafficConfiguration", - }, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[PrivateEndpointConnection]", - }, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - kind: Optional[str] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - dapr_ai_instrumentation_key: Optional[str] = None, - dapr_ai_connection_string: Optional[str] = None, - vnet_configuration: Optional["_models.VnetConfiguration"] = None, - app_logs_configuration: Optional["_models.AppLogsConfiguration"] = None, - app_insights_configuration: Optional["_models.AppInsightsConfiguration"] = None, - open_telemetry_configuration: Optional["_models.OpenTelemetryConfiguration"] = None, - zone_redundant: Optional[bool] = None, - custom_domain_configuration: Optional["_models.CustomDomainConfiguration"] = None, - workload_profiles: Optional[List["_models.WorkloadProfile"]] = None, - keda_configuration: Optional["_models.KedaConfiguration"] = None, - dapr_configuration: Optional["_models.DaprConfiguration"] = None, - infrastructure_resource_group: Optional[str] = None, - peer_authentication: Optional["_models.ManagedEnvironmentPropertiesPeerAuthentication"] = None, - peer_traffic_configuration: Optional["_models.ManagedEnvironmentPropertiesPeerTrafficConfiguration"] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword kind: Kind of the Environment. - :paramtype kind: str - :keyword identity: Managed identities for the Managed Environment to interact with other Azure - services without maintaining any secrets or credentials in code. - :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity - :keyword dapr_ai_instrumentation_key: Azure Monitor instrumentation key used by Dapr to export - Service to Service communication telemetry. - :paramtype dapr_ai_instrumentation_key: str - :keyword dapr_ai_connection_string: Application Insights connection string used by Dapr to - export Service to Service communication telemetry. - :paramtype dapr_ai_connection_string: str - :keyword vnet_configuration: Vnet configuration for the environment. - :paramtype vnet_configuration: ~azure.mgmt.appcontainers.models.VnetConfiguration - :keyword app_logs_configuration: Cluster configuration which enables the log daemon to export - app logs to a destination. Currently only "log-analytics" is - supported. - :paramtype app_logs_configuration: ~azure.mgmt.appcontainers.models.AppLogsConfiguration - :keyword app_insights_configuration: Environment level Application Insights configuration. - :paramtype app_insights_configuration: - ~azure.mgmt.appcontainers.models.AppInsightsConfiguration - :keyword open_telemetry_configuration: Environment Open Telemetry configuration. - :paramtype open_telemetry_configuration: - ~azure.mgmt.appcontainers.models.OpenTelemetryConfiguration - :keyword zone_redundant: Whether or not this Managed Environment is zone-redundant. - :paramtype zone_redundant: bool - :keyword custom_domain_configuration: Custom domain configuration for the environment. - :paramtype custom_domain_configuration: - ~azure.mgmt.appcontainers.models.CustomDomainConfiguration - :keyword workload_profiles: Workload profiles configured for the Managed Environment. - :paramtype workload_profiles: list[~azure.mgmt.appcontainers.models.WorkloadProfile] - :keyword keda_configuration: The configuration of Keda component. - :paramtype keda_configuration: ~azure.mgmt.appcontainers.models.KedaConfiguration - :keyword dapr_configuration: The configuration of Dapr component. - :paramtype dapr_configuration: ~azure.mgmt.appcontainers.models.DaprConfiguration - :keyword infrastructure_resource_group: Name of the platform-managed resource group created for - the Managed Environment to host infrastructure resources. If a subnet ID is provided, this - resource group will be created in the same subscription as the subnet. - :paramtype infrastructure_resource_group: str - :keyword peer_authentication: Peer authentication settings for the Managed Environment. - :paramtype peer_authentication: - ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication - :keyword peer_traffic_configuration: Peer traffic settings for the Managed Environment. - :paramtype peer_traffic_configuration: - ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration - :keyword public_network_access: Property to allow or block all public traffic. Allowed Values: - 'Enabled', 'Disabled'. Known values are: "Enabled" and "Disabled". - :paramtype public_network_access: str or ~azure.mgmt.appcontainers.models.PublicNetworkAccess - """ - super().__init__(tags=tags, location=location, **kwargs) - self.kind = kind - self.identity = identity - self.provisioning_state = None - self.dapr_ai_instrumentation_key = dapr_ai_instrumentation_key - self.dapr_ai_connection_string = dapr_ai_connection_string - self.vnet_configuration = vnet_configuration - self.deployment_errors = None - self.default_domain = None - self.static_ip = None - self.app_logs_configuration = app_logs_configuration - self.app_insights_configuration = app_insights_configuration - self.open_telemetry_configuration = open_telemetry_configuration - self.zone_redundant = zone_redundant - self.custom_domain_configuration = custom_domain_configuration - self.event_stream_endpoint = None - self.workload_profiles = workload_profiles - self.keda_configuration = keda_configuration - self.dapr_configuration = dapr_configuration - self.infrastructure_resource_group = infrastructure_resource_group - self.peer_authentication = peer_authentication - self.peer_traffic_configuration = peer_traffic_configuration - self.private_endpoint_connections = None - self.public_network_access = public_network_access - - -class ManagedEnvironmentPropertiesPeerAuthentication(_serialization.Model): # pylint: disable=name-too-long - """Peer authentication settings for the Managed Environment. - - :ivar mtls: Mutual TLS authentication settings for the Managed Environment. - :vartype mtls: ~azure.mgmt.appcontainers.models.Mtls - """ - - _attribute_map = { - "mtls": {"key": "mtls", "type": "Mtls"}, - } - - def __init__(self, *, mtls: Optional["_models.Mtls"] = None, **kwargs: Any) -> None: - """ - :keyword mtls: Mutual TLS authentication settings for the Managed Environment. - :paramtype mtls: ~azure.mgmt.appcontainers.models.Mtls - """ - super().__init__(**kwargs) - self.mtls = mtls - - -class ManagedEnvironmentPropertiesPeerTrafficConfiguration(_serialization.Model): # pylint: disable=name-too-long - """Peer traffic settings for the Managed Environment. - - :ivar encryption: Peer traffic encryption settings for the Managed Environment. - :vartype encryption: - ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption - """ - - _attribute_map = { - "encryption": {"key": "encryption", "type": "ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption"}, - } - - def __init__( - self, - *, - encryption: Optional["_models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption"] = None, - **kwargs: Any - ) -> None: - """ - :keyword encryption: Peer traffic encryption settings for the Managed Environment. - :paramtype encryption: - ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption - """ - super().__init__(**kwargs) - self.encryption = encryption - - -class ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption( - _serialization.Model -): # pylint: disable=name-too-long - """Peer traffic encryption settings for the Managed Environment. - - :ivar enabled: Boolean indicating whether the peer traffic encryption is enabled. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Boolean indicating whether the peer traffic encryption is enabled. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedEnvironmentsCollection(_serialization.Model): - """Collection of Environments. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.ManagedEnvironment] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedEnvironment]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.ManagedEnvironment"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.ManagedEnvironment] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class ManagedEnvironmentStorage(ProxyResource): - """Storage resource for managedEnvironment. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar properties: Storage properties. - :vartype properties: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorageProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "ManagedEnvironmentStorageProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.ManagedEnvironmentStorageProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: Storage properties. - :paramtype properties: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorageProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class ManagedEnvironmentStorageProperties(_serialization.Model): - """Storage properties. - - :ivar azure_file: Azure file properties. - :vartype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties - :ivar nfs_azure_file: NFS Azure file properties. - :vartype nfs_azure_file: ~azure.mgmt.appcontainers.models.NfsAzureFileProperties - """ - - _attribute_map = { - "azure_file": {"key": "azureFile", "type": "AzureFileProperties"}, - "nfs_azure_file": {"key": "nfsAzureFile", "type": "NfsAzureFileProperties"}, - } - - def __init__( - self, - *, - azure_file: Optional["_models.AzureFileProperties"] = None, - nfs_azure_file: Optional["_models.NfsAzureFileProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword azure_file: Azure file properties. - :paramtype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties - :keyword nfs_azure_file: NFS Azure file properties. - :paramtype nfs_azure_file: ~azure.mgmt.appcontainers.models.NfsAzureFileProperties - """ - super().__init__(**kwargs) - self.azure_file = azure_file - self.nfs_azure_file = nfs_azure_file - - -class ManagedEnvironmentStoragesCollection(_serialization.Model): - """Collection of Storage for Environments. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of storage resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage] - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedEnvironmentStorage]"}, - } - - def __init__(self, *, value: List["_models.ManagedEnvironmentStorage"], **kwargs: Any) -> None: - """ - :keyword value: Collection of storage resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage] - """ - super().__init__(**kwargs) - self.value = value - - -class ManagedServiceIdentity(_serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Type of managed service identity (where both SystemAssigned and UserAssigned types - are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and - "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.appcontainers.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.appcontainers.models.UserAssignedIdentity] - """ - - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - "type": {"required": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, - } - - def __init__( - self, - *, - type: Union[str, "_models.ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: Type of managed service identity (where both SystemAssigned and UserAssigned - types are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and - "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.appcontainers.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.appcontainers.models.UserAssignedIdentity] - """ - super().__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class MetricsConfiguration(_serialization.Model): - """Configuration of Open Telemetry metrics. - - :ivar include_keda: Boolean indicating if including keda metrics. - :vartype include_keda: bool - :ivar destinations: Open telemetry metrics destinations. - :vartype destinations: list[str] - """ - - _attribute_map = { - "include_keda": {"key": "includeKeda", "type": "bool"}, - "destinations": {"key": "destinations", "type": "[str]"}, - } - - def __init__( - self, *, include_keda: Optional[bool] = None, destinations: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword include_keda: Boolean indicating if including keda metrics. - :paramtype include_keda: bool - :keyword destinations: Open telemetry metrics destinations. - :paramtype destinations: list[str] - """ - super().__init__(**kwargs) - self.include_keda = include_keda - self.destinations = destinations - - -class Mtls(_serialization.Model): - """Configuration properties for mutual TLS authentication. - - :ivar enabled: Boolean indicating whether the mutual TLS authentication is enabled. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Boolean indicating whether the mutual TLS authentication is enabled. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class NacosComponent(JavaComponentProperties): - """Nacos properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar component_type: Type of the Java Component. Required. Known values are: - "SpringBootAdmin", "SpringCloudEureka", "SpringCloudConfig", "SpringCloudGateway", and "Nacos". - :vartype component_type: str or ~azure.mgmt.appcontainers.models.JavaComponentType - :ivar provisioning_state: Provisioning state of the Java Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.JavaComponentProvisioningState - :ivar configurations: List of Java Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :ivar scale: Java component scaling configurations. - :vartype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :ivar service_binds: List of Java Components that are bound to the Java component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - :ivar ingress: Java Component Ingress configurations. - :vartype ingress: ~azure.mgmt.appcontainers.models.JavaComponentIngress - """ - - _validation = { - "component_type": {"required": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "component_type": {"key": "componentType", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "configurations": {"key": "configurations", "type": "[JavaComponentConfigurationProperty]"}, - "scale": {"key": "scale", "type": "JavaComponentPropertiesScale"}, - "service_binds": {"key": "serviceBinds", "type": "[JavaComponentServiceBind]"}, - "ingress": {"key": "ingress", "type": "JavaComponentIngress"}, - } - - def __init__( - self, - *, - configurations: Optional[List["_models.JavaComponentConfigurationProperty"]] = None, - scale: Optional["_models.JavaComponentPropertiesScale"] = None, - service_binds: Optional[List["_models.JavaComponentServiceBind"]] = None, - ingress: Optional["_models.JavaComponentIngress"] = None, - **kwargs: Any - ) -> None: - """ - :keyword configurations: List of Java Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :keyword scale: Java component scaling configurations. - :paramtype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :keyword service_binds: List of Java Components that are bound to the Java component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - :keyword ingress: Java Component Ingress configurations. - :paramtype ingress: ~azure.mgmt.appcontainers.models.JavaComponentIngress - """ - super().__init__(configurations=configurations, scale=scale, service_binds=service_binds, **kwargs) - self.component_type: str = "Nacos" - self.ingress = ingress - - -class NfsAzureFileProperties(_serialization.Model): - """NFS Azure File Properties. - - :ivar server: Server for NFS azure file. - :vartype server: str - :ivar access_mode: Access mode for storage. Known values are: "ReadOnly" and "ReadWrite". - :vartype access_mode: str or ~azure.mgmt.appcontainers.models.AccessMode - :ivar share_name: NFS Azure file share name. - :vartype share_name: str - """ - - _attribute_map = { - "server": {"key": "server", "type": "str"}, - "access_mode": {"key": "accessMode", "type": "str"}, - "share_name": {"key": "shareName", "type": "str"}, - } - - def __init__( - self, - *, - server: Optional[str] = None, - access_mode: Optional[Union[str, "_models.AccessMode"]] = None, - share_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword server: Server for NFS azure file. - :paramtype server: str - :keyword access_mode: Access mode for storage. Known values are: "ReadOnly" and "ReadWrite". - :paramtype access_mode: str or ~azure.mgmt.appcontainers.models.AccessMode - :keyword share_name: NFS Azure file share name. - :paramtype share_name: str - """ - super().__init__(**kwargs) - self.server = server - self.access_mode = access_mode - self.share_name = share_name - - -class Nonce(_serialization.Model): - """The configuration settings of the nonce used in the login flow. - - :ivar validate_nonce: :code:`false` if the nonce should not be validated while - completing the login flow; otherwise, :code:`true`. - :vartype validate_nonce: bool - :ivar nonce_expiration_interval: The time after the request is made when the nonce should - expire. - :vartype nonce_expiration_interval: str - """ - - _attribute_map = { - "validate_nonce": {"key": "validateNonce", "type": "bool"}, - "nonce_expiration_interval": {"key": "nonceExpirationInterval", "type": "str"}, - } - - def __init__( - self, *, validate_nonce: Optional[bool] = None, nonce_expiration_interval: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword validate_nonce: :code:`false` if the nonce should not be validated while - completing the login flow; otherwise, :code:`true`. - :paramtype validate_nonce: bool - :keyword nonce_expiration_interval: The time after the request is made when the nonce should - expire. - :paramtype nonce_expiration_interval: str - """ - super().__init__(**kwargs) - self.validate_nonce = validate_nonce - self.nonce_expiration_interval = nonce_expiration_interval - - -class OpenIdConnectClientCredential(_serialization.Model): - """The authentication client credentials of the custom Open ID Connect provider. - - :ivar method: The method that should be used to authenticate the user. Default value is - "ClientSecretPost". - :vartype method: str - :ivar client_secret_setting_name: The app setting that contains the client secret for the - custom Open ID Connect provider. - :vartype client_secret_setting_name: str - """ - - _attribute_map = { - "method": {"key": "method", "type": "str"}, - "client_secret_setting_name": {"key": "clientSecretSettingName", "type": "str"}, - } + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + } def __init__( self, *, - method: Optional[Literal["ClientSecretPost"]] = None, - client_secret_setting_name: Optional[str] = None, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin **kwargs: Any ) -> None: """ - :keyword method: The method that should be used to authenticate the user. Default value is - "ClientSecretPost". - :paramtype method: str - :keyword client_secret_setting_name: The app setting that contains the client secret for the - custom Open ID Connect provider. - :paramtype client_secret_setting_name: str + :keyword name: Job execution name. + :paramtype name: str + :keyword id: Job execution Id. + :paramtype id: str """ super().__init__(**kwargs) - self.method = method - self.client_secret_setting_name = client_secret_setting_name + self.name = name + self.id = id -class OpenIdConnectConfig(_serialization.Model): - """The configuration settings of the endpoints used for the custom Open ID Connect provider. +class JobExecutionContainer(_serialization.Model): + """Container Apps Jobs execution container definition. - :ivar authorization_endpoint: The endpoint to be used to make an authorization request. - :vartype authorization_endpoint: str - :ivar token_endpoint: The endpoint to be used to request a token. - :vartype token_endpoint: str - :ivar issuer: The endpoint that issues the token. - :vartype issuer: str - :ivar certification_uri: The endpoint that provides the keys necessary to validate the token. - :vartype certification_uri: str - :ivar well_known_open_id_configuration: The endpoint that contains all the configuration - endpoints for the provider. - :vartype well_known_open_id_configuration: str + :ivar image: Container image tag. + :vartype image: str + :ivar name: Custom container name. + :vartype name: str + :ivar command: Container start command. + :vartype command: list[str] + :ivar args: Container start command arguments. + :vartype args: list[str] + :ivar env: Container environment variables. + :vartype env: list[~azure.mgmt.appcontainers.models.EnvironmentVar] + :ivar resources: Container resource requirements. + :vartype resources: ~azure.mgmt.appcontainers.models.ContainerResources """ _attribute_map = { - "authorization_endpoint": {"key": "authorizationEndpoint", "type": "str"}, - "token_endpoint": {"key": "tokenEndpoint", "type": "str"}, - "issuer": {"key": "issuer", "type": "str"}, - "certification_uri": {"key": "certificationUri", "type": "str"}, - "well_known_open_id_configuration": {"key": "wellKnownOpenIdConfiguration", "type": "str"}, + "image": {"key": "image", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "command": {"key": "command", "type": "[str]"}, + "args": {"key": "args", "type": "[str]"}, + "env": {"key": "env", "type": "[EnvironmentVar]"}, + "resources": {"key": "resources", "type": "ContainerResources"}, } def __init__( self, - *, - authorization_endpoint: Optional[str] = None, - token_endpoint: Optional[str] = None, - issuer: Optional[str] = None, - certification_uri: Optional[str] = None, - well_known_open_id_configuration: Optional[str] = None, + *, + image: Optional[str] = None, + name: Optional[str] = None, + command: Optional[List[str]] = None, + args: Optional[List[str]] = None, + env: Optional[List["_models.EnvironmentVar"]] = None, + resources: Optional["_models.ContainerResources"] = None, **kwargs: Any ) -> None: """ - :keyword authorization_endpoint: The endpoint to be used to make an authorization request. - :paramtype authorization_endpoint: str - :keyword token_endpoint: The endpoint to be used to request a token. - :paramtype token_endpoint: str - :keyword issuer: The endpoint that issues the token. - :paramtype issuer: str - :keyword certification_uri: The endpoint that provides the keys necessary to validate the - token. - :paramtype certification_uri: str - :keyword well_known_open_id_configuration: The endpoint that contains all the configuration - endpoints for the provider. - :paramtype well_known_open_id_configuration: str + :keyword image: Container image tag. + :paramtype image: str + :keyword name: Custom container name. + :paramtype name: str + :keyword command: Container start command. + :paramtype command: list[str] + :keyword args: Container start command arguments. + :paramtype args: list[str] + :keyword env: Container environment variables. + :paramtype env: list[~azure.mgmt.appcontainers.models.EnvironmentVar] + :keyword resources: Container resource requirements. + :paramtype resources: ~azure.mgmt.appcontainers.models.ContainerResources """ super().__init__(**kwargs) - self.authorization_endpoint = authorization_endpoint - self.token_endpoint = token_endpoint - self.issuer = issuer - self.certification_uri = certification_uri - self.well_known_open_id_configuration = well_known_open_id_configuration + self.image = image + self.name = name + self.command = command + self.args = args + self.env = env + self.resources = resources -class OpenIdConnectLogin(_serialization.Model): - """The configuration settings of the login flow of the custom Open ID Connect provider. +class JobExecutionNamesCollection(_serialization.Model): + """Container App executions names list. - :ivar name_claim_type: The name of the claim that contains the users name. - :vartype name_claim_type: str - :ivar scopes: A list of the scopes that should be requested while authenticating. - :vartype scopes: list[str] + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.JobExecutionBase] """ + _validation = { + "value": {"required": True}, + } + _attribute_map = { - "name_claim_type": {"key": "nameClaimType", "type": "str"}, - "scopes": {"key": "scopes", "type": "[str]"}, + "value": {"key": "value", "type": "[JobExecutionBase]"}, } - def __init__( - self, *, name_claim_type: Optional[str] = None, scopes: Optional[List[str]] = None, **kwargs: Any - ) -> None: + def __init__(self, *, value: List["_models.JobExecutionBase"], **kwargs: Any) -> None: """ - :keyword name_claim_type: The name of the claim that contains the users name. - :paramtype name_claim_type: str - :keyword scopes: A list of the scopes that should be requested while authenticating. - :paramtype scopes: list[str] + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.JobExecutionBase] """ super().__init__(**kwargs) - self.name_claim_type = name_claim_type - self.scopes = scopes + self.value = value -class OpenIdConnectRegistration(_serialization.Model): - """The configuration settings of the app registration for the custom Open ID Connect provider. +class JobExecutionTemplate(_serialization.Model): + """Job's execution template, containing container configuration for a job's execution. - :ivar client_id: The client id of the custom Open ID Connect provider. - :vartype client_id: str - :ivar client_credential: The authentication credentials of the custom Open ID Connect provider. - :vartype client_credential: ~azure.mgmt.appcontainers.models.OpenIdConnectClientCredential - :ivar open_id_connect_configuration: The configuration settings of the endpoints used for the - custom Open ID Connect provider. - :vartype open_id_connect_configuration: ~azure.mgmt.appcontainers.models.OpenIdConnectConfig + :ivar containers: List of container definitions for the Container Apps Job. + :vartype containers: list[~azure.mgmt.appcontainers.models.JobExecutionContainer] + :ivar init_containers: List of specialized containers that run before job containers. + :vartype init_containers: list[~azure.mgmt.appcontainers.models.JobExecutionContainer] """ _attribute_map = { - "client_id": {"key": "clientId", "type": "str"}, - "client_credential": {"key": "clientCredential", "type": "OpenIdConnectClientCredential"}, - "open_id_connect_configuration": {"key": "openIdConnectConfiguration", "type": "OpenIdConnectConfig"}, + "containers": {"key": "containers", "type": "[JobExecutionContainer]"}, + "init_containers": {"key": "initContainers", "type": "[JobExecutionContainer]"}, } def __init__( self, *, - client_id: Optional[str] = None, - client_credential: Optional["_models.OpenIdConnectClientCredential"] = None, - open_id_connect_configuration: Optional["_models.OpenIdConnectConfig"] = None, + containers: Optional[List["_models.JobExecutionContainer"]] = None, + init_containers: Optional[List["_models.JobExecutionContainer"]] = None, **kwargs: Any ) -> None: """ - :keyword client_id: The client id of the custom Open ID Connect provider. - :paramtype client_id: str - :keyword client_credential: The authentication credentials of the custom Open ID Connect - provider. - :paramtype client_credential: ~azure.mgmt.appcontainers.models.OpenIdConnectClientCredential - :keyword open_id_connect_configuration: The configuration settings of the endpoints used for - the custom Open ID Connect provider. - :paramtype open_id_connect_configuration: ~azure.mgmt.appcontainers.models.OpenIdConnectConfig + :keyword containers: List of container definitions for the Container Apps Job. + :paramtype containers: list[~azure.mgmt.appcontainers.models.JobExecutionContainer] + :keyword init_containers: List of specialized containers that run before job containers. + :paramtype init_containers: list[~azure.mgmt.appcontainers.models.JobExecutionContainer] """ super().__init__(**kwargs) - self.client_id = client_id - self.client_credential = client_credential - self.open_id_connect_configuration = open_id_connect_configuration + self.containers = containers + self.init_containers = init_containers -class OpenTelemetryConfiguration(_serialization.Model): - """Configuration of Open Telemetry. +class JobPatchProperties(_serialization.Model): + """Container Apps Job resource specific properties. - :ivar destinations_configuration: Open telemetry destinations configuration. - :vartype destinations_configuration: ~azure.mgmt.appcontainers.models.DestinationsConfiguration - :ivar traces_configuration: Open telemetry trace configuration. - :vartype traces_configuration: ~azure.mgmt.appcontainers.models.TracesConfiguration - :ivar logs_configuration: Open telemetry logs configuration. - :vartype logs_configuration: ~azure.mgmt.appcontainers.models.LogsConfiguration - :ivar metrics_configuration: Open telemetry metrics configuration. - :vartype metrics_configuration: ~azure.mgmt.appcontainers.models.MetricsConfiguration + :ivar identity: Managed identities needed by a container app job to interact with other Azure + services to not maintain any secrets or credentials in code. + :vartype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: + :vartype properties: ~azure.mgmt.appcontainers.models.JobPatchPropertiesProperties """ _attribute_map = { - "destinations_configuration": {"key": "destinationsConfiguration", "type": "DestinationsConfiguration"}, - "traces_configuration": {"key": "tracesConfiguration", "type": "TracesConfiguration"}, - "logs_configuration": {"key": "logsConfiguration", "type": "LogsConfiguration"}, - "metrics_configuration": {"key": "metricsConfiguration", "type": "MetricsConfiguration"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "tags": {"key": "tags", "type": "{str}"}, + "properties": {"key": "properties", "type": "JobPatchPropertiesProperties"}, } def __init__( self, *, - destinations_configuration: Optional["_models.DestinationsConfiguration"] = None, - traces_configuration: Optional["_models.TracesConfiguration"] = None, - logs_configuration: Optional["_models.LogsConfiguration"] = None, - metrics_configuration: Optional["_models.MetricsConfiguration"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.JobPatchPropertiesProperties"] = None, **kwargs: Any ) -> None: """ - :keyword destinations_configuration: Open telemetry destinations configuration. - :paramtype destinations_configuration: - ~azure.mgmt.appcontainers.models.DestinationsConfiguration - :keyword traces_configuration: Open telemetry trace configuration. - :paramtype traces_configuration: ~azure.mgmt.appcontainers.models.TracesConfiguration - :keyword logs_configuration: Open telemetry logs configuration. - :paramtype logs_configuration: ~azure.mgmt.appcontainers.models.LogsConfiguration - :keyword metrics_configuration: Open telemetry metrics configuration. - :paramtype metrics_configuration: ~azure.mgmt.appcontainers.models.MetricsConfiguration + :keyword identity: Managed identities needed by a container app job to interact with other + Azure services to not maintain any secrets or credentials in code. + :paramtype identity: ~azure.mgmt.appcontainers.models.ManagedServiceIdentity + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword properties: + :paramtype properties: ~azure.mgmt.appcontainers.models.JobPatchPropertiesProperties """ super().__init__(**kwargs) - self.destinations_configuration = destinations_configuration - self.traces_configuration = traces_configuration - self.logs_configuration = logs_configuration - self.metrics_configuration = metrics_configuration + self.identity = identity + self.tags = tags + self.properties = properties -class OperationDetail(_serialization.Model): - """Operation detail payload. +class JobPatchPropertiesProperties(_serialization.Model): + """JobPatchPropertiesProperties. - :ivar name: Name of the operation. - :vartype name: str - :ivar is_data_action: Indicates whether the operation is a data action. - :vartype is_data_action: bool - :ivar display: Display of the operation. - :vartype display: ~azure.mgmt.appcontainers.models.OperationDisplay - :ivar origin: Origin of the operation. - :vartype origin: str + :ivar environment_id: Resource ID of environment. + :vartype environment_id: str + :ivar configuration: Container Apps Job configuration properties. + :vartype configuration: ~azure.mgmt.appcontainers.models.JobConfiguration + :ivar template: Container Apps job definition. + :vartype template: ~azure.mgmt.appcontainers.models.JobTemplate + :ivar outbound_ip_addresses: Outbound IP Addresses of a container apps job. + :vartype outbound_ip_addresses: list[str] + :ivar event_stream_endpoint: The endpoint of the eventstream of the container apps job. + :vartype event_stream_endpoint: str """ _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_data_action": {"key": "isDataAction", "type": "bool"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, + "environment_id": {"key": "environmentId", "type": "str"}, + "configuration": {"key": "configuration", "type": "JobConfiguration"}, + "template": {"key": "template", "type": "JobTemplate"}, + "outbound_ip_addresses": {"key": "outboundIpAddresses", "type": "[str]"}, + "event_stream_endpoint": {"key": "eventStreamEndpoint", "type": "str"}, } def __init__( self, *, - name: Optional[str] = None, - is_data_action: Optional[bool] = None, - display: Optional["_models.OperationDisplay"] = None, - origin: Optional[str] = None, + environment_id: Optional[str] = None, + configuration: Optional["_models.JobConfiguration"] = None, + template: Optional["_models.JobTemplate"] = None, + outbound_ip_addresses: Optional[List[str]] = None, + event_stream_endpoint: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword name: Name of the operation. - :paramtype name: str - :keyword is_data_action: Indicates whether the operation is a data action. - :paramtype is_data_action: bool - :keyword display: Display of the operation. - :paramtype display: ~azure.mgmt.appcontainers.models.OperationDisplay - :keyword origin: Origin of the operation. - :paramtype origin: str + :keyword environment_id: Resource ID of environment. + :paramtype environment_id: str + :keyword configuration: Container Apps Job configuration properties. + :paramtype configuration: ~azure.mgmt.appcontainers.models.JobConfiguration + :keyword template: Container Apps job definition. + :paramtype template: ~azure.mgmt.appcontainers.models.JobTemplate + :keyword outbound_ip_addresses: Outbound IP Addresses of a container apps job. + :paramtype outbound_ip_addresses: list[str] + :keyword event_stream_endpoint: The endpoint of the eventstream of the container apps job. + :paramtype event_stream_endpoint: str """ super().__init__(**kwargs) - self.name = name - self.is_data_action = is_data_action - self.display = display - self.origin = origin + self.environment_id = environment_id + self.configuration = configuration + self.template = template + self.outbound_ip_addresses = outbound_ip_addresses + self.event_stream_endpoint = event_stream_endpoint -class OperationDisplay(_serialization.Model): - """Operation display payload. +class JobScale(_serialization.Model): + """Scaling configurations for event driven jobs. - :ivar provider: Resource provider of the operation. - :vartype provider: str - :ivar resource: Resource of the operation. - :vartype resource: str - :ivar operation: Localized friendly name for the operation. - :vartype operation: str - :ivar description: Localized friendly description for the operation. - :vartype description: str + :ivar polling_interval: Interval to check each event source in seconds. Defaults to 30s. + :vartype polling_interval: int + :ivar min_executions: Minimum number of job executions that are created for a trigger, default + 0. + :vartype min_executions: int + :ivar max_executions: Maximum number of job executions that are created for a trigger, default + 100. + :vartype max_executions: int + :ivar rules: Scaling rules. + :vartype rules: list[~azure.mgmt.appcontainers.models.JobScaleRule] """ _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, + "polling_interval": {"key": "pollingInterval", "type": "int"}, + "min_executions": {"key": "minExecutions", "type": "int"}, + "max_executions": {"key": "maxExecutions", "type": "int"}, + "rules": {"key": "rules", "type": "[JobScaleRule]"}, } def __init__( self, *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, + polling_interval: Optional[int] = None, + min_executions: int = 0, + max_executions: int = 100, + rules: Optional[List["_models.JobScaleRule"]] = None, **kwargs: Any - ) -> None: - """ - :keyword provider: Resource provider of the operation. - :paramtype provider: str - :keyword resource: Resource of the operation. - :paramtype resource: str - :keyword operation: Localized friendly name for the operation. - :paramtype operation: str - :keyword description: Localized friendly description for the operation. - :paramtype description: str + ) -> None: + """ + :keyword polling_interval: Interval to check each event source in seconds. Defaults to 30s. + :paramtype polling_interval: int + :keyword min_executions: Minimum number of job executions that are created for a trigger, + default 0. + :paramtype min_executions: int + :keyword max_executions: Maximum number of job executions that are created for a trigger, + default 100. + :paramtype max_executions: int + :keyword rules: Scaling rules. + :paramtype rules: list[~azure.mgmt.appcontainers.models.JobScaleRule] """ super().__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description + self.polling_interval = polling_interval + self.min_executions = min_executions + self.max_executions = max_executions + self.rules = rules -class OtlpConfiguration(_serialization.Model): - """Configuration of otlp. +class JobScaleRule(_serialization.Model): + """Scaling rule. - :ivar name: The name of otlp configuration. + :ivar name: Scale Rule Name. :vartype name: str - :ivar endpoint: The endpoint of otlp configuration. - :vartype endpoint: str - :ivar insecure: Boolean indicating if otlp configuration is insecure. - :vartype insecure: bool - :ivar headers: Headers of otlp configurations. - :vartype headers: list[~azure.mgmt.appcontainers.models.Header] + :ivar type: Type of the scale rule + eg: azure-servicebus, redis etc. + :vartype type: str + :ivar metadata: Metadata properties to describe the scale rule. + :vartype metadata: JSON + :ivar auth: Authentication secrets for the scale rule. + :vartype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] + :ivar identity: The resource ID of a user-assigned managed identity that is assigned to the + Container App, or 'system' for system-assigned identity. + :vartype identity: str """ _attribute_map = { "name": {"key": "name", "type": "str"}, - "endpoint": {"key": "endpoint", "type": "str"}, - "insecure": {"key": "insecure", "type": "bool"}, - "headers": {"key": "headers", "type": "[Header]"}, + "type": {"key": "type", "type": "str"}, + "metadata": {"key": "metadata", "type": "object"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + "identity": {"key": "identity", "type": "str"}, } def __init__( self, *, name: Optional[str] = None, - endpoint: Optional[str] = None, - insecure: Optional[bool] = None, - headers: Optional[List["_models.Header"]] = None, + type: Optional[str] = None, + metadata: Optional[JSON] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + identity: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword name: The name of otlp configuration. + :keyword name: Scale Rule Name. :paramtype name: str - :keyword endpoint: The endpoint of otlp configuration. - :paramtype endpoint: str - :keyword insecure: Boolean indicating if otlp configuration is insecure. - :paramtype insecure: bool - :keyword headers: Headers of otlp configurations. - :paramtype headers: list[~azure.mgmt.appcontainers.models.Header] + :keyword type: Type of the scale rule + eg: azure-servicebus, redis etc. + :paramtype type: str + :keyword metadata: Metadata properties to describe the scale rule. + :paramtype metadata: JSON + :keyword auth: Authentication secrets for the scale rule. + :paramtype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] + :keyword identity: The resource ID of a user-assigned managed identity that is assigned to the + Container App, or 'system' for system-assigned identity. + :paramtype identity: str """ super().__init__(**kwargs) self.name = name - self.endpoint = endpoint - self.insecure = insecure - self.headers = headers + self.type = type + self.metadata = metadata + self.auth = auth + self.identity = identity -class PatchCollection(_serialization.Model): - """Container App patch collection. +class JobsCollection(_serialization.Model): + """Container Apps Jobs collection ARM resource. + + Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar value: Collection of patch resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.ContainerAppsPatchResource] - :ivar next_link: the link to the next page of items. + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.Job] + :ivar next_link: Link to next page of resources. :vartype next_link: str """ _validation = { "value": {"required": True}, + "next_link": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[ContainerAppsPatchResource]"}, + "value": {"key": "value", "type": "[Job]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, *, value: List["_models.ContainerAppsPatchResource"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: + def __init__(self, *, value: List["_models.Job"], **kwargs: Any) -> None: """ - :keyword value: Collection of patch resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.ContainerAppsPatchResource] - :keyword next_link: the link to the next page of items. - :paramtype next_link: str + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.Job] """ super().__init__(**kwargs) self.value = value - self.next_link = next_link - + self.next_link = None -class PatchDetails(_serialization.Model): - """The detailed info of patch operation performing when applying a patch. - Variables are only populated by the server, and will be ignored when sending a request. +class JobSecretsCollection(_serialization.Model): + """Container Apps Job Secrets Collection ARM resource. All required parameters must be populated in order to send to server. - :ivar target_container_name: The name of the target container for the patch. Required. - :vartype target_container_name: str - :ivar target_image: The name of the target image for the patch. Required. - :vartype target_image: str - :ivar last_detection_time: The UTC timestamp that describes the latest detection was done. - Required. - :vartype last_detection_time: ~datetime.datetime - :ivar detection_status: The status of the patch detection. Required. Known values are: - "Succeeded", "RegistryLoginFailed", and "Failed". - :vartype detection_status: str or ~azure.mgmt.appcontainers.models.DetectionStatus - :ivar new_image_name: The name of the new image created by the patch. - :vartype new_image_name: str - :ivar new_layer: New layer update details in the target image. - :vartype new_layer: ~azure.mgmt.appcontainers.models.PatchDetailsNewLayer - :ivar old_layer: The old layer details in the target image. - :vartype old_layer: ~azure.mgmt.appcontainers.models.PatchDetailsOldLayer - :ivar patch_type: The type for the patch. Known values are: "FrameworkSecurity", "OSSecurity", - "FrameworkAndOSSecurity", and "Other". - :vartype patch_type: str or ~azure.mgmt.appcontainers.models.PatchType + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.Secret] """ _validation = { - "target_container_name": {"required": True, "readonly": True}, - "target_image": {"required": True, "readonly": True}, - "last_detection_time": {"required": True, "readonly": True}, - "detection_status": {"required": True, "readonly": True}, - "new_image_name": {"readonly": True}, - "new_layer": {"readonly": True}, - "old_layer": {"readonly": True}, - "patch_type": {"readonly": True}, + "value": {"required": True}, } _attribute_map = { - "target_container_name": {"key": "targetContainerName", "type": "str"}, - "target_image": {"key": "targetImage", "type": "str"}, - "last_detection_time": {"key": "lastDetectionTime", "type": "iso-8601"}, - "detection_status": {"key": "detectionStatus", "type": "str"}, - "new_image_name": {"key": "newImageName", "type": "str"}, - "new_layer": {"key": "newLayer", "type": "PatchDetailsNewLayer"}, - "old_layer": {"key": "oldLayer", "type": "PatchDetailsOldLayer"}, - "patch_type": {"key": "patchType", "type": "str"}, + "value": {"key": "value", "type": "[Secret]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: List["_models.Secret"], **kwargs: Any) -> None: + """ + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.Secret] + """ super().__init__(**kwargs) - self.target_container_name = None - self.target_image = None - self.last_detection_time = None - self.detection_status = None - self.new_image_name = None - self.new_layer = None - self.old_layer = None - self.patch_type = None + self.value = value -class PatchDetailsNewLayer(_serialization.Model): - """New layer update details in the target image. +class JobTemplate(_serialization.Model): + """Container Apps Job versioned application definition. Defines the desired state of an immutable + revision. Any changes to this section Will result in a new revision being created. - :ivar name: The details of the new layer for the target image. - :vartype name: str - :ivar framework_and_version: The framework and its version in the new run image for the target - image. - :vartype framework_and_version: str - :ivar os_and_version: The OS name and its version in the new run image for the target image. - :vartype os_and_version: str + :ivar init_containers: List of specialized containers that run before app containers. + :vartype init_containers: list[~azure.mgmt.appcontainers.models.InitContainer] + :ivar containers: List of container definitions for the Container App. + :vartype containers: list[~azure.mgmt.appcontainers.models.Container] + :ivar volumes: List of volume definitions for the Container App. + :vartype volumes: list[~azure.mgmt.appcontainers.models.Volume] """ _attribute_map = { - "name": {"key": "name", "type": "str"}, - "framework_and_version": {"key": "frameworkAndVersion", "type": "str"}, - "os_and_version": {"key": "osAndVersion", "type": "str"}, + "init_containers": {"key": "initContainers", "type": "[InitContainer]"}, + "containers": {"key": "containers", "type": "[Container]"}, + "volumes": {"key": "volumes", "type": "[Volume]"}, } def __init__( self, *, - name: Optional[str] = None, - framework_and_version: Optional[str] = None, - os_and_version: Optional[str] = None, + init_containers: Optional[List["_models.InitContainer"]] = None, + containers: Optional[List["_models.Container"]] = None, + volumes: Optional[List["_models.Volume"]] = None, **kwargs: Any ) -> None: """ - :keyword name: The details of the new layer for the target image. - :paramtype name: str - :keyword framework_and_version: The framework and its version in the new run image for the - target image. - :paramtype framework_and_version: str - :keyword os_and_version: The OS name and its version in the new run image for the target image. - :paramtype os_and_version: str + :keyword init_containers: List of specialized containers that run before app containers. + :paramtype init_containers: list[~azure.mgmt.appcontainers.models.InitContainer] + :keyword containers: List of container definitions for the Container App. + :paramtype containers: list[~azure.mgmt.appcontainers.models.Container] + :keyword volumes: List of volume definitions for the Container App. + :paramtype volumes: list[~azure.mgmt.appcontainers.models.Volume] """ super().__init__(**kwargs) - self.name = name - self.framework_and_version = framework_and_version - self.os_and_version = os_and_version + self.init_containers = init_containers + self.containers = containers + self.volumes = volumes -class PatchDetailsOldLayer(_serialization.Model): - """The old layer details in the target image. +class JwtClaimChecks(_serialization.Model): + """The configuration settings of the checks that should be made while validating the JWT Claims. - :ivar name: The details of the old layer for the target image. - :vartype name: str - :ivar framework_and_version: The framework and its version in the old run image for the target - image. - :vartype framework_and_version: str - :ivar os_and_version: The OS name and its version in the old run image for the target image. - :vartype os_and_version: str + :ivar allowed_groups: The list of the allowed groups. + :vartype allowed_groups: list[str] + :ivar allowed_client_applications: The list of the allowed client applications. + :vartype allowed_client_applications: list[str] """ _attribute_map = { - "name": {"key": "name", "type": "str"}, - "framework_and_version": {"key": "frameworkAndVersion", "type": "str"}, - "os_and_version": {"key": "osAndVersion", "type": "str"}, + "allowed_groups": {"key": "allowedGroups", "type": "[str]"}, + "allowed_client_applications": {"key": "allowedClientApplications", "type": "[str]"}, } def __init__( self, *, - name: Optional[str] = None, - framework_and_version: Optional[str] = None, - os_and_version: Optional[str] = None, + allowed_groups: Optional[List[str]] = None, + allowed_client_applications: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword name: The details of the old layer for the target image. - :paramtype name: str - :keyword framework_and_version: The framework and its version in the old run image for the - target image. - :paramtype framework_and_version: str - :keyword os_and_version: The OS name and its version in the old run image for the target image. - :paramtype os_and_version: str + :keyword allowed_groups: The list of the allowed groups. + :paramtype allowed_groups: list[str] + :keyword allowed_client_applications: The list of the allowed client applications. + :paramtype allowed_client_applications: list[str] """ super().__init__(**kwargs) - self.name = name - self.framework_and_version = framework_and_version - self.os_and_version = os_and_version + self.allowed_groups = allowed_groups + self.allowed_client_applications = allowed_client_applications -class PatchProperties(_serialization.Model): - """Top level properties that describes current states of the patch resource. +class KedaConfiguration(_serialization.Model): + """Configuration properties Keda component. Variables are only populated by the server, and will be ignored when sending a request. - :ivar target_environment_id: The Azure resource id of the target environment for the patch. - :vartype target_environment_id: str - :ivar target_container_app_id: The Azure resource id of the target container app for the patch. - :vartype target_container_app_id: str - :ivar target_revision_id: The Azure resource id of the target revision for the patch. - :vartype target_revision_id: str - :ivar patch_apply_status: The status of the patch operation. Known values are: "NotStarted", - "RebaseInProgress", "CreatingRevision", "Succeeded", "Canceled", "RebaseFailed", - "RevisionCreationFailed", "ImagePushPullFailed", and "ManuallySkipped". - :vartype patch_apply_status: str or ~azure.mgmt.appcontainers.models.PatchApplyStatus - :ivar created_at: The UTC timestamp that describes when the patch object was created. - :vartype created_at: ~datetime.datetime - :ivar last_modified_at: The UTC timestamp that describes when the patch object was last - updated. - :vartype last_modified_at: ~datetime.datetime - :ivar patch_details: Detailed info describes the patch operation for the target container app. - :vartype patch_details: list[~azure.mgmt.appcontainers.models.PatchDetails] + :ivar version: The version of Keda. + :vartype version: str """ _validation = { - "patch_apply_status": {"readonly": True}, - "created_at": {"readonly": True}, - "last_modified_at": {"readonly": True}, - "patch_details": {"readonly": True}, - } - - _attribute_map = { - "target_environment_id": {"key": "targetEnvironmentId", "type": "str"}, - "target_container_app_id": {"key": "targetContainerAppId", "type": "str"}, - "target_revision_id": {"key": "targetRevisionId", "type": "str"}, - "patch_apply_status": {"key": "patchApplyStatus", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - "patch_details": {"key": "patchDetails", "type": "[PatchDetails]"}, + "version": {"readonly": True}, } - def __init__( - self, - *, - target_environment_id: Optional[str] = None, - target_container_app_id: Optional[str] = None, - target_revision_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword target_environment_id: The Azure resource id of the target environment for the patch. - :paramtype target_environment_id: str - :keyword target_container_app_id: The Azure resource id of the target container app for the - patch. - :paramtype target_container_app_id: str - :keyword target_revision_id: The Azure resource id of the target revision for the patch. - :paramtype target_revision_id: str - """ - super().__init__(**kwargs) - self.target_environment_id = target_environment_id - self.target_container_app_id = target_container_app_id - self.target_revision_id = target_revision_id - self.patch_apply_status = None - self.created_at = None - self.last_modified_at = None - self.patch_details = None - - -class PatchSkipConfig(_serialization.Model): - """The configuration for patcher to skip a patch or not. - - :ivar skip: The flag to indicate whether to skip the patch or not. - :vartype skip: bool - """ - _attribute_map = { - "skip": {"key": "skip", "type": "bool"}, + "version": {"key": "version", "type": "str"}, } - def __init__(self, *, skip: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword skip: The flag to indicate whether to skip the patch or not. - :paramtype skip: bool - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.skip = skip + self.version = None -class PreBuildStep(_serialization.Model): - """Model representing a pre-build step. +class ListUsagesResult(_serialization.Model): + """ListUsagesResult. - :ivar description: Description of the pre-build step. - :vartype description: str - :ivar scripts: List of custom commands to run. - :vartype scripts: list[str] - :ivar http_get: Http get request to send before the build. - :vartype http_get: ~azure.mgmt.appcontainers.models.HttpGet + :ivar value: The list of compute resource usages. + :vartype value: list[~azure.mgmt.appcontainers.models.Usage] + :ivar next_link: The URI to fetch the next page of compute resource usage information. Call + ListNext() with this to fetch the next page of compute resource usage information. + :vartype next_link: str """ _attribute_map = { - "description": {"key": "description", "type": "str"}, - "scripts": {"key": "scripts", "type": "[str]"}, - "http_get": {"key": "httpGet", "type": "HttpGet"}, + "value": {"key": "value", "type": "[Usage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - *, - description: Optional[str] = None, - scripts: Optional[List[str]] = None, - http_get: Optional["_models.HttpGet"] = None, - **kwargs: Any + self, *, value: Optional[List["_models.Usage"]] = None, next_link: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword description: Description of the pre-build step. - :paramtype description: str - :keyword scripts: List of custom commands to run. - :paramtype scripts: list[str] - :keyword http_get: Http get request to send before the build. - :paramtype http_get: ~azure.mgmt.appcontainers.models.HttpGet + :keyword value: The list of compute resource usages. + :paramtype value: list[~azure.mgmt.appcontainers.models.Usage] + :keyword next_link: The URI to fetch the next page of compute resource usage information. Call + ListNext() with this to fetch the next page of compute resource usage information. + :paramtype next_link: str """ super().__init__(**kwargs) - self.description = description - self.scripts = scripts - self.http_get = http_get - + self.value = value + self.next_link = next_link -class PrivateEndpoint(_serialization.Model): - """The Private Endpoint resource. - Variables are only populated by the server, and will be ignored when sending a request. +class LogAnalyticsConfiguration(_serialization.Model): + """Log Analytics configuration, must only be provided when destination is configured as + 'log-analytics'. - :ivar id: The ARM identifier for Private Endpoint. - :vartype id: str + :ivar customer_id: Log analytics customer id. + :vartype customer_id: str + :ivar shared_key: Log analytics customer key. + :vartype shared_key: str """ - _validation = { - "id": {"readonly": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, + "customer_id": {"key": "customerId", "type": "str"}, + "shared_key": {"key": "sharedKey", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, customer_id: Optional[str] = None, shared_key: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword customer_id: Log analytics customer id. + :paramtype customer_id: str + :keyword shared_key: Log analytics customer key. + :paramtype shared_key: str + """ super().__init__(**kwargs) - self.id = None - + self.customer_id = customer_id + self.shared_key = shared_key -class PrivateEndpointConnection(Resource): - """The Private Endpoint Connection resource. - Variables are only populated by the server, and will be ignored when sending a request. +class Login(_serialization.Model): + """The configuration settings of the login flow of users using ContainerApp Service + Authentication/Authorization. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar group_ids: The group ids for the private endpoint resource. - :vartype group_ids: list[str] - :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~azure.mgmt.appcontainers.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between service consumer and provider. - :vartype private_link_service_connection_state: - ~azure.mgmt.appcontainers.models.PrivateLinkServiceConnectionState - :ivar provisioning_state: The provisioning state of the private endpoint connection resource. - Known values are: "Succeeded", "Failed", "Canceled", "Waiting", "Updating", "Deleting", and - "Pending". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.PrivateEndpointConnectionProvisioningState + :ivar routes: The routes that specify the endpoints used for login and logout requests. + :vartype routes: ~azure.mgmt.appcontainers.models.LoginRoutes + :ivar token_store: The configuration settings of the token store. + :vartype token_store: ~azure.mgmt.appcontainers.models.TokenStore + :ivar preserve_url_fragments_for_logins: :code:`true` if the fragments from the + request are preserved after the login request is made; otherwise, :code:`false`. + :vartype preserve_url_fragments_for_logins: bool + :ivar allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :vartype allowed_external_redirect_urls: list[str] + :ivar cookie_expiration: The configuration settings of the session cookie's expiration. + :vartype cookie_expiration: ~azure.mgmt.appcontainers.models.CookieExpiration + :ivar nonce: The configuration settings of the nonce used in the login flow. + :vartype nonce: ~azure.mgmt.appcontainers.models.Nonce """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "group_ids": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "group_ids": {"key": "properties.groupIds", "type": "[str]"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, - "private_link_service_connection_state": { - "key": "properties.privateLinkServiceConnectionState", - "type": "PrivateLinkServiceConnectionState", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "routes": {"key": "routes", "type": "LoginRoutes"}, + "token_store": {"key": "tokenStore", "type": "TokenStore"}, + "preserve_url_fragments_for_logins": {"key": "preserveUrlFragmentsForLogins", "type": "bool"}, + "allowed_external_redirect_urls": {"key": "allowedExternalRedirectUrls", "type": "[str]"}, + "cookie_expiration": {"key": "cookieExpiration", "type": "CookieExpiration"}, + "nonce": {"key": "nonce", "type": "Nonce"}, } def __init__( self, *, - private_endpoint: Optional["_models.PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, + routes: Optional["_models.LoginRoutes"] = None, + token_store: Optional["_models.TokenStore"] = None, + preserve_url_fragments_for_logins: Optional[bool] = None, + allowed_external_redirect_urls: Optional[List[str]] = None, + cookie_expiration: Optional["_models.CookieExpiration"] = None, + nonce: Optional["_models.Nonce"] = None, **kwargs: Any ) -> None: """ - :keyword private_endpoint: The resource of private end point. - :paramtype private_endpoint: ~azure.mgmt.appcontainers.models.PrivateEndpoint - :keyword private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :paramtype private_link_service_connection_state: - ~azure.mgmt.appcontainers.models.PrivateLinkServiceConnectionState + :keyword routes: The routes that specify the endpoints used for login and logout requests. + :paramtype routes: ~azure.mgmt.appcontainers.models.LoginRoutes + :keyword token_store: The configuration settings of the token store. + :paramtype token_store: ~azure.mgmt.appcontainers.models.TokenStore + :keyword preserve_url_fragments_for_logins: :code:`true` if the fragments from the + request are preserved after the login request is made; otherwise, :code:`false`. + :paramtype preserve_url_fragments_for_logins: bool + :keyword allowed_external_redirect_urls: External URLs that can be redirected to as part of + logging in or logging out of the app. Note that the query string part of the URL is ignored. + This is an advanced setting typically only needed by Windows Store application backends. + Note that URLs within the current domain are always implicitly allowed. + :paramtype allowed_external_redirect_urls: list[str] + :keyword cookie_expiration: The configuration settings of the session cookie's expiration. + :paramtype cookie_expiration: ~azure.mgmt.appcontainers.models.CookieExpiration + :keyword nonce: The configuration settings of the nonce used in the login flow. + :paramtype nonce: ~azure.mgmt.appcontainers.models.Nonce """ super().__init__(**kwargs) - self.group_ids = None - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state = None - + self.routes = routes + self.token_store = token_store + self.preserve_url_fragments_for_logins = preserve_url_fragments_for_logins + self.allowed_external_redirect_urls = allowed_external_redirect_urls + self.cookie_expiration = cookie_expiration + self.nonce = nonce -class PrivateEndpointConnectionListResult(_serialization.Model): - """List of private endpoint connection associated with the specified resource. - Variables are only populated by the server, and will be ignored when sending a request. +class LoginRoutes(_serialization.Model): + """The routes that specify the endpoints used for login and logout requests. - :ivar value: Array of private endpoint connections. - :vartype value: list[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str + :ivar logout_endpoint: The endpoint at which a logout request should be made. + :vartype logout_endpoint: str """ - _validation = { - "next_link": {"readonly": True}, + _attribute_map = { + "logout_endpoint": {"key": "logoutEndpoint", "type": "str"}, } + def __init__(self, *, logout_endpoint: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword logout_endpoint: The endpoint at which a logout request should be made. + :paramtype logout_endpoint: str + """ + super().__init__(**kwargs) + self.logout_endpoint = logout_endpoint + + +class LoginScopes(_serialization.Model): + """The configuration settings of the login flow, including the scopes that should be requested. + + :ivar scopes: A list of the scopes that should be requested while authenticating. + :vartype scopes: list[str] + """ + _attribute_map = { - "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "scopes": {"key": "scopes", "type": "[str]"}, } - def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: + def __init__(self, *, scopes: Optional[List[str]] = None, **kwargs: Any) -> None: """ - :keyword value: Array of private endpoint connections. - :paramtype value: list[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] + :keyword scopes: A list of the scopes that should be requested while authenticating. + :paramtype scopes: list[str] """ super().__init__(**kwargs) - self.value = value - self.next_link = None + self.scopes = scopes -class PrivateLinkResource(Resource): - """A private link resource. +class ManagedCertificate(TrackedResource): + """Managed certificates used for Custom Domain bindings of Container Apps in a Managed + Environment. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -10542,12 +6152,12 @@ class PrivateLinkResource(Resource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource private link DNS zone name. - :vartype required_zone_names: list[str] + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Certificate resource specific properties. + :vartype properties: ~azure.mgmt.appcontainers.models.ManagedCertificateProperties """ _validation = { @@ -10555,8 +6165,7 @@ class PrivateLinkResource(Resource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "group_id": {"readonly": True}, - "required_members": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { @@ -10564,249 +6173,152 @@ class PrivateLinkResource(Resource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "group_id": {"key": "properties.groupId", "type": "str"}, - "required_members": {"key": "properties.requiredMembers", "type": "[str]"}, - "required_zone_names": {"key": "properties.requiredZoneNames", "type": "[str]"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "ManagedCertificateProperties"}, } - def __init__(self, *, required_zone_names: Optional[List[str]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ManagedCertificateProperties"] = None, + **kwargs: Any + ) -> None: """ - :keyword required_zone_names: The private link resource private link DNS zone name. - :paramtype required_zone_names: list[str] + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword properties: Certificate resource specific properties. + :paramtype properties: ~azure.mgmt.appcontainers.models.ManagedCertificateProperties """ - super().__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = required_zone_names + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class PrivateLinkResourceListResult(_serialization.Model): - """A list of private link resources. +class ManagedCertificateCollection(_serialization.Model): + """Collection of Managed Certificates. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: Array of private link resources. - :vartype value: list[~azure.mgmt.appcontainers.models.PrivateLinkResource] - :ivar next_link: URL to get the next set of operation list results (if there are any). + All required parameters must be populated in order to send to server. + + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.ManagedCertificate] + :ivar next_link: Link to next page of resources. :vartype next_link: str """ _validation = { + "value": {"required": True}, "next_link": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[PrivateLinkResource]"}, + "value": {"key": "value", "type": "[ManagedCertificate]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.ManagedCertificate"], **kwargs: Any) -> None: """ - :keyword value: Array of private link resources. - :paramtype value: list[~azure.mgmt.appcontainers.models.PrivateLinkResource] + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.ManagedCertificate] """ super().__init__(**kwargs) self.value = value self.next_link = None -class PrivateLinkServiceConnectionState(_serialization.Model): - """A collection of information about the state of the connection between service consumer and - provider. - - :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". - :vartype status: str or ~azure.mgmt.appcontainers.models.PrivateEndpointServiceConnectionStatus - :ivar description: The reason for approval/rejection of the connection. - :vartype description: str - :ivar actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :vartype actions_required: str - """ - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "actions_required": {"key": "actionsRequired", "type": "str"}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = None, - description: Optional[str] = None, - actions_required: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the - owner of the service. Known values are: "Pending", "Approved", "Rejected", and "Disconnected". - :paramtype status: str or - ~azure.mgmt.appcontainers.models.PrivateEndpointServiceConnectionStatus - :keyword description: The reason for approval/rejection of the connection. - :paramtype description: str - :keyword actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :paramtype actions_required: str - """ - super().__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = actions_required - - -class QueueScaleRule(_serialization.Model): - """Container App container Azure Queue based scaling rule. - - :ivar account_name: Storage account name. required if using managed identity to authenticate. - :vartype account_name: str - :ivar queue_name: Queue name. - :vartype queue_name: str - :ivar queue_length: Queue length. - :vartype queue_length: int - :ivar auth: Authentication secrets for the queue scale rule. - :vartype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] - :ivar identity: The resource ID of a user-assigned managed identity that is assigned to the - Container App, or 'system' for system-assigned identity. - :vartype identity: str - """ - - _attribute_map = { - "account_name": {"key": "accountName", "type": "str"}, - "queue_name": {"key": "queueName", "type": "str"}, - "queue_length": {"key": "queueLength", "type": "int"}, - "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, - "identity": {"key": "identity", "type": "str"}, - } - - def __init__( - self, - *, - account_name: Optional[str] = None, - queue_name: Optional[str] = None, - queue_length: Optional[int] = None, - auth: Optional[List["_models.ScaleRuleAuth"]] = None, - identity: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword account_name: Storage account name. required if using managed identity to - authenticate. - :paramtype account_name: str - :keyword queue_name: Queue name. - :paramtype queue_name: str - :keyword queue_length: Queue length. - :paramtype queue_length: int - :keyword auth: Authentication secrets for the queue scale rule. - :paramtype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] - :keyword identity: The resource ID of a user-assigned managed identity that is assigned to the - Container App, or 'system' for system-assigned identity. - :paramtype identity: str - """ - super().__init__(**kwargs) - self.account_name = account_name - self.queue_name = queue_name - self.queue_length = queue_length - self.auth = auth - self.identity = identity - - -class RegistryCredentials(_serialization.Model): - """Container App Private Registry. +class ManagedCertificatePatch(_serialization.Model): + """A managed certificate to update. - :ivar server: Container Registry Server. - :vartype server: str - :ivar username: Container Registry Username. - :vartype username: str - :ivar password_secret_ref: The name of the Secret that contains the registry login password. - :vartype password_secret_ref: str - :ivar identity: A Managed Identity to use to authenticate with Azure Container Registry. For - user-assigned identities, use the full user-assigned identity Resource ID. For system-assigned - identities, use 'system'. - :vartype identity: str + :ivar tags: Application-specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] """ _attribute_map = { - "server": {"key": "server", "type": "str"}, - "username": {"key": "username", "type": "str"}, - "password_secret_ref": {"key": "passwordSecretRef", "type": "str"}, - "identity": {"key": "identity", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - server: Optional[str] = None, - username: Optional[str] = None, - password_secret_ref: Optional[str] = None, - identity: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword server: Container Registry Server. - :paramtype server: str - :keyword username: Container Registry Username. - :paramtype username: str - :keyword password_secret_ref: The name of the Secret that contains the registry login password. - :paramtype password_secret_ref: str - :keyword identity: A Managed Identity to use to authenticate with Azure Container Registry. For - user-assigned identities, use the full user-assigned identity Resource ID. For system-assigned - identities, use 'system'. - :paramtype identity: str + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - super().__init__(**kwargs) - self.server = server - self.username = username - self.password_secret_ref = password_secret_ref - self.identity = identity + :keyword tags: Application-specific metadata in the form of key-value pairs. + :paramtype tags: dict[str, str] + """ + super().__init__(**kwargs) + self.tags = tags -class RegistryInfo(_serialization.Model): - """Container App registry information. +class ManagedCertificateProperties(_serialization.Model): + """Certificate resource specific properties. - :ivar registry_url: registry server Url. - :vartype registry_url: str - :ivar registry_user_name: registry username. - :vartype registry_user_name: str - :ivar registry_password: registry secret. - :vartype registry_password: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: Provisioning state of the certificate. Known values are: "Succeeded", + "Failed", "Canceled", "DeleteFailed", and "Pending". + :vartype provisioning_state: str or + ~azure.mgmt.appcontainers.models.CertificateProvisioningState + :ivar subject_name: Subject name of the certificate. + :vartype subject_name: str + :ivar error: Any error occurred during the certificate provision. + :vartype error: str + :ivar domain_control_validation: Selected type of domain control validation for managed + certificates. Known values are: "CNAME", "HTTP", and "TXT". + :vartype domain_control_validation: str or + ~azure.mgmt.appcontainers.models.ManagedCertificateDomainControlValidation + :ivar validation_token: A TXT token used for DNS TXT domain control validation when issuing + this type of managed certificates. + :vartype validation_token: str """ + _validation = { + "provisioning_state": {"readonly": True}, + "error": {"readonly": True}, + "validation_token": {"readonly": True}, + } + _attribute_map = { - "registry_url": {"key": "registryUrl", "type": "str"}, - "registry_user_name": {"key": "registryUserName", "type": "str"}, - "registry_password": {"key": "registryPassword", "type": "str"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "subject_name": {"key": "subjectName", "type": "str"}, + "error": {"key": "error", "type": "str"}, + "domain_control_validation": {"key": "domainControlValidation", "type": "str"}, + "validation_token": {"key": "validationToken", "type": "str"}, } def __init__( self, *, - registry_url: Optional[str] = None, - registry_user_name: Optional[str] = None, - registry_password: Optional[str] = None, + subject_name: Optional[str] = None, + domain_control_validation: Optional[Union[str, "_models.ManagedCertificateDomainControlValidation"]] = None, **kwargs: Any ) -> None: """ - :keyword registry_url: registry server Url. - :paramtype registry_url: str - :keyword registry_user_name: registry username. - :paramtype registry_user_name: str - :keyword registry_password: registry secret. - :paramtype registry_password: str + :keyword subject_name: Subject name of the certificate. + :paramtype subject_name: str + :keyword domain_control_validation: Selected type of domain control validation for managed + certificates. Known values are: "CNAME", "HTTP", and "TXT". + :paramtype domain_control_validation: str or + ~azure.mgmt.appcontainers.models.ManagedCertificateDomainControlValidation """ super().__init__(**kwargs) - self.registry_url = registry_url - self.registry_user_name = registry_user_name - self.registry_password = registry_password + self.provisioning_state = None + self.subject_name = subject_name + self.error = None + self.domain_control_validation = domain_control_validation + self.validation_token = None -class Replica(ProxyResource): - """Container App Revision Replica. +class ManagedEnvironment(TrackedResource): + """An environment for hosting container apps. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + All required parameters must be populated in order to send to server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -10816,17 +6328,57 @@ class Replica(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar created_time: Timestamp describing when the pod was created by controller. - :vartype created_time: ~datetime.datetime - :ivar running_state: Current running state of the replica. Known values are: "Running", - "NotRunning", and "Unknown". - :vartype running_state: str or ~azure.mgmt.appcontainers.models.ContainerAppReplicaRunningState - :ivar running_state_details: The details of replica current running state. - :vartype running_state_details: str - :ivar containers: The containers collection under a replica. - :vartype containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] - :ivar init_containers: The init containers collection under a replica. - :vartype init_containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar kind: Kind of the Environment. + :vartype kind: str + :ivar provisioning_state: Provisioning state of the Environment. Known values are: "Succeeded", + "Failed", "Canceled", "Waiting", "InitializationInProgress", "InfrastructureSetupInProgress", + "InfrastructureSetupComplete", "ScheduledForDelete", "UpgradeRequested", and "UpgradeFailed". + :vartype provisioning_state: str or + ~azure.mgmt.appcontainers.models.EnvironmentProvisioningState + :ivar dapr_ai_instrumentation_key: Azure Monitor instrumentation key used by Dapr to export + Service to Service communication telemetry. + :vartype dapr_ai_instrumentation_key: str + :ivar dapr_ai_connection_string: Application Insights connection string used by Dapr to export + Service to Service communication telemetry. + :vartype dapr_ai_connection_string: str + :ivar vnet_configuration: Vnet configuration for the environment. + :vartype vnet_configuration: ~azure.mgmt.appcontainers.models.VnetConfiguration + :ivar deployment_errors: Any errors that occurred during deployment or deployment validation. + :vartype deployment_errors: str + :ivar default_domain: Default Domain Name for the cluster. + :vartype default_domain: str + :ivar static_ip: Static IP of the Environment. + :vartype static_ip: str + :ivar app_logs_configuration: Cluster configuration which enables the log daemon to export app + logs to configured destination. + :vartype app_logs_configuration: ~azure.mgmt.appcontainers.models.AppLogsConfiguration + :ivar zone_redundant: Whether or not this Managed Environment is zone-redundant. + :vartype zone_redundant: bool + :ivar custom_domain_configuration: Custom domain configuration for the environment. + :vartype custom_domain_configuration: + ~azure.mgmt.appcontainers.models.CustomDomainConfiguration + :ivar event_stream_endpoint: The endpoint of the eventstream of the Environment. + :vartype event_stream_endpoint: str + :ivar workload_profiles: Workload profiles configured for the Managed Environment. + :vartype workload_profiles: list[~azure.mgmt.appcontainers.models.WorkloadProfile] + :ivar keda_configuration: The configuration of Keda component. + :vartype keda_configuration: ~azure.mgmt.appcontainers.models.KedaConfiguration + :ivar dapr_configuration: The configuration of Dapr component. + :vartype dapr_configuration: ~azure.mgmt.appcontainers.models.DaprConfiguration + :ivar infrastructure_resource_group: Name of the platform-managed resource group created for + the Managed Environment to host infrastructure resources. If a subnet ID is provided, this + resource group will be created in the same subscription as the subnet. + :vartype infrastructure_resource_group: str + :ivar peer_authentication: Peer authentication settings for the Managed Environment. + :vartype peer_authentication: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication + :ivar peer_traffic_configuration: Peer traffic settings for the Managed Environment. + :vartype peer_traffic_configuration: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration """ _validation = { @@ -10834,9 +6386,12 @@ class Replica(ProxyResource): "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "created_time": {"readonly": True}, - "running_state": {"readonly": True}, - "running_state_details": {"readonly": True}, + "location": {"required": True}, + "provisioning_state": {"readonly": True}, + "deployment_errors": {"readonly": True}, + "default_domain": {"readonly": True}, + "static_ip": {"readonly": True}, + "event_stream_endpoint": {"readonly": True}, } _attribute_map = { @@ -10844,285 +6399,196 @@ class Replica(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, - "running_state": {"key": "properties.runningState", "type": "str"}, - "running_state_details": {"key": "properties.runningStateDetails", "type": "str"}, - "containers": {"key": "properties.containers", "type": "[ReplicaContainer]"}, - "init_containers": {"key": "properties.initContainers", "type": "[ReplicaContainer]"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "dapr_ai_instrumentation_key": {"key": "properties.daprAIInstrumentationKey", "type": "str"}, + "dapr_ai_connection_string": {"key": "properties.daprAIConnectionString", "type": "str"}, + "vnet_configuration": {"key": "properties.vnetConfiguration", "type": "VnetConfiguration"}, + "deployment_errors": {"key": "properties.deploymentErrors", "type": "str"}, + "default_domain": {"key": "properties.defaultDomain", "type": "str"}, + "static_ip": {"key": "properties.staticIp", "type": "str"}, + "app_logs_configuration": {"key": "properties.appLogsConfiguration", "type": "AppLogsConfiguration"}, + "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, + "custom_domain_configuration": { + "key": "properties.customDomainConfiguration", + "type": "CustomDomainConfiguration", + }, + "event_stream_endpoint": {"key": "properties.eventStreamEndpoint", "type": "str"}, + "workload_profiles": {"key": "properties.workloadProfiles", "type": "[WorkloadProfile]"}, + "keda_configuration": {"key": "properties.kedaConfiguration", "type": "KedaConfiguration"}, + "dapr_configuration": {"key": "properties.daprConfiguration", "type": "DaprConfiguration"}, + "infrastructure_resource_group": {"key": "properties.infrastructureResourceGroup", "type": "str"}, + "peer_authentication": { + "key": "properties.peerAuthentication", + "type": "ManagedEnvironmentPropertiesPeerAuthentication", + }, + "peer_traffic_configuration": { + "key": "properties.peerTrafficConfiguration", + "type": "ManagedEnvironmentPropertiesPeerTrafficConfiguration", + }, } - def __init__( + def __init__( # pylint: disable=too-many-locals self, *, - containers: Optional[List["_models.ReplicaContainer"]] = None, - init_containers: Optional[List["_models.ReplicaContainer"]] = None, + location: str, + tags: Optional[Dict[str, str]] = None, + kind: Optional[str] = None, + dapr_ai_instrumentation_key: Optional[str] = None, + dapr_ai_connection_string: Optional[str] = None, + vnet_configuration: Optional["_models.VnetConfiguration"] = None, + app_logs_configuration: Optional["_models.AppLogsConfiguration"] = None, + zone_redundant: Optional[bool] = None, + custom_domain_configuration: Optional["_models.CustomDomainConfiguration"] = None, + workload_profiles: Optional[List["_models.WorkloadProfile"]] = None, + keda_configuration: Optional["_models.KedaConfiguration"] = None, + dapr_configuration: Optional["_models.DaprConfiguration"] = None, + infrastructure_resource_group: Optional[str] = None, + peer_authentication: Optional["_models.ManagedEnvironmentPropertiesPeerAuthentication"] = None, + peer_traffic_configuration: Optional["_models.ManagedEnvironmentPropertiesPeerTrafficConfiguration"] = None, **kwargs: Any ) -> None: """ - :keyword containers: The containers collection under a replica. - :paramtype containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] - :keyword init_containers: The init containers collection under a replica. - :paramtype init_containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword kind: Kind of the Environment. + :paramtype kind: str + :keyword dapr_ai_instrumentation_key: Azure Monitor instrumentation key used by Dapr to export + Service to Service communication telemetry. + :paramtype dapr_ai_instrumentation_key: str + :keyword dapr_ai_connection_string: Application Insights connection string used by Dapr to + export Service to Service communication telemetry. + :paramtype dapr_ai_connection_string: str + :keyword vnet_configuration: Vnet configuration for the environment. + :paramtype vnet_configuration: ~azure.mgmt.appcontainers.models.VnetConfiguration + :keyword app_logs_configuration: Cluster configuration which enables the log daemon to export + app logs to configured destination. + :paramtype app_logs_configuration: ~azure.mgmt.appcontainers.models.AppLogsConfiguration + :keyword zone_redundant: Whether or not this Managed Environment is zone-redundant. + :paramtype zone_redundant: bool + :keyword custom_domain_configuration: Custom domain configuration for the environment. + :paramtype custom_domain_configuration: + ~azure.mgmt.appcontainers.models.CustomDomainConfiguration + :keyword workload_profiles: Workload profiles configured for the Managed Environment. + :paramtype workload_profiles: list[~azure.mgmt.appcontainers.models.WorkloadProfile] + :keyword keda_configuration: The configuration of Keda component. + :paramtype keda_configuration: ~azure.mgmt.appcontainers.models.KedaConfiguration + :keyword dapr_configuration: The configuration of Dapr component. + :paramtype dapr_configuration: ~azure.mgmt.appcontainers.models.DaprConfiguration + :keyword infrastructure_resource_group: Name of the platform-managed resource group created for + the Managed Environment to host infrastructure resources. If a subnet ID is provided, this + resource group will be created in the same subscription as the subnet. + :paramtype infrastructure_resource_group: str + :keyword peer_authentication: Peer authentication settings for the Managed Environment. + :paramtype peer_authentication: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerAuthentication + :keyword peer_traffic_configuration: Peer traffic settings for the Managed Environment. + :paramtype peer_traffic_configuration: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfiguration """ - super().__init__(**kwargs) - self.created_time = None - self.running_state = None - self.running_state_details = None - self.containers = containers - self.init_containers = init_containers - + super().__init__(tags=tags, location=location, **kwargs) + self.kind = kind + self.provisioning_state = None + self.dapr_ai_instrumentation_key = dapr_ai_instrumentation_key + self.dapr_ai_connection_string = dapr_ai_connection_string + self.vnet_configuration = vnet_configuration + self.deployment_errors = None + self.default_domain = None + self.static_ip = None + self.app_logs_configuration = app_logs_configuration + self.zone_redundant = zone_redundant + self.custom_domain_configuration = custom_domain_configuration + self.event_stream_endpoint = None + self.workload_profiles = workload_profiles + self.keda_configuration = keda_configuration + self.dapr_configuration = dapr_configuration + self.infrastructure_resource_group = infrastructure_resource_group + self.peer_authentication = peer_authentication + self.peer_traffic_configuration = peer_traffic_configuration -class ReplicaCollection(_serialization.Model): - """Container App Revision Replicas collection ARM resource. - All required parameters must be populated in order to send to server. +class ManagedEnvironmentPropertiesPeerAuthentication(_serialization.Model): # pylint: disable=name-too-long + """Peer authentication settings for the Managed Environment. - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.Replica] + :ivar mtls: Mutual TLS authentication settings for the Managed Environment. + :vartype mtls: ~azure.mgmt.appcontainers.models.Mtls """ - _validation = { - "value": {"required": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[Replica]"}, + "mtls": {"key": "mtls", "type": "Mtls"}, } - def __init__(self, *, value: List["_models.Replica"], **kwargs: Any) -> None: + def __init__(self, *, mtls: Optional["_models.Mtls"] = None, **kwargs: Any) -> None: """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.Replica] + :keyword mtls: Mutual TLS authentication settings for the Managed Environment. + :paramtype mtls: ~azure.mgmt.appcontainers.models.Mtls """ super().__init__(**kwargs) - self.value = value - + self.mtls = mtls -class ReplicaContainer(_serialization.Model): - """Container object under Container App Revision Replica. - Variables are only populated by the server, and will be ignored when sending a request. +class ManagedEnvironmentPropertiesPeerTrafficConfiguration(_serialization.Model): # pylint: disable=name-too-long + """Peer traffic settings for the Managed Environment. - :ivar name: The Name of the Container. - :vartype name: str - :ivar container_id: The Id of the Container. - :vartype container_id: str - :ivar ready: The container ready status. - :vartype ready: bool - :ivar started: The container start status. - :vartype started: bool - :ivar restart_count: The container restart count. - :vartype restart_count: int - :ivar running_state: Current running state of the container. Known values are: "Running", - "Terminated", and "Waiting". - :vartype running_state: str or - ~azure.mgmt.appcontainers.models.ContainerAppContainerRunningState - :ivar running_state_details: The details of container current running state. - :vartype running_state_details: str - :ivar log_stream_endpoint: Log Stream endpoint. - :vartype log_stream_endpoint: str - :ivar exec_endpoint: Container exec endpoint. - :vartype exec_endpoint: str - :ivar debug_endpoint: Container debug endpoint. - :vartype debug_endpoint: str + :ivar encryption: Peer traffic encryption settings for the Managed Environment. + :vartype encryption: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption """ - _validation = { - "running_state": {"readonly": True}, - "running_state_details": {"readonly": True}, - "log_stream_endpoint": {"readonly": True}, - "exec_endpoint": {"readonly": True}, - "debug_endpoint": {"readonly": True}, - } - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "container_id": {"key": "containerId", "type": "str"}, - "ready": {"key": "ready", "type": "bool"}, - "started": {"key": "started", "type": "bool"}, - "restart_count": {"key": "restartCount", "type": "int"}, - "running_state": {"key": "runningState", "type": "str"}, - "running_state_details": {"key": "runningStateDetails", "type": "str"}, - "log_stream_endpoint": {"key": "logStreamEndpoint", "type": "str"}, - "exec_endpoint": {"key": "execEndpoint", "type": "str"}, - "debug_endpoint": {"key": "debugEndpoint", "type": "str"}, + "encryption": {"key": "encryption", "type": "ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption"}, } def __init__( self, *, - name: Optional[str] = None, - container_id: Optional[str] = None, - ready: Optional[bool] = None, - started: Optional[bool] = None, - restart_count: Optional[int] = None, + encryption: Optional["_models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption"] = None, **kwargs: Any ) -> None: """ - :keyword name: The Name of the Container. - :paramtype name: str - :keyword container_id: The Id of the Container. - :paramtype container_id: str - :keyword ready: The container ready status. - :paramtype ready: bool - :keyword started: The container start status. - :paramtype started: bool - :keyword restart_count: The container restart count. - :paramtype restart_count: int + :keyword encryption: Peer traffic encryption settings for the Managed Environment. + :paramtype encryption: + ~azure.mgmt.appcontainers.models.ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption """ super().__init__(**kwargs) - self.name = name - self.container_id = container_id - self.ready = ready - self.started = started - self.restart_count = restart_count - self.running_state = None - self.running_state_details = None - self.log_stream_endpoint = None - self.exec_endpoint = None - self.debug_endpoint = None + self.encryption = encryption -class ReplicaExecutionStatus(_serialization.Model): - """Container Apps Job execution replica status. +class ManagedEnvironmentPropertiesPeerTrafficConfigurationEncryption( + _serialization.Model +): # pylint: disable=name-too-long + """Peer traffic encryption settings for the Managed Environment. - :ivar name: Replica Name. - :vartype name: str - :ivar containers: Containers in the execution replica. - :vartype containers: list[~azure.mgmt.appcontainers.models.ContainerExecutionStatus] + :ivar enabled: Boolean indicating whether the peer traffic encryption is enabled. + :vartype enabled: bool """ _attribute_map = { - "name": {"key": "name", "type": "str"}, - "containers": {"key": "containers", "type": "[ContainerExecutionStatus]"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - name: Optional[str] = None, - containers: Optional[List["_models.ContainerExecutionStatus"]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: """ - :keyword name: Replica Name. - :paramtype name: str - :keyword containers: Containers in the execution replica. - :paramtype containers: list[~azure.mgmt.appcontainers.models.ContainerExecutionStatus] + :keyword enabled: Boolean indicating whether the peer traffic encryption is enabled. + :paramtype enabled: bool """ super().__init__(**kwargs) - self.name = name - self.containers = containers - - -class Revision(ProxyResource): # pylint: disable=too-many-instance-attributes - """Container App Revision. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar created_time: Timestamp describing when the revision was created - by controller. - :vartype created_time: ~datetime.datetime - :ivar last_active_time: Timestamp describing when the revision was last active. Only meaningful - when revision is inactive. - :vartype last_active_time: ~datetime.datetime - :ivar fqdn: Fully qualified domain name of the revision. - :vartype fqdn: str - :ivar template: Container App Revision Template with all possible settings and the - defaults if user did not provide them. The defaults are populated - as they were at the creation time. - :vartype template: ~azure.mgmt.appcontainers.models.Template - :ivar active: Boolean describing if the Revision is Active. - :vartype active: bool - :ivar replicas: Number of pods currently running for this revision. - :vartype replicas: int - :ivar traffic_weight: Traffic weight assigned to this revision. - :vartype traffic_weight: int - :ivar provisioning_error: Optional Field - Platform Error Message. - :vartype provisioning_error: str - :ivar health_state: Current health State of the revision. Known values are: "Healthy", - "Unhealthy", and "None". - :vartype health_state: str or ~azure.mgmt.appcontainers.models.RevisionHealthState - :ivar provisioning_state: Current provisioning State of the revision. Known values are: - "Provisioning", "Provisioned", "Failed", "Deprovisioning", and "Deprovisioned". - :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.RevisionProvisioningState - :ivar running_state: Current running state of the revision. Known values are: "Running", - "Processing", "Stopped", "Degraded", "Failed", and "Unknown". - :vartype running_state: str or ~azure.mgmt.appcontainers.models.RevisionRunningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "created_time": {"readonly": True}, - "last_active_time": {"readonly": True}, - "fqdn": {"readonly": True}, - "template": {"readonly": True}, - "active": {"readonly": True}, - "replicas": {"readonly": True}, - "traffic_weight": {"readonly": True}, - "provisioning_error": {"readonly": True}, - "health_state": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "running_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, - "last_active_time": {"key": "properties.lastActiveTime", "type": "iso-8601"}, - "fqdn": {"key": "properties.fqdn", "type": "str"}, - "template": {"key": "properties.template", "type": "Template"}, - "active": {"key": "properties.active", "type": "bool"}, - "replicas": {"key": "properties.replicas", "type": "int"}, - "traffic_weight": {"key": "properties.trafficWeight", "type": "int"}, - "provisioning_error": {"key": "properties.provisioningError", "type": "str"}, - "health_state": {"key": "properties.healthState", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "running_state": {"key": "properties.runningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.created_time = None - self.last_active_time = None - self.fqdn = None - self.template = None - self.active = None - self.replicas = None - self.traffic_weight = None - self.provisioning_error = None - self.health_state = None - self.provisioning_state = None - self.running_state = None + self.enabled = enabled -class RevisionCollection(_serialization.Model): - """Container App Revisions collection ARM resource. +class ManagedEnvironmentsCollection(_serialization.Model): + """Collection of Environments. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.Revision] + :vartype value: list[~azure.mgmt.appcontainers.models.ManagedEnvironment] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -11133,697 +6599,812 @@ class RevisionCollection(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[Revision]"}, + "value": {"key": "value", "type": "[ManagedEnvironment]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.Revision"], **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.ManagedEnvironment"], **kwargs: Any) -> None: """ :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.Revision] + :paramtype value: list[~azure.mgmt.appcontainers.models.ManagedEnvironment] """ super().__init__(**kwargs) self.value = value self.next_link = None -class Runtime(_serialization.Model): - """Container App Runtime configuration. +class ManagedEnvironmentStorage(ProxyResource): + """Storage resource for managedEnvironment. + + Variables are only populated by the server, and will be ignored when sending a request. - :ivar java: Java app configuration. - :vartype java: ~azure.mgmt.appcontainers.models.RuntimeJava - :ivar dotnet: .NET app configuration. - :vartype dotnet: ~azure.mgmt.appcontainers.models.RuntimeDotnet + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData + :ivar properties: Storage properties. + :vartype properties: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorageProperties """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + } + _attribute_map = { - "java": {"key": "java", "type": "RuntimeJava"}, - "dotnet": {"key": "dotnet", "type": "RuntimeDotnet"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ManagedEnvironmentStorageProperties"}, } def __init__( - self, - *, - java: Optional["_models.RuntimeJava"] = None, - dotnet: Optional["_models.RuntimeDotnet"] = None, - **kwargs: Any + self, *, properties: Optional["_models.ManagedEnvironmentStorageProperties"] = None, **kwargs: Any ) -> None: """ - :keyword java: Java app configuration. - :paramtype java: ~azure.mgmt.appcontainers.models.RuntimeJava - :keyword dotnet: .NET app configuration. - :paramtype dotnet: ~azure.mgmt.appcontainers.models.RuntimeDotnet + :keyword properties: Storage properties. + :paramtype properties: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorageProperties """ super().__init__(**kwargs) - self.java = java - self.dotnet = dotnet + self.properties = properties -class RuntimeDotnet(_serialization.Model): - """.NET app configuration. +class ManagedEnvironmentStorageProperties(_serialization.Model): + """Storage properties. - :ivar auto_configure_data_protection: Auto configure the ASP.NET Core Data Protection feature. - :vartype auto_configure_data_protection: bool + :ivar azure_file: Azure file properties. + :vartype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties """ _attribute_map = { - "auto_configure_data_protection": {"key": "autoConfigureDataProtection", "type": "bool"}, + "azure_file": {"key": "azureFile", "type": "AzureFileProperties"}, } - def __init__(self, *, auto_configure_data_protection: Optional[bool] = None, **kwargs: Any) -> None: + def __init__(self, *, azure_file: Optional["_models.AzureFileProperties"] = None, **kwargs: Any) -> None: """ - :keyword auto_configure_data_protection: Auto configure the ASP.NET Core Data Protection - feature. - :paramtype auto_configure_data_protection: bool + :keyword azure_file: Azure file properties. + :paramtype azure_file: ~azure.mgmt.appcontainers.models.AzureFileProperties """ super().__init__(**kwargs) - self.auto_configure_data_protection = auto_configure_data_protection + self.azure_file = azure_file -class RuntimeJava(_serialization.Model): - """Java app configuration. +class ManagedEnvironmentStoragesCollection(_serialization.Model): + """Collection of Storage for Environments. + + All required parameters must be populated in order to send to server. - :ivar enable_metrics: Enable jmx core metrics for the java app. - :vartype enable_metrics: bool - :ivar java_agent: Diagnostic capabilities achieved by java agent. - :vartype java_agent: ~azure.mgmt.appcontainers.models.RuntimeJavaAgent + :ivar value: Collection of storage resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage] """ + _validation = { + "value": {"required": True}, + } + _attribute_map = { - "enable_metrics": {"key": "enableMetrics", "type": "bool"}, - "java_agent": {"key": "javaAgent", "type": "RuntimeJavaAgent"}, + "value": {"key": "value", "type": "[ManagedEnvironmentStorage]"}, } - def __init__( - self, - *, - enable_metrics: Optional[bool] = None, - java_agent: Optional["_models.RuntimeJavaAgent"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, value: List["_models.ManagedEnvironmentStorage"], **kwargs: Any) -> None: """ - :keyword enable_metrics: Enable jmx core metrics for the java app. - :paramtype enable_metrics: bool - :keyword java_agent: Diagnostic capabilities achieved by java agent. - :paramtype java_agent: ~azure.mgmt.appcontainers.models.RuntimeJavaAgent + :keyword value: Collection of storage resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage] """ super().__init__(**kwargs) - self.enable_metrics = enable_metrics - self.java_agent = java_agent + self.value = value + + +class ManagedServiceIdentity(_serialization.Model): + """Managed service identity (system assigned and/or user assigned identities). + Variables are only populated by the server, and will be ignored when sending a request. -class RuntimeJavaAgent(_serialization.Model): - """Diagnostic capabilities achieved by java agent. + All required parameters must be populated in order to send to server. - :ivar enabled: Enable java agent injection for the java app. - :vartype enabled: bool - :ivar logging: Capabilities on the java logging scenario. - :vartype logging: ~azure.mgmt.appcontainers.models.RuntimeJavaAgentLogging + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: Type of managed service identity (where both SystemAssigned and UserAssigned types + are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and + "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.appcontainers.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long + The dictionary values can be empty objects ({}) in requests. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.appcontainers.models.UserAssignedIdentity] """ + _validation = { + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, + } + _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "logging": {"key": "logging", "type": "RuntimeJavaAgentLogging"}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, } def __init__( self, *, - enabled: Optional[bool] = None, - logging: Optional["_models.RuntimeJavaAgentLogging"] = None, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, **kwargs: Any ) -> None: """ - :keyword enabled: Enable java agent injection for the java app. - :paramtype enabled: bool - :keyword logging: Capabilities on the java logging scenario. - :paramtype logging: ~azure.mgmt.appcontainers.models.RuntimeJavaAgentLogging + :keyword type: Type of managed service identity (where both SystemAssigned and UserAssigned + types are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and + "SystemAssigned,UserAssigned". + :paramtype type: str or ~azure.mgmt.appcontainers.models.ManagedServiceIdentityType + :keyword user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long + The dictionary values can be empty objects ({}) in requests. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.appcontainers.models.UserAssignedIdentity] """ super().__init__(**kwargs) - self.enabled = enabled - self.logging = logging + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities -class RuntimeJavaAgentLogging(_serialization.Model): - """Capabilities on the java logging scenario. +class Mtls(_serialization.Model): + """Configuration properties for mutual TLS authentication. - :ivar logger_settings: Settings of the logger for the java app. - :vartype logger_settings: list[~azure.mgmt.appcontainers.models.LoggerSetting] + :ivar enabled: Boolean indicating whether the mutual TLS authentication is enabled. + :vartype enabled: bool """ _attribute_map = { - "logger_settings": {"key": "loggerSettings", "type": "[LoggerSetting]"}, + "enabled": {"key": "enabled", "type": "bool"}, } - def __init__(self, *, logger_settings: Optional[List["_models.LoggerSetting"]] = None, **kwargs: Any) -> None: + def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: """ - :keyword logger_settings: Settings of the logger for the java app. - :paramtype logger_settings: list[~azure.mgmt.appcontainers.models.LoggerSetting] + :keyword enabled: Boolean indicating whether the mutual TLS authentication is enabled. + :paramtype enabled: bool """ super().__init__(**kwargs) - self.logger_settings = logger_settings + self.enabled = enabled -class Scale(_serialization.Model): - """Container App scaling configurations. +class Nonce(_serialization.Model): + """The configuration settings of the nonce used in the login flow. - :ivar min_replicas: Optional. Minimum number of container replicas. - :vartype min_replicas: int - :ivar max_replicas: Optional. Maximum number of container replicas. Defaults to 10 if not set. - :vartype max_replicas: int - :ivar cooldown_period: Optional. KEDA Cooldown Period. Defaults to 300 seconds if not set. - :vartype cooldown_period: int - :ivar polling_interval: Optional. KEDA Polling Interval. Defaults to 30 seconds if not set. - :vartype polling_interval: int - :ivar rules: Scaling rules. - :vartype rules: list[~azure.mgmt.appcontainers.models.ScaleRule] + :ivar validate_nonce: :code:`false` if the nonce should not be validated while + completing the login flow; otherwise, :code:`true`. + :vartype validate_nonce: bool + :ivar nonce_expiration_interval: The time after the request is made when the nonce should + expire. + :vartype nonce_expiration_interval: str """ _attribute_map = { - "min_replicas": {"key": "minReplicas", "type": "int"}, - "max_replicas": {"key": "maxReplicas", "type": "int"}, - "cooldown_period": {"key": "cooldownPeriod", "type": "int"}, - "polling_interval": {"key": "pollingInterval", "type": "int"}, - "rules": {"key": "rules", "type": "[ScaleRule]"}, + "validate_nonce": {"key": "validateNonce", "type": "bool"}, + "nonce_expiration_interval": {"key": "nonceExpirationInterval", "type": "str"}, } def __init__( - self, - *, - min_replicas: Optional[int] = None, - max_replicas: int = 10, - cooldown_period: Optional[int] = None, - polling_interval: Optional[int] = None, - rules: Optional[List["_models.ScaleRule"]] = None, - **kwargs: Any + self, *, validate_nonce: Optional[bool] = None, nonce_expiration_interval: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword min_replicas: Optional. Minimum number of container replicas. - :paramtype min_replicas: int - :keyword max_replicas: Optional. Maximum number of container replicas. Defaults to 10 if not - set. - :paramtype max_replicas: int - :keyword cooldown_period: Optional. KEDA Cooldown Period. Defaults to 300 seconds if not set. - :paramtype cooldown_period: int - :keyword polling_interval: Optional. KEDA Polling Interval. Defaults to 30 seconds if not set. - :paramtype polling_interval: int - :keyword rules: Scaling rules. - :paramtype rules: list[~azure.mgmt.appcontainers.models.ScaleRule] + :keyword validate_nonce: :code:`false` if the nonce should not be validated while + completing the login flow; otherwise, :code:`true`. + :paramtype validate_nonce: bool + :keyword nonce_expiration_interval: The time after the request is made when the nonce should + expire. + :paramtype nonce_expiration_interval: str """ super().__init__(**kwargs) - self.min_replicas = min_replicas - self.max_replicas = max_replicas - self.cooldown_period = cooldown_period - self.polling_interval = polling_interval - self.rules = rules + self.validate_nonce = validate_nonce + self.nonce_expiration_interval = nonce_expiration_interval -class ScaleConfiguration(_serialization.Model): - """Scale configuration. +class OpenIdConnectClientCredential(_serialization.Model): + """The authentication client credentials of the custom Open ID Connect provider. - :ivar max_concurrent_sessions: The maximum count of sessions at the same time. - :vartype max_concurrent_sessions: int - :ivar ready_session_instances: The minimum count of ready session instances. - :vartype ready_session_instances: int + :ivar method: The method that should be used to authenticate the user. Default value is + "ClientSecretPost". + :vartype method: str + :ivar client_secret_setting_name: The app setting that contains the client secret for the + custom Open ID Connect provider. + :vartype client_secret_setting_name: str """ _attribute_map = { - "max_concurrent_sessions": {"key": "maxConcurrentSessions", "type": "int"}, - "ready_session_instances": {"key": "readySessionInstances", "type": "int"}, + "method": {"key": "method", "type": "str"}, + "client_secret_setting_name": {"key": "clientSecretSettingName", "type": "str"}, } def __init__( self, *, - max_concurrent_sessions: Optional[int] = None, - ready_session_instances: Optional[int] = None, + method: Optional[Literal["ClientSecretPost"]] = None, + client_secret_setting_name: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword max_concurrent_sessions: The maximum count of sessions at the same time. - :paramtype max_concurrent_sessions: int - :keyword ready_session_instances: The minimum count of ready session instances. - :paramtype ready_session_instances: int + :keyword method: The method that should be used to authenticate the user. Default value is + "ClientSecretPost". + :paramtype method: str + :keyword client_secret_setting_name: The app setting that contains the client secret for the + custom Open ID Connect provider. + :paramtype client_secret_setting_name: str """ super().__init__(**kwargs) - self.max_concurrent_sessions = max_concurrent_sessions - self.ready_session_instances = ready_session_instances + self.method = method + self.client_secret_setting_name = client_secret_setting_name -class ScaleRule(_serialization.Model): - """Container App container scaling rule. +class OpenIdConnectConfig(_serialization.Model): + """The configuration settings of the endpoints used for the custom Open ID Connect provider. - :ivar name: Scale Rule Name. - :vartype name: str - :ivar azure_queue: Azure Queue based scaling. - :vartype azure_queue: ~azure.mgmt.appcontainers.models.QueueScaleRule - :ivar custom: Custom scale rule. - :vartype custom: ~azure.mgmt.appcontainers.models.CustomScaleRule - :ivar http: HTTP requests based scaling. - :vartype http: ~azure.mgmt.appcontainers.models.HttpScaleRule - :ivar tcp: Tcp requests based scaling. - :vartype tcp: ~azure.mgmt.appcontainers.models.TcpScaleRule + :ivar authorization_endpoint: The endpoint to be used to make an authorization request. + :vartype authorization_endpoint: str + :ivar token_endpoint: The endpoint to be used to request a token. + :vartype token_endpoint: str + :ivar issuer: The endpoint that issues the token. + :vartype issuer: str + :ivar certification_uri: The endpoint that provides the keys necessary to validate the token. + :vartype certification_uri: str + :ivar well_known_open_id_configuration: The endpoint that contains all the configuration + endpoints for the provider. + :vartype well_known_open_id_configuration: str """ _attribute_map = { - "name": {"key": "name", "type": "str"}, - "azure_queue": {"key": "azureQueue", "type": "QueueScaleRule"}, - "custom": {"key": "custom", "type": "CustomScaleRule"}, - "http": {"key": "http", "type": "HttpScaleRule"}, - "tcp": {"key": "tcp", "type": "TcpScaleRule"}, + "authorization_endpoint": {"key": "authorizationEndpoint", "type": "str"}, + "token_endpoint": {"key": "tokenEndpoint", "type": "str"}, + "issuer": {"key": "issuer", "type": "str"}, + "certification_uri": {"key": "certificationUri", "type": "str"}, + "well_known_open_id_configuration": {"key": "wellKnownOpenIdConfiguration", "type": "str"}, } def __init__( self, *, - name: Optional[str] = None, - azure_queue: Optional["_models.QueueScaleRule"] = None, - custom: Optional["_models.CustomScaleRule"] = None, - http: Optional["_models.HttpScaleRule"] = None, - tcp: Optional["_models.TcpScaleRule"] = None, + authorization_endpoint: Optional[str] = None, + token_endpoint: Optional[str] = None, + issuer: Optional[str] = None, + certification_uri: Optional[str] = None, + well_known_open_id_configuration: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword name: Scale Rule Name. - :paramtype name: str - :keyword azure_queue: Azure Queue based scaling. - :paramtype azure_queue: ~azure.mgmt.appcontainers.models.QueueScaleRule - :keyword custom: Custom scale rule. - :paramtype custom: ~azure.mgmt.appcontainers.models.CustomScaleRule - :keyword http: HTTP requests based scaling. - :paramtype http: ~azure.mgmt.appcontainers.models.HttpScaleRule - :keyword tcp: Tcp requests based scaling. - :paramtype tcp: ~azure.mgmt.appcontainers.models.TcpScaleRule - """ - super().__init__(**kwargs) - self.name = name - self.azure_queue = azure_queue - self.custom = custom - self.http = http - self.tcp = tcp + :keyword authorization_endpoint: The endpoint to be used to make an authorization request. + :paramtype authorization_endpoint: str + :keyword token_endpoint: The endpoint to be used to request a token. + :paramtype token_endpoint: str + :keyword issuer: The endpoint that issues the token. + :paramtype issuer: str + :keyword certification_uri: The endpoint that provides the keys necessary to validate the + token. + :paramtype certification_uri: str + :keyword well_known_open_id_configuration: The endpoint that contains all the configuration + endpoints for the provider. + :paramtype well_known_open_id_configuration: str + """ + super().__init__(**kwargs) + self.authorization_endpoint = authorization_endpoint + self.token_endpoint = token_endpoint + self.issuer = issuer + self.certification_uri = certification_uri + self.well_known_open_id_configuration = well_known_open_id_configuration -class ScaleRuleAuth(_serialization.Model): - """Auth Secrets for Scale Rule. +class OpenIdConnectLogin(_serialization.Model): + """The configuration settings of the login flow of the custom Open ID Connect provider. - :ivar secret_ref: Name of the secret from which to pull the auth params. - :vartype secret_ref: str - :ivar trigger_parameter: Trigger Parameter that uses the secret. - :vartype trigger_parameter: str + :ivar name_claim_type: The name of the claim that contains the users name. + :vartype name_claim_type: str + :ivar scopes: A list of the scopes that should be requested while authenticating. + :vartype scopes: list[str] """ _attribute_map = { - "secret_ref": {"key": "secretRef", "type": "str"}, - "trigger_parameter": {"key": "triggerParameter", "type": "str"}, + "name_claim_type": {"key": "nameClaimType", "type": "str"}, + "scopes": {"key": "scopes", "type": "[str]"}, } def __init__( - self, *, secret_ref: Optional[str] = None, trigger_parameter: Optional[str] = None, **kwargs: Any + self, *, name_claim_type: Optional[str] = None, scopes: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword secret_ref: Name of the secret from which to pull the auth params. - :paramtype secret_ref: str - :keyword trigger_parameter: Trigger Parameter that uses the secret. - :paramtype trigger_parameter: str + :keyword name_claim_type: The name of the claim that contains the users name. + :paramtype name_claim_type: str + :keyword scopes: A list of the scopes that should be requested while authenticating. + :paramtype scopes: list[str] """ super().__init__(**kwargs) - self.secret_ref = secret_ref - self.trigger_parameter = trigger_parameter - + self.name_claim_type = name_claim_type + self.scopes = scopes -class ScgRoute(_serialization.Model): - """Spring Cloud Gateway route definition. - All required parameters must be populated in order to send to server. +class OpenIdConnectRegistration(_serialization.Model): + """The configuration settings of the app registration for the custom Open ID Connect provider. - :ivar id: Id of the route. Required. - :vartype id: str - :ivar uri: Uri of the route. Required. - :vartype uri: str - :ivar predicates: Predicates of the route. - :vartype predicates: list[str] - :ivar filters: Filters of the route. - :vartype filters: list[str] - :ivar order: Order of the route. - :vartype order: int + :ivar client_id: The client id of the custom Open ID Connect provider. + :vartype client_id: str + :ivar client_credential: The authentication credentials of the custom Open ID Connect provider. + :vartype client_credential: ~azure.mgmt.appcontainers.models.OpenIdConnectClientCredential + :ivar open_id_connect_configuration: The configuration settings of the endpoints used for the + custom Open ID Connect provider. + :vartype open_id_connect_configuration: ~azure.mgmt.appcontainers.models.OpenIdConnectConfig """ - _validation = { - "id": {"required": True}, - "uri": {"required": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "uri": {"key": "uri", "type": "str"}, - "predicates": {"key": "predicates", "type": "[str]"}, - "filters": {"key": "filters", "type": "[str]"}, - "order": {"key": "order", "type": "int"}, + "client_id": {"key": "clientId", "type": "str"}, + "client_credential": {"key": "clientCredential", "type": "OpenIdConnectClientCredential"}, + "open_id_connect_configuration": {"key": "openIdConnectConfiguration", "type": "OpenIdConnectConfig"}, } def __init__( self, *, - id: str, # pylint: disable=redefined-builtin - uri: str, - predicates: Optional[List[str]] = None, - filters: Optional[List[str]] = None, - order: Optional[int] = None, + client_id: Optional[str] = None, + client_credential: Optional["_models.OpenIdConnectClientCredential"] = None, + open_id_connect_configuration: Optional["_models.OpenIdConnectConfig"] = None, **kwargs: Any ) -> None: """ - :keyword id: Id of the route. Required. - :paramtype id: str - :keyword uri: Uri of the route. Required. - :paramtype uri: str - :keyword predicates: Predicates of the route. - :paramtype predicates: list[str] - :keyword filters: Filters of the route. - :paramtype filters: list[str] - :keyword order: Order of the route. - :paramtype order: int + :keyword client_id: The client id of the custom Open ID Connect provider. + :paramtype client_id: str + :keyword client_credential: The authentication credentials of the custom Open ID Connect + provider. + :paramtype client_credential: ~azure.mgmt.appcontainers.models.OpenIdConnectClientCredential + :keyword open_id_connect_configuration: The configuration settings of the endpoints used for + the custom Open ID Connect provider. + :paramtype open_id_connect_configuration: ~azure.mgmt.appcontainers.models.OpenIdConnectConfig """ super().__init__(**kwargs) - self.id = id - self.uri = uri - self.predicates = predicates - self.filters = filters - self.order = order + self.client_id = client_id + self.client_credential = client_credential + self.open_id_connect_configuration = open_id_connect_configuration -class Secret(_serialization.Model): - """Secret definition. +class OperationDetail(_serialization.Model): + """Operation detail payload. - :ivar name: Secret Name. + :ivar name: Name of the operation. :vartype name: str - :ivar value: Secret Value. - :vartype value: str - :ivar identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or - System to use a system-assigned identity. - :vartype identity: str - :ivar key_vault_url: Azure Key Vault URL pointing to the secret referenced by the container - app. - :vartype key_vault_url: str + :ivar is_data_action: Indicates whether the operation is a data action. + :vartype is_data_action: bool + :ivar display: Display of the operation. + :vartype display: ~azure.mgmt.appcontainers.models.OperationDisplay + :ivar origin: Origin of the operation. + :vartype origin: str """ _attribute_map = { "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - "identity": {"key": "identity", "type": "str"}, - "key_vault_url": {"key": "keyVaultUrl", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, } def __init__( self, *, name: Optional[str] = None, - value: Optional[str] = None, - identity: Optional[str] = None, - key_vault_url: Optional[str] = None, + is_data_action: Optional[bool] = None, + display: Optional["_models.OperationDisplay"] = None, + origin: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword name: Secret Name. + :keyword name: Name of the operation. :paramtype name: str - :keyword value: Secret Value. - :paramtype value: str - :keyword identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or - System to use a system-assigned identity. - :paramtype identity: str - :keyword key_vault_url: Azure Key Vault URL pointing to the secret referenced by the container - app. - :paramtype key_vault_url: str + :keyword is_data_action: Indicates whether the operation is a data action. + :paramtype is_data_action: bool + :keyword display: Display of the operation. + :paramtype display: ~azure.mgmt.appcontainers.models.OperationDisplay + :keyword origin: Origin of the operation. + :paramtype origin: str """ super().__init__(**kwargs) self.name = name - self.value = value - self.identity = identity - self.key_vault_url = key_vault_url - - -class SecretsCollection(_serialization.Model): - """Container App Secrets Collection ARM resource. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.ContainerAppSecret] - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ContainerAppSecret]"}, - } - - def __init__(self, *, value: List["_models.ContainerAppSecret"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.ContainerAppSecret] - """ - super().__init__(**kwargs) - self.value = value + self.is_data_action = is_data_action + self.display = display + self.origin = origin -class SecretVolumeItem(_serialization.Model): - """Secret to be added to volume. +class OperationDisplay(_serialization.Model): + """Operation display payload. - :ivar secret_ref: Name of the Container App secret from which to pull the secret value. - :vartype secret_ref: str - :ivar path: Path to project secret to. If no path is provided, path defaults to name of secret - listed in secretRef. - :vartype path: str + :ivar provider: Resource provider of the operation. + :vartype provider: str + :ivar resource: Resource of the operation. + :vartype resource: str + :ivar operation: Localized friendly name for the operation. + :vartype operation: str + :ivar description: Localized friendly description for the operation. + :vartype description: str """ _attribute_map = { - "secret_ref": {"key": "secretRef", "type": "str"}, - "path": {"key": "path", "type": "str"}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__(self, *, secret_ref: Optional[str] = None, path: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword secret_ref: Name of the Container App secret from which to pull the secret value. - :paramtype secret_ref: str - :keyword path: Path to project secret to. If no path is provided, path defaults to name of - secret listed in secretRef. - :paramtype path: str + :keyword provider: Resource provider of the operation. + :paramtype provider: str + :keyword resource: Resource of the operation. + :paramtype resource: str + :keyword operation: Localized friendly name for the operation. + :paramtype operation: str + :keyword description: Localized friendly description for the operation. + :paramtype description: str """ super().__init__(**kwargs) - self.secret_ref = secret_ref - self.path = path - + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description -class Service(_serialization.Model): - """Container App to be a dev service. - All required parameters must be populated in order to send to server. +class QueueScaleRule(_serialization.Model): + """Container App container Azure Queue based scaling rule. - :ivar type: Dev ContainerApp service type. Required. - :vartype type: str + :ivar account_name: Storage account name. required if using managed identity to authenticate. + :vartype account_name: str + :ivar queue_name: Queue name. + :vartype queue_name: str + :ivar queue_length: Queue length. + :vartype queue_length: int + :ivar auth: Authentication secrets for the queue scale rule. + :vartype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] + :ivar identity: The resource ID of a user-assigned managed identity that is assigned to the + Container App, or 'system' for system-assigned identity. + :vartype identity: str """ - _validation = { - "type": {"required": True}, - } - _attribute_map = { - "type": {"key": "type", "type": "str"}, + "account_name": {"key": "accountName", "type": "str"}, + "queue_name": {"key": "queueName", "type": "str"}, + "queue_length": {"key": "queueLength", "type": "int"}, + "auth": {"key": "auth", "type": "[ScaleRuleAuth]"}, + "identity": {"key": "identity", "type": "str"}, } - def __init__(self, *, type: str, **kwargs: Any) -> None: + def __init__( + self, + *, + account_name: Optional[str] = None, + queue_name: Optional[str] = None, + queue_length: Optional[int] = None, + auth: Optional[List["_models.ScaleRuleAuth"]] = None, + identity: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword type: Dev ContainerApp service type. Required. - :paramtype type: str + :keyword account_name: Storage account name. required if using managed identity to + authenticate. + :paramtype account_name: str + :keyword queue_name: Queue name. + :paramtype queue_name: str + :keyword queue_length: Queue length. + :paramtype queue_length: int + :keyword auth: Authentication secrets for the queue scale rule. + :paramtype auth: list[~azure.mgmt.appcontainers.models.ScaleRuleAuth] + :keyword identity: The resource ID of a user-assigned managed identity that is assigned to the + Container App, or 'system' for system-assigned identity. + :paramtype identity: str """ super().__init__(**kwargs) - self.type = type + self.account_name = account_name + self.queue_name = queue_name + self.queue_length = queue_length + self.auth = auth + self.identity = identity -class ServiceBind(_serialization.Model): - """Configuration to bind a ContainerApp to a dev ContainerApp Service. +class RegistryCredentials(_serialization.Model): + """Container App Private Registry. - :ivar service_id: Resource id of the target service. - :vartype service_id: str - :ivar name: Name of the service bind. - :vartype name: str - :ivar client_type: Type of the client to be used to connect to the service. - :vartype client_type: str - :ivar customized_keys: Customized keys for customizing injected values to the app. - :vartype customized_keys: dict[str, str] + :ivar server: Container Registry Server. + :vartype server: str + :ivar username: Container Registry Username. + :vartype username: str + :ivar password_secret_ref: The name of the Secret that contains the registry login password. + :vartype password_secret_ref: str + :ivar identity: A Managed Identity to use to authenticate with Azure Container Registry. For + user-assigned identities, use the full user-assigned identity Resource ID. For system-assigned + identities, use 'system'. + :vartype identity: str """ _attribute_map = { - "service_id": {"key": "serviceId", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "client_type": {"key": "clientType", "type": "str"}, - "customized_keys": {"key": "customizedKeys", "type": "{str}"}, + "server": {"key": "server", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "password_secret_ref": {"key": "passwordSecretRef", "type": "str"}, + "identity": {"key": "identity", "type": "str"}, } def __init__( self, *, - service_id: Optional[str] = None, - name: Optional[str] = None, - client_type: Optional[str] = None, - customized_keys: Optional[Dict[str, str]] = None, + server: Optional[str] = None, + username: Optional[str] = None, + password_secret_ref: Optional[str] = None, + identity: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword service_id: Resource id of the target service. - :paramtype service_id: str - :keyword name: Name of the service bind. - :paramtype name: str - :keyword client_type: Type of the client to be used to connect to the service. - :paramtype client_type: str - :keyword customized_keys: Customized keys for customizing injected values to the app. - :paramtype customized_keys: dict[str, str] + :keyword server: Container Registry Server. + :paramtype server: str + :keyword username: Container Registry Username. + :paramtype username: str + :keyword password_secret_ref: The name of the Secret that contains the registry login password. + :paramtype password_secret_ref: str + :keyword identity: A Managed Identity to use to authenticate with Azure Container Registry. For + user-assigned identities, use the full user-assigned identity Resource ID. For system-assigned + identities, use 'system'. + :paramtype identity: str """ super().__init__(**kwargs) - self.service_id = service_id - self.name = name - self.client_type = client_type - self.customized_keys = customized_keys + self.server = server + self.username = username + self.password_secret_ref = password_secret_ref + self.identity = identity -class SessionContainer(_serialization.Model): - """Container definitions for the sessions of the session pool. +class RegistryInfo(_serialization.Model): + """Container App registry information. - :ivar image: Container image tag. - :vartype image: str - :ivar name: Custom container name. - :vartype name: str - :ivar command: Container start command. - :vartype command: list[str] - :ivar args: Container start command arguments. - :vartype args: list[str] - :ivar env: Container environment variables. - :vartype env: list[~azure.mgmt.appcontainers.models.EnvironmentVar] - :ivar resources: Container resource requirements. - :vartype resources: ~azure.mgmt.appcontainers.models.SessionContainerResources + :ivar registry_url: registry server Url. + :vartype registry_url: str + :ivar registry_user_name: registry username. + :vartype registry_user_name: str + :ivar registry_password: registry secret. + :vartype registry_password: str """ _attribute_map = { - "image": {"key": "image", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "command": {"key": "command", "type": "[str]"}, - "args": {"key": "args", "type": "[str]"}, - "env": {"key": "env", "type": "[EnvironmentVar]"}, - "resources": {"key": "resources", "type": "SessionContainerResources"}, + "registry_url": {"key": "registryUrl", "type": "str"}, + "registry_user_name": {"key": "registryUserName", "type": "str"}, + "registry_password": {"key": "registryPassword", "type": "str"}, } def __init__( self, *, - image: Optional[str] = None, - name: Optional[str] = None, - command: Optional[List[str]] = None, - args: Optional[List[str]] = None, - env: Optional[List["_models.EnvironmentVar"]] = None, - resources: Optional["_models.SessionContainerResources"] = None, + registry_url: Optional[str] = None, + registry_user_name: Optional[str] = None, + registry_password: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword image: Container image tag. - :paramtype image: str - :keyword name: Custom container name. - :paramtype name: str - :keyword command: Container start command. - :paramtype command: list[str] - :keyword args: Container start command arguments. - :paramtype args: list[str] - :keyword env: Container environment variables. - :paramtype env: list[~azure.mgmt.appcontainers.models.EnvironmentVar] - :keyword resources: Container resource requirements. - :paramtype resources: ~azure.mgmt.appcontainers.models.SessionContainerResources + :keyword registry_url: registry server Url. + :paramtype registry_url: str + :keyword registry_user_name: registry username. + :paramtype registry_user_name: str + :keyword registry_password: registry secret. + :paramtype registry_password: str """ super().__init__(**kwargs) - self.image = image - self.name = name - self.command = command - self.args = args - self.env = env - self.resources = resources + self.registry_url = registry_url + self.registry_user_name = registry_user_name + self.registry_password = registry_password -class SessionContainerResources(_serialization.Model): - """Container resource requirements for sessions of the session pool. +class Replica(ProxyResource): + """Container App Revision Replica. - :ivar cpu: Required CPU in cores, e.g. 0.5. - :vartype cpu: float - :ivar memory: Required memory, e.g. "250Mb". - :vartype memory: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData + :ivar created_time: Timestamp describing when the pod was created by controller. + :vartype created_time: ~datetime.datetime + :ivar running_state: Current running state of the replica. Known values are: "Running", + "NotRunning", and "Unknown". + :vartype running_state: str or ~azure.mgmt.appcontainers.models.ContainerAppReplicaRunningState + :ivar running_state_details: The details of replica current running state. + :vartype running_state_details: str + :ivar containers: The containers collection under a replica. + :vartype containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] + :ivar init_containers: The init containers collection under a replica. + :vartype init_containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "created_time": {"readonly": True}, + "running_state": {"readonly": True}, + "running_state_details": {"readonly": True}, + } + _attribute_map = { - "cpu": {"key": "cpu", "type": "float"}, - "memory": {"key": "memory", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "running_state": {"key": "properties.runningState", "type": "str"}, + "running_state_details": {"key": "properties.runningStateDetails", "type": "str"}, + "containers": {"key": "properties.containers", "type": "[ReplicaContainer]"}, + "init_containers": {"key": "properties.initContainers", "type": "[ReplicaContainer]"}, } - def __init__(self, *, cpu: Optional[float] = None, memory: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + containers: Optional[List["_models.ReplicaContainer"]] = None, + init_containers: Optional[List["_models.ReplicaContainer"]] = None, + **kwargs: Any + ) -> None: """ - :keyword cpu: Required CPU in cores, e.g. 0.5. - :paramtype cpu: float - :keyword memory: Required memory, e.g. "250Mb". - :paramtype memory: str + :keyword containers: The containers collection under a replica. + :paramtype containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] + :keyword init_containers: The init containers collection under a replica. + :paramtype init_containers: list[~azure.mgmt.appcontainers.models.ReplicaContainer] """ super().__init__(**kwargs) - self.cpu = cpu - self.memory = memory + self.created_time = None + self.running_state = None + self.running_state_details = None + self.containers = containers + self.init_containers = init_containers -class SessionIngress(_serialization.Model): - """Session pool ingress configuration. +class ReplicaCollection(_serialization.Model): + """Container App Revision Replicas collection ARM resource. + + All required parameters must be populated in order to send to server. - :ivar target_port: Target port in containers for traffic from ingress. - :vartype target_port: int + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.Replica] """ + _validation = { + "value": {"required": True}, + } + _attribute_map = { - "target_port": {"key": "targetPort", "type": "int"}, + "value": {"key": "value", "type": "[Replica]"}, } - def __init__(self, *, target_port: Optional[int] = None, **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.Replica"], **kwargs: Any) -> None: """ - :keyword target_port: Target port in containers for traffic from ingress. - :paramtype target_port: int + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.Replica] """ super().__init__(**kwargs) - self.target_port = target_port + self.value = value + +class ReplicaContainer(_serialization.Model): + """Container object under Container App Revision Replica. -class SessionNetworkConfiguration(_serialization.Model): - """Session network configuration. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar status: Network status for the sessions. Known values are: "EgressEnabled" and - "EgressDisabled". - :vartype status: str or ~azure.mgmt.appcontainers.models.SessionNetworkStatus + :ivar name: The Name of the Container. + :vartype name: str + :ivar container_id: The Id of the Container. + :vartype container_id: str + :ivar ready: The container ready status. + :vartype ready: bool + :ivar started: The container start status. + :vartype started: bool + :ivar restart_count: The container restart count. + :vartype restart_count: int + :ivar running_state: Current running state of the container. Known values are: "Running", + "Terminated", and "Waiting". + :vartype running_state: str or + ~azure.mgmt.appcontainers.models.ContainerAppContainerRunningState + :ivar running_state_details: The details of container current running state. + :vartype running_state_details: str + :ivar log_stream_endpoint: Log Stream endpoint. + :vartype log_stream_endpoint: str + :ivar exec_endpoint: Container exec endpoint. + :vartype exec_endpoint: str """ + _validation = { + "running_state": {"readonly": True}, + "running_state_details": {"readonly": True}, + "log_stream_endpoint": {"readonly": True}, + "exec_endpoint": {"readonly": True}, + } + _attribute_map = { - "status": {"key": "status", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "container_id": {"key": "containerId", "type": "str"}, + "ready": {"key": "ready", "type": "bool"}, + "started": {"key": "started", "type": "bool"}, + "restart_count": {"key": "restartCount", "type": "int"}, + "running_state": {"key": "runningState", "type": "str"}, + "running_state_details": {"key": "runningStateDetails", "type": "str"}, + "log_stream_endpoint": {"key": "logStreamEndpoint", "type": "str"}, + "exec_endpoint": {"key": "execEndpoint", "type": "str"}, } - def __init__(self, *, status: Optional[Union[str, "_models.SessionNetworkStatus"]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + container_id: Optional[str] = None, + ready: Optional[bool] = None, + started: Optional[bool] = None, + restart_count: Optional[int] = None, + **kwargs: Any + ) -> None: """ - :keyword status: Network status for the sessions. Known values are: "EgressEnabled" and - "EgressDisabled". - :paramtype status: str or ~azure.mgmt.appcontainers.models.SessionNetworkStatus + :keyword name: The Name of the Container. + :paramtype name: str + :keyword container_id: The Id of the Container. + :paramtype container_id: str + :keyword ready: The container ready status. + :paramtype ready: bool + :keyword started: The container start status. + :paramtype started: bool + :keyword restart_count: The container restart count. + :paramtype restart_count: int """ super().__init__(**kwargs) - self.status = status + self.name = name + self.container_id = container_id + self.ready = ready + self.started = started + self.restart_count = restart_count + self.running_state = None + self.running_state_details = None + self.log_stream_endpoint = None + self.exec_endpoint = None -class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attributes - """Container App session pool. +class Revision(ProxyResource): + """Container App Revision. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -11833,39 +7414,35 @@ class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attribu :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar environment_id: Resource ID of the session pool's environment. - :vartype environment_id: str - :ivar container_type: The container type of the sessions. Known values are: "CustomContainer" - and "PythonLTS". - :vartype container_type: str or ~azure.mgmt.appcontainers.models.ContainerType - :ivar pool_management_type: The pool management type of the session pool. Known values are: - "Manual" and "Dynamic". - :vartype pool_management_type: str or ~azure.mgmt.appcontainers.models.PoolManagementType - :ivar node_count: The number of nodes the session pool is using. - :vartype node_count: int - :ivar scale_configuration: The scale configuration of the session pool. - :vartype scale_configuration: ~azure.mgmt.appcontainers.models.ScaleConfiguration - :ivar secrets: The secrets of the session pool. - :vartype secrets: list[~azure.mgmt.appcontainers.models.SessionPoolSecret] - :ivar dynamic_pool_configuration: The pool configuration if the poolManagementType is dynamic. - :vartype dynamic_pool_configuration: ~azure.mgmt.appcontainers.models.DynamicPoolConfiguration - :ivar custom_container_template: The custom container configuration if the containerType is - CustomContainer. - :vartype custom_container_template: ~azure.mgmt.appcontainers.models.CustomContainerTemplate - :ivar session_network_configuration: The network configuration of the sessions in the session - pool. - :vartype session_network_configuration: - ~azure.mgmt.appcontainers.models.SessionNetworkConfiguration - :ivar pool_management_endpoint: The endpoint to manage the pool. - :vartype pool_management_endpoint: str - :ivar provisioning_state: Provisioning state of the session pool. Known values are: - "InProgress", "Succeeded", "Failed", "Canceled", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.SessionPoolProvisioningState + :ivar created_time: Timestamp describing when the revision was created + by controller. + :vartype created_time: ~datetime.datetime + :ivar last_active_time: Timestamp describing when the revision was last active. Only meaningful + when revision is inactive. + :vartype last_active_time: ~datetime.datetime + :ivar fqdn: Fully qualified domain name of the revision. + :vartype fqdn: str + :ivar template: Container App Revision Template with all possible settings and the + defaults if user did not provide them. The defaults are populated + as they were at the creation time. + :vartype template: ~azure.mgmt.appcontainers.models.Template + :ivar active: Boolean describing if the Revision is Active. + :vartype active: bool + :ivar replicas: Number of pods currently running for this revision. + :vartype replicas: int + :ivar traffic_weight: Traffic weight assigned to this revision. + :vartype traffic_weight: int + :ivar provisioning_error: Optional Field - Platform Error Message. + :vartype provisioning_error: str + :ivar health_state: Current health State of the revision. Known values are: "Healthy", + "Unhealthy", and "None". + :vartype health_state: str or ~azure.mgmt.appcontainers.models.RevisionHealthState + :ivar provisioning_state: Current provisioning State of the revision. Known values are: + "Provisioning", "Provisioned", "Failed", "Deprovisioning", and "Deprovisioned". + :vartype provisioning_state: str or ~azure.mgmt.appcontainers.models.RevisionProvisioningState + :ivar running_state: Current running state of the revision. Known values are: "Running", + "Processing", "Stopped", "Degraded", "Failed", and "Unknown". + :vartype running_state: str or ~azure.mgmt.appcontainers.models.RevisionRunningState """ _validation = { @@ -11873,10 +7450,17 @@ class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attribu "name": {"readonly": True}, "type": {"readonly": True}, "system_data": {"readonly": True}, - "location": {"required": True}, - "node_count": {"readonly": True}, - "pool_management_endpoint": {"readonly": True}, + "created_time": {"readonly": True}, + "last_active_time": {"readonly": True}, + "fqdn": {"readonly": True}, + "template": {"readonly": True}, + "active": {"readonly": True}, + "replicas": {"readonly": True}, + "traffic_weight": {"readonly": True}, + "provisioning_error": {"readonly": True}, + "health_state": {"readonly": True}, "provisioning_state": {"readonly": True}, + "running_state": {"readonly": True}, } _attribute_map = { @@ -11884,94 +7468,44 @@ class SessionPool(TrackedResource): # pylint: disable=too-many-instance-attribu "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "environment_id": {"key": "properties.environmentId", "type": "str"}, - "container_type": {"key": "properties.containerType", "type": "str"}, - "pool_management_type": {"key": "properties.poolManagementType", "type": "str"}, - "node_count": {"key": "properties.nodeCount", "type": "int"}, - "scale_configuration": {"key": "properties.scaleConfiguration", "type": "ScaleConfiguration"}, - "secrets": {"key": "properties.secrets", "type": "[SessionPoolSecret]"}, - "dynamic_pool_configuration": { - "key": "properties.dynamicPoolConfiguration", - "type": "DynamicPoolConfiguration", - }, - "custom_container_template": {"key": "properties.customContainerTemplate", "type": "CustomContainerTemplate"}, - "session_network_configuration": { - "key": "properties.sessionNetworkConfiguration", - "type": "SessionNetworkConfiguration", - }, - "pool_management_endpoint": {"key": "properties.poolManagementEndpoint", "type": "str"}, + "created_time": {"key": "properties.createdTime", "type": "iso-8601"}, + "last_active_time": {"key": "properties.lastActiveTime", "type": "iso-8601"}, + "fqdn": {"key": "properties.fqdn", "type": "str"}, + "template": {"key": "properties.template", "type": "Template"}, + "active": {"key": "properties.active", "type": "bool"}, + "replicas": {"key": "properties.replicas", "type": "int"}, + "traffic_weight": {"key": "properties.trafficWeight", "type": "int"}, + "provisioning_error": {"key": "properties.provisioningError", "type": "str"}, + "health_state": {"key": "properties.healthState", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "running_state": {"key": "properties.runningState", "type": "str"}, } - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - environment_id: Optional[str] = None, - container_type: Optional[Union[str, "_models.ContainerType"]] = None, - pool_management_type: Optional[Union[str, "_models.PoolManagementType"]] = None, - scale_configuration: Optional["_models.ScaleConfiguration"] = None, - secrets: Optional[List["_models.SessionPoolSecret"]] = None, - dynamic_pool_configuration: Optional["_models.DynamicPoolConfiguration"] = None, - custom_container_template: Optional["_models.CustomContainerTemplate"] = None, - session_network_configuration: Optional["_models.SessionNetworkConfiguration"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword environment_id: Resource ID of the session pool's environment. - :paramtype environment_id: str - :keyword container_type: The container type of the sessions. Known values are: - "CustomContainer" and "PythonLTS". - :paramtype container_type: str or ~azure.mgmt.appcontainers.models.ContainerType - :keyword pool_management_type: The pool management type of the session pool. Known values are: - "Manual" and "Dynamic". - :paramtype pool_management_type: str or ~azure.mgmt.appcontainers.models.PoolManagementType - :keyword scale_configuration: The scale configuration of the session pool. - :paramtype scale_configuration: ~azure.mgmt.appcontainers.models.ScaleConfiguration - :keyword secrets: The secrets of the session pool. - :paramtype secrets: list[~azure.mgmt.appcontainers.models.SessionPoolSecret] - :keyword dynamic_pool_configuration: The pool configuration if the poolManagementType is - dynamic. - :paramtype dynamic_pool_configuration: - ~azure.mgmt.appcontainers.models.DynamicPoolConfiguration - :keyword custom_container_template: The custom container configuration if the containerType is - CustomContainer. - :paramtype custom_container_template: ~azure.mgmt.appcontainers.models.CustomContainerTemplate - :keyword session_network_configuration: The network configuration of the sessions in the - session pool. - :paramtype session_network_configuration: - ~azure.mgmt.appcontainers.models.SessionNetworkConfiguration - """ - super().__init__(tags=tags, location=location, **kwargs) - self.environment_id = environment_id - self.container_type = container_type - self.pool_management_type = pool_management_type - self.node_count = None - self.scale_configuration = scale_configuration - self.secrets = secrets - self.dynamic_pool_configuration = dynamic_pool_configuration - self.custom_container_template = custom_container_template - self.session_network_configuration = session_network_configuration - self.pool_management_endpoint = None + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.created_time = None + self.last_active_time = None + self.fqdn = None + self.template = None + self.active = None + self.replicas = None + self.traffic_weight = None + self.provisioning_error = None + self.health_state = None self.provisioning_state = None + self.running_state = None -class SessionPoolCollection(_serialization.Model): - """Session pool collection Azure resource. +class RevisionCollection(_serialization.Model): + """Container App Revisions collection ARM resource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.SessionPool] + :vartype value: list[~azure.mgmt.appcontainers.models.Revision] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -11982,590 +7516,426 @@ class SessionPoolCollection(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[SessionPool]"}, + "value": {"key": "value", "type": "[Revision]"}, "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: List["_models.SessionPool"], **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.Revision"], **kwargs: Any) -> None: """ :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.SessionPool] + :paramtype value: list[~azure.mgmt.appcontainers.models.Revision] """ super().__init__(**kwargs) self.value = value self.next_link = None -class SessionPoolSecret(_serialization.Model): - """Secret definition. - - :ivar name: Secret Name. - :vartype name: str - :ivar value: Secret Value. - :vartype value: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Secret Name. - :paramtype name: str - :keyword value: Secret Value. - :paramtype value: str - """ - super().__init__(**kwargs) - self.name = name - self.value = value - - -class SessionPoolUpdatableProperties(_serialization.Model): - """Container App session pool updatable properties. +class Scale(_serialization.Model): + """Container App scaling configurations. - :ivar scale_configuration: The scale configuration of the session pool. - :vartype scale_configuration: ~azure.mgmt.appcontainers.models.ScaleConfiguration - :ivar secrets: The secrets of the session pool. - :vartype secrets: list[~azure.mgmt.appcontainers.models.SessionPoolSecret] - :ivar dynamic_pool_configuration: The pool configuration if the poolManagementType is dynamic. - :vartype dynamic_pool_configuration: ~azure.mgmt.appcontainers.models.DynamicPoolConfiguration - :ivar custom_container_template: The custom container configuration if the containerType is - CustomContainer. - :vartype custom_container_template: ~azure.mgmt.appcontainers.models.CustomContainerTemplate - :ivar session_network_configuration: The network configuration of the sessions in the session - pool. - :vartype session_network_configuration: - ~azure.mgmt.appcontainers.models.SessionNetworkConfiguration + :ivar min_replicas: Optional. Minimum number of container replicas. + :vartype min_replicas: int + :ivar max_replicas: Optional. Maximum number of container replicas. Defaults to 10 if not set. + :vartype max_replicas: int + :ivar cooldown_period: Optional. KEDA Cooldown Period in seconds. Defaults to 300 seconds if + not set. + :vartype cooldown_period: int + :ivar polling_interval: Optional. KEDA Polling Interval in seconds. Defaults to 30 seconds if + not set. + :vartype polling_interval: int + :ivar rules: Scaling rules. + :vartype rules: list[~azure.mgmt.appcontainers.models.ScaleRule] """ _attribute_map = { - "scale_configuration": {"key": "properties.scaleConfiguration", "type": "ScaleConfiguration"}, - "secrets": {"key": "properties.secrets", "type": "[SessionPoolSecret]"}, - "dynamic_pool_configuration": { - "key": "properties.dynamicPoolConfiguration", - "type": "DynamicPoolConfiguration", - }, - "custom_container_template": {"key": "properties.customContainerTemplate", "type": "CustomContainerTemplate"}, - "session_network_configuration": { - "key": "properties.sessionNetworkConfiguration", - "type": "SessionNetworkConfiguration", - }, + "min_replicas": {"key": "minReplicas", "type": "int"}, + "max_replicas": {"key": "maxReplicas", "type": "int"}, + "cooldown_period": {"key": "cooldownPeriod", "type": "int"}, + "polling_interval": {"key": "pollingInterval", "type": "int"}, + "rules": {"key": "rules", "type": "[ScaleRule]"}, } def __init__( self, *, - scale_configuration: Optional["_models.ScaleConfiguration"] = None, - secrets: Optional[List["_models.SessionPoolSecret"]] = None, - dynamic_pool_configuration: Optional["_models.DynamicPoolConfiguration"] = None, - custom_container_template: Optional["_models.CustomContainerTemplate"] = None, - session_network_configuration: Optional["_models.SessionNetworkConfiguration"] = None, + min_replicas: Optional[int] = None, + max_replicas: int = 10, + cooldown_period: Optional[int] = None, + polling_interval: Optional[int] = None, + rules: Optional[List["_models.ScaleRule"]] = None, **kwargs: Any ) -> None: """ - :keyword scale_configuration: The scale configuration of the session pool. - :paramtype scale_configuration: ~azure.mgmt.appcontainers.models.ScaleConfiguration - :keyword secrets: The secrets of the session pool. - :paramtype secrets: list[~azure.mgmt.appcontainers.models.SessionPoolSecret] - :keyword dynamic_pool_configuration: The pool configuration if the poolManagementType is - dynamic. - :paramtype dynamic_pool_configuration: - ~azure.mgmt.appcontainers.models.DynamicPoolConfiguration - :keyword custom_container_template: The custom container configuration if the containerType is - CustomContainer. - :paramtype custom_container_template: ~azure.mgmt.appcontainers.models.CustomContainerTemplate - :keyword session_network_configuration: The network configuration of the sessions in the - session pool. - :paramtype session_network_configuration: - ~azure.mgmt.appcontainers.models.SessionNetworkConfiguration - """ - super().__init__(**kwargs) - self.scale_configuration = scale_configuration - self.secrets = secrets - self.dynamic_pool_configuration = dynamic_pool_configuration - self.custom_container_template = custom_container_template - self.session_network_configuration = session_network_configuration + :keyword min_replicas: Optional. Minimum number of container replicas. + :paramtype min_replicas: int + :keyword max_replicas: Optional. Maximum number of container replicas. Defaults to 10 if not + set. + :paramtype max_replicas: int + :keyword cooldown_period: Optional. KEDA Cooldown Period in seconds. Defaults to 300 seconds if + not set. + :paramtype cooldown_period: int + :keyword polling_interval: Optional. KEDA Polling Interval in seconds. Defaults to 30 seconds + if not set. + :paramtype polling_interval: int + :keyword rules: Scaling rules. + :paramtype rules: list[~azure.mgmt.appcontainers.models.ScaleRule] + """ + super().__init__(**kwargs) + self.min_replicas = min_replicas + self.max_replicas = max_replicas + self.cooldown_period = cooldown_period + self.polling_interval = polling_interval + self.rules = rules -class SessionRegistryCredentials(_serialization.Model): - """Session pool private registry credentials. +class ScaleRule(_serialization.Model): + """Container App container scaling rule. - :ivar server: Container registry server. - :vartype server: str - :ivar username: Container registry username. - :vartype username: str - :ivar password_secret_ref: The name of the secret that contains the registry login password. - :vartype password_secret_ref: str - :ivar identity: A Managed Identity to use to authenticate with Azure Container Registry. For - user-assigned identities, use the full user-assigned identity Resource ID. For system-assigned - identities, use 'system'. - :vartype identity: str + :ivar name: Scale Rule Name. + :vartype name: str + :ivar azure_queue: Azure Queue based scaling. + :vartype azure_queue: ~azure.mgmt.appcontainers.models.QueueScaleRule + :ivar custom: Custom scale rule. + :vartype custom: ~azure.mgmt.appcontainers.models.CustomScaleRule + :ivar http: HTTP requests based scaling. + :vartype http: ~azure.mgmt.appcontainers.models.HttpScaleRule + :ivar tcp: Tcp requests based scaling. + :vartype tcp: ~azure.mgmt.appcontainers.models.TcpScaleRule """ _attribute_map = { - "server": {"key": "server", "type": "str"}, - "username": {"key": "username", "type": "str"}, - "password_secret_ref": {"key": "passwordSecretRef", "type": "str"}, - "identity": {"key": "identity", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "azure_queue": {"key": "azureQueue", "type": "QueueScaleRule"}, + "custom": {"key": "custom", "type": "CustomScaleRule"}, + "http": {"key": "http", "type": "HttpScaleRule"}, + "tcp": {"key": "tcp", "type": "TcpScaleRule"}, } def __init__( self, *, - server: Optional[str] = None, - username: Optional[str] = None, - password_secret_ref: Optional[str] = None, - identity: Optional[str] = None, + name: Optional[str] = None, + azure_queue: Optional["_models.QueueScaleRule"] = None, + custom: Optional["_models.CustomScaleRule"] = None, + http: Optional["_models.HttpScaleRule"] = None, + tcp: Optional["_models.TcpScaleRule"] = None, **kwargs: Any ) -> None: """ - :keyword server: Container registry server. - :paramtype server: str - :keyword username: Container registry username. - :paramtype username: str - :keyword password_secret_ref: The name of the secret that contains the registry login password. - :paramtype password_secret_ref: str - :keyword identity: A Managed Identity to use to authenticate with Azure Container Registry. For - user-assigned identities, use the full user-assigned identity Resource ID. For system-assigned - identities, use 'system'. - :paramtype identity: str - """ - super().__init__(**kwargs) - self.server = server - self.username = username - self.password_secret_ref = password_secret_ref - self.identity = identity + :keyword name: Scale Rule Name. + :paramtype name: str + :keyword azure_queue: Azure Queue based scaling. + :paramtype azure_queue: ~azure.mgmt.appcontainers.models.QueueScaleRule + :keyword custom: Custom scale rule. + :paramtype custom: ~azure.mgmt.appcontainers.models.CustomScaleRule + :keyword http: HTTP requests based scaling. + :paramtype http: ~azure.mgmt.appcontainers.models.HttpScaleRule + :keyword tcp: Tcp requests based scaling. + :paramtype tcp: ~azure.mgmt.appcontainers.models.TcpScaleRule + """ + super().__init__(**kwargs) + self.name = name + self.azure_queue = azure_queue + self.custom = custom + self.http = http + self.tcp = tcp -class SmbStorage(_serialization.Model): - """SMB storage properties. +class ScaleRuleAuth(_serialization.Model): + """Auth Secrets for Scale Rule. - :ivar host: The host name or IP address of the SMB server. - :vartype host: str - :ivar share_name: The path to the SMB shared folder. - :vartype share_name: str - :ivar username: The user to log on to the SMB server. - :vartype username: str - :ivar domain: The domain name for the user. - :vartype domain: str - :ivar password: The password for the user. - :vartype password: str - :ivar access_mode: Access mode for storage. Known values are: "ReadOnly" and "ReadWrite". - :vartype access_mode: str or ~azure.mgmt.appcontainers.models.AccessMode + :ivar secret_ref: Name of the secret from which to pull the auth params. + :vartype secret_ref: str + :ivar trigger_parameter: Trigger Parameter that uses the secret. + :vartype trigger_parameter: str """ _attribute_map = { - "host": {"key": "host", "type": "str"}, - "share_name": {"key": "shareName", "type": "str"}, - "username": {"key": "username", "type": "str"}, - "domain": {"key": "domain", "type": "str"}, - "password": {"key": "password", "type": "str"}, - "access_mode": {"key": "accessMode", "type": "str"}, + "secret_ref": {"key": "secretRef", "type": "str"}, + "trigger_parameter": {"key": "triggerParameter", "type": "str"}, } def __init__( - self, - *, - host: Optional[str] = None, - share_name: Optional[str] = None, - username: Optional[str] = None, - domain: Optional[str] = None, - password: Optional[str] = None, - access_mode: Optional[Union[str, "_models.AccessMode"]] = None, - **kwargs: Any + self, *, secret_ref: Optional[str] = None, trigger_parameter: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword host: The host name or IP address of the SMB server. - :paramtype host: str - :keyword share_name: The path to the SMB shared folder. - :paramtype share_name: str - :keyword username: The user to log on to the SMB server. - :paramtype username: str - :keyword domain: The domain name for the user. - :paramtype domain: str - :keyword password: The password for the user. - :paramtype password: str - :keyword access_mode: Access mode for storage. Known values are: "ReadOnly" and "ReadWrite". - :paramtype access_mode: str or ~azure.mgmt.appcontainers.models.AccessMode + :keyword secret_ref: Name of the secret from which to pull the auth params. + :paramtype secret_ref: str + :keyword trigger_parameter: Trigger Parameter that uses the secret. + :paramtype trigger_parameter: str """ super().__init__(**kwargs) - self.host = host - self.share_name = share_name - self.username = username - self.domain = domain - self.password = password - self.access_mode = access_mode - + self.secret_ref = secret_ref + self.trigger_parameter = trigger_parameter -class SourceControl(ProxyResource): - """Container App SourceControl. - Variables are only populated by the server, and will be ignored when sending a request. +class Secret(_serialization.Model): + """Secret definition. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. + :ivar name: Secret Name. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData - :ivar operation_state: Current provisioning State of the operation. Known values are: - "InProgress", "Succeeded", "Failed", and "Canceled". - :vartype operation_state: str or ~azure.mgmt.appcontainers.models.SourceControlOperationState - :ivar repo_url: The repo url which will be integrated to ContainerApp. - :vartype repo_url: str - :ivar branch: The branch which will trigger the auto deployment. - :vartype branch: str - :ivar github_action_configuration: Container App Revision Template with all possible settings - and the - defaults if user did not provide them. The defaults are populated - as they were at the creation time. - :vartype github_action_configuration: - ~azure.mgmt.appcontainers.models.GithubActionConfiguration + :ivar value: Secret Value. + :vartype value: str + :ivar identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or + System to use a system-assigned identity. + :vartype identity: str + :ivar key_vault_url: Azure Key Vault URL pointing to the secret referenced by the container + app. + :vartype key_vault_url: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "operation_state": {"readonly": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "operation_state": {"key": "properties.operationState", "type": "str"}, - "repo_url": {"key": "properties.repoUrl", "type": "str"}, - "branch": {"key": "properties.branch", "type": "str"}, - "github_action_configuration": { - "key": "properties.githubActionConfiguration", - "type": "GithubActionConfiguration", - }, + "value": {"key": "value", "type": "str"}, + "identity": {"key": "identity", "type": "str"}, + "key_vault_url": {"key": "keyVaultUrl", "type": "str"}, } def __init__( self, *, - repo_url: Optional[str] = None, - branch: Optional[str] = None, - github_action_configuration: Optional["_models.GithubActionConfiguration"] = None, + name: Optional[str] = None, + value: Optional[str] = None, + identity: Optional[str] = None, + key_vault_url: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword repo_url: The repo url which will be integrated to ContainerApp. - :paramtype repo_url: str - :keyword branch: The branch which will trigger the auto deployment. - :paramtype branch: str - :keyword github_action_configuration: Container App Revision Template with all possible - settings and the - defaults if user did not provide them. The defaults are populated - as they were at the creation time. - :paramtype github_action_configuration: - ~azure.mgmt.appcontainers.models.GithubActionConfiguration + :keyword name: Secret Name. + :paramtype name: str + :keyword value: Secret Value. + :paramtype value: str + :keyword identity: Resource ID of a managed identity to authenticate with Azure Key Vault, or + System to use a system-assigned identity. + :paramtype identity: str + :keyword key_vault_url: Azure Key Vault URL pointing to the secret referenced by the container + app. + :paramtype key_vault_url: str """ super().__init__(**kwargs) - self.operation_state = None - self.repo_url = repo_url - self.branch = branch - self.github_action_configuration = github_action_configuration - + self.name = name + self.value = value + self.identity = identity + self.key_vault_url = key_vault_url -class SourceControlCollection(_serialization.Model): - """SourceControl collection ARM resource. - Variables are only populated by the server, and will be ignored when sending a request. +class SecretsCollection(_serialization.Model): + """Container App Secrets Collection ARM resource. All required parameters must be populated in order to send to server. :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.SourceControl] - :ivar next_link: Link to next page of resources. - :vartype next_link: str + :vartype value: list[~azure.mgmt.appcontainers.models.ContainerAppSecret] """ _validation = { "value": {"required": True}, - "next_link": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[SourceControl]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[ContainerAppSecret]"}, } - def __init__(self, *, value: List["_models.SourceControl"], **kwargs: Any) -> None: + def __init__(self, *, value: List["_models.ContainerAppSecret"], **kwargs: Any) -> None: """ :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.SourceControl] + :paramtype value: list[~azure.mgmt.appcontainers.models.ContainerAppSecret] """ super().__init__(**kwargs) self.value = value - self.next_link = None -class SpringBootAdminComponent(JavaComponentProperties): - """Spring Boot Admin properties. +class SecretVolumeItem(_serialization.Model): + """Secret to be added to volume. - Variables are only populated by the server, and will be ignored when sending a request. + :ivar secret_ref: Name of the Container App secret from which to pull the secret value. + :vartype secret_ref: str + :ivar path: Path to project secret to. If no path is provided, path defaults to name of secret + listed in secretRef. + :vartype path: str + """ + + _attribute_map = { + "secret_ref": {"key": "secretRef", "type": "str"}, + "path": {"key": "path", "type": "str"}, + } + + def __init__(self, *, secret_ref: Optional[str] = None, path: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword secret_ref: Name of the Container App secret from which to pull the secret value. + :paramtype secret_ref: str + :keyword path: Path to project secret to. If no path is provided, path defaults to name of + secret listed in secretRef. + :paramtype path: str + """ + super().__init__(**kwargs) + self.secret_ref = secret_ref + self.path = path + + +class Service(_serialization.Model): + """Container App to be a dev service. All required parameters must be populated in order to send to server. - :ivar component_type: Type of the Java Component. Required. Known values are: - "SpringBootAdmin", "SpringCloudEureka", "SpringCloudConfig", "SpringCloudGateway", and "Nacos". - :vartype component_type: str or ~azure.mgmt.appcontainers.models.JavaComponentType - :ivar provisioning_state: Provisioning state of the Java Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.JavaComponentProvisioningState - :ivar configurations: List of Java Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :ivar scale: Java component scaling configurations. - :vartype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :ivar service_binds: List of Java Components that are bound to the Java component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - :ivar ingress: Java Component Ingress configurations. - :vartype ingress: ~azure.mgmt.appcontainers.models.JavaComponentIngress + :ivar type: Dev ContainerApp service type. Required. + :vartype type: str """ _validation = { - "component_type": {"required": True}, - "provisioning_state": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - "component_type": {"key": "componentType", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "configurations": {"key": "configurations", "type": "[JavaComponentConfigurationProperty]"}, - "scale": {"key": "scale", "type": "JavaComponentPropertiesScale"}, - "service_binds": {"key": "serviceBinds", "type": "[JavaComponentServiceBind]"}, - "ingress": {"key": "ingress", "type": "JavaComponentIngress"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - *, - configurations: Optional[List["_models.JavaComponentConfigurationProperty"]] = None, - scale: Optional["_models.JavaComponentPropertiesScale"] = None, - service_binds: Optional[List["_models.JavaComponentServiceBind"]] = None, - ingress: Optional["_models.JavaComponentIngress"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, type: str, **kwargs: Any) -> None: """ - :keyword configurations: List of Java Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :keyword scale: Java component scaling configurations. - :paramtype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :keyword service_binds: List of Java Components that are bound to the Java component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - :keyword ingress: Java Component Ingress configurations. - :paramtype ingress: ~azure.mgmt.appcontainers.models.JavaComponentIngress - """ - super().__init__(configurations=configurations, scale=scale, service_binds=service_binds, **kwargs) - self.component_type: str = "SpringBootAdmin" - self.ingress = ingress - - -class SpringCloudConfigComponent(JavaComponentProperties): - """Spring Cloud Config properties. + :keyword type: Dev ContainerApp service type. Required. + :paramtype type: str + """ + super().__init__(**kwargs) + self.type = type - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. +class ServiceBind(_serialization.Model): + """Configuration to bind a ContainerApp to a dev ContainerApp Service. - :ivar component_type: Type of the Java Component. Required. Known values are: - "SpringBootAdmin", "SpringCloudEureka", "SpringCloudConfig", "SpringCloudGateway", and "Nacos". - :vartype component_type: str or ~azure.mgmt.appcontainers.models.JavaComponentType - :ivar provisioning_state: Provisioning state of the Java Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.JavaComponentProvisioningState - :ivar configurations: List of Java Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :ivar scale: Java component scaling configurations. - :vartype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :ivar service_binds: List of Java Components that are bound to the Java component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] + :ivar service_id: Resource id of the target service. + :vartype service_id: str + :ivar name: Name of the service bind. + :vartype name: str """ - _validation = { - "component_type": {"required": True}, - "provisioning_state": {"readonly": True}, - } - _attribute_map = { - "component_type": {"key": "componentType", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "configurations": {"key": "configurations", "type": "[JavaComponentConfigurationProperty]"}, - "scale": {"key": "scale", "type": "JavaComponentPropertiesScale"}, - "service_binds": {"key": "serviceBinds", "type": "[JavaComponentServiceBind]"}, + "service_id": {"key": "serviceId", "type": "str"}, + "name": {"key": "name", "type": "str"}, } - def __init__( - self, - *, - configurations: Optional[List["_models.JavaComponentConfigurationProperty"]] = None, - scale: Optional["_models.JavaComponentPropertiesScale"] = None, - service_binds: Optional[List["_models.JavaComponentServiceBind"]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, service_id: Optional[str] = None, name: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword configurations: List of Java Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :keyword scale: Java component scaling configurations. - :paramtype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :keyword service_binds: List of Java Components that are bound to the Java component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] + :keyword service_id: Resource id of the target service. + :paramtype service_id: str + :keyword name: Name of the service bind. + :paramtype name: str """ - super().__init__(configurations=configurations, scale=scale, service_binds=service_binds, **kwargs) - self.component_type: str = "SpringCloudConfig" + super().__init__(**kwargs) + self.service_id = service_id + self.name = name -class SpringCloudEurekaComponent(JavaComponentProperties): - """Spring Cloud Eureka properties. +class SourceControl(ProxyResource): + """Container App SourceControl. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - - :ivar component_type: Type of the Java Component. Required. Known values are: - "SpringBootAdmin", "SpringCloudEureka", "SpringCloudConfig", "SpringCloudGateway", and "Nacos". - :vartype component_type: str or ~azure.mgmt.appcontainers.models.JavaComponentType - :ivar provisioning_state: Provisioning state of the Java Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.JavaComponentProvisioningState - :ivar configurations: List of Java Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :ivar scale: Java component scaling configurations. - :vartype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :ivar service_binds: List of Java Components that are bound to the Java component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - :ivar ingress: Java Component Ingress configurations. - :vartype ingress: ~azure.mgmt.appcontainers.models.JavaComponentIngress + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.appcontainers.models.SystemData + :ivar operation_state: Current provisioning State of the operation. Known values are: + "InProgress", "Succeeded", "Failed", and "Canceled". + :vartype operation_state: str or ~azure.mgmt.appcontainers.models.SourceControlOperationState + :ivar repo_url: The repo url which will be integrated to ContainerApp. + :vartype repo_url: str + :ivar branch: The branch which will trigger the auto deployment. + :vartype branch: str + :ivar github_action_configuration: Container App Revision Template with all possible settings + and the + defaults if user did not provide them. The defaults are populated + as they were at the creation time. + :vartype github_action_configuration: + ~azure.mgmt.appcontainers.models.GithubActionConfiguration """ _validation = { - "component_type": {"required": True}, - "provisioning_state": {"readonly": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "operation_state": {"readonly": True}, } _attribute_map = { - "component_type": {"key": "componentType", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "configurations": {"key": "configurations", "type": "[JavaComponentConfigurationProperty]"}, - "scale": {"key": "scale", "type": "JavaComponentPropertiesScale"}, - "service_binds": {"key": "serviceBinds", "type": "[JavaComponentServiceBind]"}, - "ingress": {"key": "ingress", "type": "JavaComponentIngress"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "operation_state": {"key": "properties.operationState", "type": "str"}, + "repo_url": {"key": "properties.repoUrl", "type": "str"}, + "branch": {"key": "properties.branch", "type": "str"}, + "github_action_configuration": { + "key": "properties.githubActionConfiguration", + "type": "GithubActionConfiguration", + }, } def __init__( self, *, - configurations: Optional[List["_models.JavaComponentConfigurationProperty"]] = None, - scale: Optional["_models.JavaComponentPropertiesScale"] = None, - service_binds: Optional[List["_models.JavaComponentServiceBind"]] = None, - ingress: Optional["_models.JavaComponentIngress"] = None, + repo_url: Optional[str] = None, + branch: Optional[str] = None, + github_action_configuration: Optional["_models.GithubActionConfiguration"] = None, **kwargs: Any ) -> None: """ - :keyword configurations: List of Java Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :keyword scale: Java component scaling configurations. - :paramtype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :keyword service_binds: List of Java Components that are bound to the Java component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - :keyword ingress: Java Component Ingress configurations. - :paramtype ingress: ~azure.mgmt.appcontainers.models.JavaComponentIngress - """ - super().__init__(configurations=configurations, scale=scale, service_binds=service_binds, **kwargs) - self.component_type: str = "SpringCloudEureka" - self.ingress = ingress + :keyword repo_url: The repo url which will be integrated to ContainerApp. + :paramtype repo_url: str + :keyword branch: The branch which will trigger the auto deployment. + :paramtype branch: str + :keyword github_action_configuration: Container App Revision Template with all possible + settings and the + defaults if user did not provide them. The defaults are populated + as they were at the creation time. + :paramtype github_action_configuration: + ~azure.mgmt.appcontainers.models.GithubActionConfiguration + """ + super().__init__(**kwargs) + self.operation_state = None + self.repo_url = repo_url + self.branch = branch + self.github_action_configuration = github_action_configuration -class SpringCloudGatewayComponent(JavaComponentProperties): - """Spring Cloud Gateway properties. +class SourceControlCollection(_serialization.Model): + """SourceControl collection ARM resource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar component_type: Type of the Java Component. Required. Known values are: - "SpringBootAdmin", "SpringCloudEureka", "SpringCloudConfig", "SpringCloudGateway", and "Nacos". - :vartype component_type: str or ~azure.mgmt.appcontainers.models.JavaComponentType - :ivar provisioning_state: Provisioning state of the Java Component. Known values are: - "Succeeded", "Failed", "Canceled", "Deleting", and "InProgress". - :vartype provisioning_state: str or - ~azure.mgmt.appcontainers.models.JavaComponentProvisioningState - :ivar configurations: List of Java Components configuration properties. - :vartype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :ivar scale: Java component scaling configurations. - :vartype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :ivar service_binds: List of Java Components that are bound to the Java component. - :vartype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - :ivar ingress: Java Component Ingress configurations. - :vartype ingress: ~azure.mgmt.appcontainers.models.JavaComponentIngress - :ivar spring_cloud_gateway_routes: Gateway route definition. - :vartype spring_cloud_gateway_routes: list[~azure.mgmt.appcontainers.models.ScgRoute] + :ivar value: Collection of resources. Required. + :vartype value: list[~azure.mgmt.appcontainers.models.SourceControl] + :ivar next_link: Link to next page of resources. + :vartype next_link: str """ _validation = { - "component_type": {"required": True}, - "provisioning_state": {"readonly": True}, + "value": {"required": True}, + "next_link": {"readonly": True}, } _attribute_map = { - "component_type": {"key": "componentType", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "configurations": {"key": "configurations", "type": "[JavaComponentConfigurationProperty]"}, - "scale": {"key": "scale", "type": "JavaComponentPropertiesScale"}, - "service_binds": {"key": "serviceBinds", "type": "[JavaComponentServiceBind]"}, - "ingress": {"key": "ingress", "type": "JavaComponentIngress"}, - "spring_cloud_gateway_routes": {"key": "springCloudGatewayRoutes", "type": "[ScgRoute]"}, + "value": {"key": "value", "type": "[SourceControl]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - configurations: Optional[List["_models.JavaComponentConfigurationProperty"]] = None, - scale: Optional["_models.JavaComponentPropertiesScale"] = None, - service_binds: Optional[List["_models.JavaComponentServiceBind"]] = None, - ingress: Optional["_models.JavaComponentIngress"] = None, - spring_cloud_gateway_routes: Optional[List["_models.ScgRoute"]] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, value: List["_models.SourceControl"], **kwargs: Any) -> None: """ - :keyword configurations: List of Java Components configuration properties. - :paramtype configurations: - list[~azure.mgmt.appcontainers.models.JavaComponentConfigurationProperty] - :keyword scale: Java component scaling configurations. - :paramtype scale: ~azure.mgmt.appcontainers.models.JavaComponentPropertiesScale - :keyword service_binds: List of Java Components that are bound to the Java component. - :paramtype service_binds: list[~azure.mgmt.appcontainers.models.JavaComponentServiceBind] - :keyword ingress: Java Component Ingress configurations. - :paramtype ingress: ~azure.mgmt.appcontainers.models.JavaComponentIngress - :keyword spring_cloud_gateway_routes: Gateway route definition. - :paramtype spring_cloud_gateway_routes: list[~azure.mgmt.appcontainers.models.ScgRoute] - """ - super().__init__(configurations=configurations, scale=scale, service_binds=service_binds, **kwargs) - self.component_type: str = "SpringCloudGateway" - self.ingress = ingress - self.spring_cloud_gateway_routes = spring_cloud_gateway_routes + :keyword value: Collection of resources. Required. + :paramtype value: list[~azure.mgmt.appcontainers.models.SourceControl] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None class SystemData(_serialization.Model): @@ -12632,46 +8002,6 @@ def __init__( self.last_modified_at = last_modified_at -class TcpConnectionPool(_serialization.Model): - """Defines parameters for tcp connection pooling. - - :ivar max_connections: Maximum number of tcp connections allowed. - :vartype max_connections: int - """ - - _attribute_map = { - "max_connections": {"key": "maxConnections", "type": "int"}, - } - - def __init__(self, *, max_connections: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword max_connections: Maximum number of tcp connections allowed. - :paramtype max_connections: int - """ - super().__init__(**kwargs) - self.max_connections = max_connections - - -class TcpRetryPolicy(_serialization.Model): - """Policy that defines tcp request retry conditions. - - :ivar max_connect_attempts: Maximum number of attempts to connect to the tcp service. - :vartype max_connect_attempts: int - """ - - _attribute_map = { - "max_connect_attempts": {"key": "maxConnectAttempts", "type": "int"}, - } - - def __init__(self, *, max_connect_attempts: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword max_connect_attempts: Maximum number of attempts to connect to the tcp service. - :paramtype max_connect_attempts: int - """ - super().__init__(**kwargs) - self.max_connect_attempts = max_connect_attempts - - class TcpScaleRule(_serialization.Model): """Container App container Tcp scaling rule. @@ -12790,40 +8120,6 @@ def __init__( self.service_binds = service_binds -class TimeoutPolicy(_serialization.Model): - """Policy to set request timeouts. - - :ivar response_timeout_in_seconds: Timeout, in seconds, for a request to respond. - :vartype response_timeout_in_seconds: int - :ivar connection_timeout_in_seconds: Timeout, in seconds, for a request to initiate a - connection. - :vartype connection_timeout_in_seconds: int - """ - - _attribute_map = { - "response_timeout_in_seconds": {"key": "responseTimeoutInSeconds", "type": "int"}, - "connection_timeout_in_seconds": {"key": "connectionTimeoutInSeconds", "type": "int"}, - } - - def __init__( - self, - *, - response_timeout_in_seconds: Optional[int] = None, - connection_timeout_in_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword response_timeout_in_seconds: Timeout, in seconds, for a request to respond. - :paramtype response_timeout_in_seconds: int - :keyword connection_timeout_in_seconds: Timeout, in seconds, for a request to initiate a - connection. - :paramtype connection_timeout_in_seconds: int - """ - super().__init__(**kwargs) - self.response_timeout_in_seconds = response_timeout_in_seconds - self.connection_timeout_in_seconds = connection_timeout_in_seconds - - class TokenStore(_serialization.Model): """The configuration settings of the token store. @@ -12873,34 +8169,6 @@ def __init__( self.azure_blob_storage = azure_blob_storage -class TracesConfiguration(_serialization.Model): - """Configuration of Open Telemetry traces. - - :ivar include_dapr: Boolean indicating if including dapr traces. - :vartype include_dapr: bool - :ivar destinations: Open telemetry traces destinations. - :vartype destinations: list[str] - """ - - _attribute_map = { - "include_dapr": {"key": "includeDapr", "type": "bool"}, - "destinations": {"key": "destinations", "type": "[str]"}, - } - - def __init__( - self, *, include_dapr: Optional[bool] = None, destinations: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword include_dapr: Boolean indicating if including dapr traces. - :paramtype include_dapr: bool - :keyword destinations: Open telemetry traces destinations. - :paramtype destinations: list[str] - """ - super().__init__(**kwargs) - self.include_dapr = include_dapr - self.destinations = destinations - - class TrafficWeight(_serialization.Model): """Traffic weight assigned to a revision. @@ -13194,15 +8462,15 @@ class Volume(_serialization.Model): :ivar name: Volume name. :vartype name: str :ivar storage_type: Storage type for the volume. If not provided, use EmptyDir. Known values - are: "AzureFile", "EmptyDir", "Secret", "NfsAzureFile", and "Smb". + are: "AzureFile", "EmptyDir", and "Secret". :vartype storage_type: str or ~azure.mgmt.appcontainers.models.StorageType :ivar storage_name: Name of storage resource. No need to provide for EmptyDir and Secret. :vartype storage_name: str :ivar secrets: List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to volume. :vartype secrets: list[~azure.mgmt.appcontainers.models.SecretVolumeItem] - :ivar mount_options: Mount options used while mounting the Azure file share or NFS Azure file - share. Must be a comma-separated string. + :ivar mount_options: Mount options used while mounting the AzureFile. Must be a comma-separated + string. :vartype mount_options: str """ @@ -13228,15 +8496,15 @@ def __init__( :keyword name: Volume name. :paramtype name: str :keyword storage_type: Storage type for the volume. If not provided, use EmptyDir. Known values - are: "AzureFile", "EmptyDir", "Secret", "NfsAzureFile", and "Smb". + are: "AzureFile", "EmptyDir", and "Secret". :paramtype storage_type: str or ~azure.mgmt.appcontainers.models.StorageType :keyword storage_name: Name of storage resource. No need to provide for EmptyDir and Secret. :paramtype storage_name: str :keyword secrets: List of secrets to be added in volume. If no secrets are provided, all secrets in collection will be added to volume. :paramtype secrets: list[~azure.mgmt.appcontainers.models.SecretVolumeItem] - :keyword mount_options: Mount options used while mounting the Azure file share or NFS Azure - file share. Must be a comma-separated string. + :keyword mount_options: Mount options used while mounting the AzureFile. Must be a + comma-separated string. :paramtype mount_options: str """ super().__init__(**kwargs) @@ -13290,218 +8558,6 @@ def __init__( self.sub_path = sub_path -class WorkflowArtifacts(_serialization.Model): - """The workflow filter. - - :ivar app_settings: Application settings of the workflow. - :vartype app_settings: JSON - :ivar files: Files of the app. - :vartype files: JSON - :ivar files_to_delete: Files of the app to delete. - :vartype files_to_delete: list[str] - """ - - _attribute_map = { - "app_settings": {"key": "appSettings", "type": "object"}, - "files": {"key": "files", "type": "object"}, - "files_to_delete": {"key": "filesToDelete", "type": "[str]"}, - } - - def __init__( - self, - *, - app_settings: Optional[JSON] = None, - files: Optional[JSON] = None, - files_to_delete: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword app_settings: Application settings of the workflow. - :paramtype app_settings: JSON - :keyword files: Files of the app. - :paramtype files: JSON - :keyword files_to_delete: Files of the app to delete. - :paramtype files_to_delete: list[str] - """ - super().__init__(**kwargs) - self.app_settings = app_settings - self.files = files - self.files_to_delete = files_to_delete - - -class WorkflowEnvelope(_serialization.Model): - """Workflow properties definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The resource id. - :vartype id: str - :ivar name: Gets the resource name. - :vartype name: str - :ivar type: Gets the resource type. - :vartype type: str - :ivar kind: The resource kind. - :vartype kind: str - :ivar location: The resource location. - :vartype location: str - :ivar properties: Additional workflow properties. - :vartype properties: ~azure.mgmt.appcontainers.models.WorkflowEnvelopeProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "WorkflowEnvelopeProperties"}, - } - - def __init__( - self, - *, - kind: Optional[str] = None, - location: Optional[str] = None, - properties: Optional["_models.WorkflowEnvelopeProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword kind: The resource kind. - :paramtype kind: str - :keyword location: The resource location. - :paramtype location: str - :keyword properties: Additional workflow properties. - :paramtype properties: ~azure.mgmt.appcontainers.models.WorkflowEnvelopeProperties - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = kind - self.location = location - self.properties = properties - - -class WorkflowEnvelopeCollection(_serialization.Model): - """Collection of workflow information elements. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.appcontainers.models.WorkflowEnvelope] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[WorkflowEnvelope]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: List["_models.WorkflowEnvelope"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.appcontainers.models.WorkflowEnvelope] - """ - super().__init__(**kwargs) - self.value = value - self.next_link = None - - -class WorkflowEnvelopeProperties(_serialization.Model): - """Additional workflow properties. - - :ivar files: Gets or sets the files. - :vartype files: JSON - :ivar flow_state: Gets or sets the state of the workflow. Known values are: "NotSpecified", - "Completed", "Enabled", "Disabled", "Deleted", and "Suspended". - :vartype flow_state: str or ~azure.mgmt.appcontainers.models.WorkflowState - :ivar health: Gets or sets workflow health. - :vartype health: ~azure.mgmt.appcontainers.models.WorkflowHealth - """ - - _attribute_map = { - "files": {"key": "files", "type": "object"}, - "flow_state": {"key": "flowState", "type": "str"}, - "health": {"key": "health", "type": "WorkflowHealth"}, - } - - def __init__( - self, - *, - files: Optional[JSON] = None, - flow_state: Optional[Union[str, "_models.WorkflowState"]] = None, - health: Optional["_models.WorkflowHealth"] = None, - **kwargs: Any - ) -> None: - """ - :keyword files: Gets or sets the files. - :paramtype files: JSON - :keyword flow_state: Gets or sets the state of the workflow. Known values are: "NotSpecified", - "Completed", "Enabled", "Disabled", "Deleted", and "Suspended". - :paramtype flow_state: str or ~azure.mgmt.appcontainers.models.WorkflowState - :keyword health: Gets or sets workflow health. - :paramtype health: ~azure.mgmt.appcontainers.models.WorkflowHealth - """ - super().__init__(**kwargs) - self.files = files - self.flow_state = flow_state - self.health = health - - -class WorkflowHealth(_serialization.Model): - """Represents the workflow health. - - All required parameters must be populated in order to send to server. - - :ivar state: Gets or sets the workflow health state. Required. Known values are: - "NotSpecified", "Healthy", "Unhealthy", and "Unknown". - :vartype state: str or ~azure.mgmt.appcontainers.models.WorkflowHealthState - :ivar error: Gets or sets the workflow error. - :vartype error: ~azure.mgmt.appcontainers.models.ErrorEntity - """ - - _validation = { - "state": {"required": True}, - } - - _attribute_map = { - "state": {"key": "state", "type": "str"}, - "error": {"key": "error", "type": "ErrorEntity"}, - } - - def __init__( - self, - *, - state: Union[str, "_models.WorkflowHealthState"], - error: Optional["_models.ErrorEntity"] = None, - **kwargs: Any - ) -> None: - """ - :keyword state: Gets or sets the workflow health state. Required. Known values are: - "NotSpecified", "Healthy", "Unhealthy", and "Unknown". - :paramtype state: str or ~azure.mgmt.appcontainers.models.WorkflowHealthState - :keyword error: Gets or sets the workflow error. - :paramtype error: ~azure.mgmt.appcontainers.models.ErrorEntity - """ - super().__init__(**kwargs) - self.state = state - self.error = error - - class WorkloadProfile(_serialization.Model): """Workload profile to scope container app execution. @@ -13509,9 +8565,6 @@ class WorkloadProfile(_serialization.Model): :ivar name: Workload profile type for the workloads to run on. Required. :vartype name: str - :ivar enable_fips: Whether to use a FIPS-enabled OS. Supported only for dedicated workload - profiles. - :vartype enable_fips: bool :ivar workload_profile_type: Workload profile type for the workloads to run on. Required. :vartype workload_profile_type: str :ivar minimum_count: The minimum capacity. @@ -13527,7 +8580,6 @@ class WorkloadProfile(_serialization.Model): _attribute_map = { "name": {"key": "name", "type": "str"}, - "enable_fips": {"key": "enableFips", "type": "bool"}, "workload_profile_type": {"key": "workloadProfileType", "type": "str"}, "minimum_count": {"key": "minimumCount", "type": "int"}, "maximum_count": {"key": "maximumCount", "type": "int"}, @@ -13538,7 +8590,6 @@ def __init__( *, name: str, workload_profile_type: str, - enable_fips: bool = False, minimum_count: Optional[int] = None, maximum_count: Optional[int] = None, **kwargs: Any @@ -13546,9 +8597,6 @@ def __init__( """ :keyword name: Workload profile type for the workloads to run on. Required. :paramtype name: str - :keyword enable_fips: Whether to use a FIPS-enabled OS. Supported only for dedicated workload - profiles. - :paramtype enable_fips: bool :keyword workload_profile_type: Workload profile type for the workloads to run on. Required. :paramtype workload_profile_type: str :keyword minimum_count: The minimum capacity. @@ -13558,7 +8606,6 @@ def __init__( """ super().__init__(**kwargs) self.name = name - self.enable_fips = enable_fips self.workload_profile_type = workload_profile_type self.minimum_count = minimum_count self.maximum_count = maximum_count @@ -13569,8 +8616,8 @@ class WorkloadProfileStates(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py index f105aaf0a686..c032b65d93a9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/__init__.py @@ -5,101 +5,71 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._app_resiliency_operations import AppResiliencyOperations -from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations -from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations -from ._billing_meters_operations import BillingMetersOperations -from ._builders_operations import BuildersOperations -from ._builds_by_builder_resource_operations import BuildsByBuilderResourceOperations -from ._builds_operations import BuildsOperations -from ._build_auth_token_operations import BuildAuthTokenOperations -from ._connected_environments_operations import ConnectedEnvironmentsOperations -from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations -from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations -from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations -from ._container_apps_operations import ContainerAppsOperations -from ._container_apps_builds_by_container_app_operations import ContainerAppsBuildsByContainerAppOperations -from ._container_apps_builds_operations import ContainerAppsBuildsOperations -from ._container_apps_patches_operations import ContainerAppsPatchesOperations -from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations -from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations -from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations -from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations -from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations -from ._jobs_operations import JobsOperations -from ._dot_net_components_operations import DotNetComponentsOperations -from ._functions_extension_operations import FunctionsExtensionOperations -from ._operations import Operations -from ._java_components_operations import JavaComponentsOperations -from ._jobs_executions_operations import JobsExecutionsOperations -from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin -from ._logic_apps_operations import LogicAppsOperations -from ._managed_environments_operations import ManagedEnvironmentsOperations -from ._certificates_operations import CertificatesOperations -from ._managed_certificates_operations import ManagedCertificatesOperations -from ._namespaces_operations import NamespacesOperations -from ._managed_environment_private_endpoint_connections_operations import ( - ManagedEnvironmentPrivateEndpointConnectionsOperations, -) -from ._managed_environment_private_link_resources_operations import ManagedEnvironmentPrivateLinkResourcesOperations -from ._dapr_component_resiliency_policies_operations import DaprComponentResiliencyPoliciesOperations -from ._dapr_components_operations import DaprComponentsOperations -from ._dapr_subscriptions_operations import DaprSubscriptionsOperations -from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations -from ._container_apps_session_pools_operations import ContainerAppsSessionPoolsOperations -from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations -from ._usages_operations import UsagesOperations -from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._container_apps_auth_configs_operations import ContainerAppsAuthConfigsOperations # type: ignore +from ._available_workload_profiles_operations import AvailableWorkloadProfilesOperations # type: ignore +from ._billing_meters_operations import BillingMetersOperations # type: ignore +from ._connected_environments_operations import ConnectedEnvironmentsOperations # type: ignore +from ._connected_environments_certificates_operations import ConnectedEnvironmentsCertificatesOperations # type: ignore +from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations # type: ignore +from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations # type: ignore +from ._container_apps_operations import ContainerAppsOperations # type: ignore +from ._container_apps_revisions_operations import ContainerAppsRevisionsOperations # type: ignore +from ._container_apps_revision_replicas_operations import ContainerAppsRevisionReplicasOperations # type: ignore +from ._container_apps_diagnostics_operations import ContainerAppsDiagnosticsOperations # type: ignore +from ._managed_environment_diagnostics_operations import ManagedEnvironmentDiagnosticsOperations # type: ignore +from ._managed_environments_diagnostics_operations import ManagedEnvironmentsDiagnosticsOperations # type: ignore +from ._jobs_operations import JobsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._jobs_executions_operations import JobsExecutionsOperations # type: ignore +from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin # type: ignore +from ._managed_environments_operations import ManagedEnvironmentsOperations # type: ignore +from ._certificates_operations import CertificatesOperations # type: ignore +from ._managed_certificates_operations import ManagedCertificatesOperations # type: ignore +from ._namespaces_operations import NamespacesOperations # type: ignore +from ._dapr_components_operations import DaprComponentsOperations # type: ignore +from ._managed_environments_storages_operations import ManagedEnvironmentsStoragesOperations # type: ignore +from ._container_apps_source_controls_operations import ContainerAppsSourceControlsOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._managed_environment_usages_operations import ManagedEnvironmentUsagesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "AppResiliencyOperations", "ContainerAppsAuthConfigsOperations", "AvailableWorkloadProfilesOperations", "BillingMetersOperations", - "BuildersOperations", - "BuildsByBuilderResourceOperations", - "BuildsOperations", - "BuildAuthTokenOperations", "ConnectedEnvironmentsOperations", "ConnectedEnvironmentsCertificatesOperations", "ConnectedEnvironmentsDaprComponentsOperations", "ConnectedEnvironmentsStoragesOperations", "ContainerAppsOperations", - "ContainerAppsBuildsByContainerAppOperations", - "ContainerAppsBuildsOperations", - "ContainerAppsPatchesOperations", "ContainerAppsRevisionsOperations", "ContainerAppsRevisionReplicasOperations", "ContainerAppsDiagnosticsOperations", "ManagedEnvironmentDiagnosticsOperations", "ManagedEnvironmentsDiagnosticsOperations", "JobsOperations", - "DotNetComponentsOperations", - "FunctionsExtensionOperations", "Operations", - "JavaComponentsOperations", "JobsExecutionsOperations", "ContainerAppsAPIClientOperationsMixin", - "LogicAppsOperations", "ManagedEnvironmentsOperations", "CertificatesOperations", "ManagedCertificatesOperations", "NamespacesOperations", - "ManagedEnvironmentPrivateEndpointConnectionsOperations", - "ManagedEnvironmentPrivateLinkResourcesOperations", - "DaprComponentResiliencyPoliciesOperations", "DaprComponentsOperations", - "DaprSubscriptionsOperations", "ManagedEnvironmentsStoragesOperations", - "ContainerAppsSessionPoolsOperations", "ContainerAppsSourceControlsOperations", "UsagesOperations", "ManagedEnvironmentUsagesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_app_resiliency_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_app_resiliency_operations.py deleted file mode 100644 index 007ffc990766..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_app_resiliency_operations.py +++ /dev/null @@ -1,731 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, app_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, app_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, app_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, app_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request(resource_group_name: str, app_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "appName": _SERIALIZER.url("app_name", app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class AppResiliencyOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`app_resiliency` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: _models.AppResiliency, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Required. - :type resiliency_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: Union[_models.AppResiliency, IO[bytes]], - **kwargs: Any - ) -> _models.AppResiliency: - """Create or update an application's resiliency policy. - - Create or update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to create or update. Is either a - AppResiliency type or a IO[bytes] type. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency or IO[bytes] - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resiliency_envelope, (IOBase, bytes)): - _content = resiliency_envelope - else: - _json = self._serialize.body(resiliency_envelope, "AppResiliency") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: _models.AppResiliency, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Required. - :type resiliency_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - app_name: str, - name: str, - resiliency_envelope: Union[_models.AppResiliency, IO[bytes]], - **kwargs: Any - ) -> _models.AppResiliency: - """Update an application's resiliency policy. - - Update container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :param resiliency_envelope: The resiliency policy to update. Is either a AppResiliency type or - a IO[bytes] type. Required. - :type resiliency_envelope: ~azure.mgmt.appcontainers.models.AppResiliency or IO[bytes] - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resiliency_envelope, (IOBase, bytes)): - _content = resiliency_envelope - else: - _json = self._serialize.body(resiliency_envelope, "AppResiliency") - - _request = build_update_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, app_name: str, name: str, **kwargs: Any - ) -> None: - """Delete an application's resiliency policy. - - Delete container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, app_name: str, name: str, **kwargs: Any) -> _models.AppResiliency: - """Get an application's resiliency policy. - - Get container app resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :param name: Name of the resiliency policy. Required. - :type name: str - :return: AppResiliency or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.AppResiliency - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AppResiliency] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - app_name=app_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AppResiliency", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, app_name: str, **kwargs: Any) -> Iterable["_models.AppResiliency"]: - """List an application's resiliency policies. - - List container app resiliency policies. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param app_name: Name of the Container App. Required. - :type app_name: str - :return: An iterator like instance of either AppResiliency or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.AppResiliency] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AppResiliencyCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - app_name=app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AppResiliencyCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py index 2e759340e8f8..e49a9bb9b71f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_available_workload_profiles_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +51,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/availableManagedEnvironmentsWorkloadProfileTypes", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str", min_length=1), } @@ -105,7 +104,7 @@ def get(self, location: str, **kwargs: Any) -> Iterable["_models.AvailableWorklo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AvailableWorkloadProfilesCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py index 8f64d6ac5a55..5786bbcfb971 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_billing_meters_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -49,7 +48,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/locations/{location}/billingMeters" ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "location": _SERIALIZER.url("location", location, "str", min_length=1), } @@ -95,7 +94,7 @@ def get(self, location: str, **kwargs: Any) -> _models.BillingMeterCollection: :rtype: ~azure.mgmt.appcontainers.models.BillingMeterCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_build_auth_token_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_build_auth_token_operations.py deleted file mode 100644 index ba1910fd2d62..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_build_auth_token_operations.py +++ /dev/null @@ -1,154 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, builder_name: str, build_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}/listAuthToken", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class BuildAuthTokenOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`build_auth_token` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any) -> _models.BuildToken: - """Gets the token used to connect to the endpoint where source code can be uploaded for a build. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: BuildToken or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuildToken - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildToken] = kwargs.pop("cls", None) - - _request = build_list_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("BuildToken", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builders_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builders_operations.py deleted file mode 100644 index 186330f36bbd..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builders_operations.py +++ /dev/null @@ -1,980 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/builders") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, builder_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, builder_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, builder_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, builder_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class BuildersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`builders` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.BuilderResource"]: - """List BuilderResource resources by subscription ID. - - :return: An iterator like instance of either BuilderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BuilderCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.BuilderResource"]: - """List BuilderResource resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either BuilderResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BuilderCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> _models.BuilderResource: - """Get a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: BuilderResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuilderResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuilderResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("BuilderResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(builder_envelope, (IOBase, bytes)): - _content = builder_envelope - else: - _json = self._serialize.body(builder_envelope, "BuilderResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: _models.BuilderResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Required. - :type builder_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Create or update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: Resource create parameters. Is either a BuilderResource type or a - IO[bytes] type. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResource or IO[bytes] - :return: An instance of LROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = 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, - builder_name=builder_name, - builder_envelope=builder_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuilderResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BuilderResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BuilderResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(builder_envelope, (IOBase, bytes)): - _content = builder_envelope - else: - _json = self._serialize.body(builder_envelope, "BuilderResourceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: _models.BuilderResourceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResourceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Required. - :type builder_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - builder_name: str, - builder_envelope: Union[_models.BuilderResourceUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BuilderResource]: - """Update a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param builder_envelope: The resource properties to be updated. Is either a - BuilderResourceUpdate type or a IO[bytes] type. Required. - :type builder_envelope: ~azure.mgmt.appcontainers.models.BuilderResourceUpdate or IO[bytes] - :return: An instance of LROPoller that returns either BuilderResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuilderResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuilderResource] = 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._update_initial( - resource_group_name=resource_group_name, - builder_name=builder_name, - builder_envelope=builder_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuilderResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - 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[_models.BuilderResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BuilderResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - builder_name=builder_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_by_builder_resource_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_by_builder_resource_operations.py deleted file mode 100644 index 8aa6f68d3d89..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_by_builder_resource_operations.py +++ /dev/null @@ -1,174 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(resource_group_name: str, builder_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class BuildsByBuilderResourceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`builds_by_builder_resource` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, builder_name: str, **kwargs: Any) -> Iterable["_models.BuildResource"]: - """List BuildResource resources by BuilderResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :return: An iterator like instance of either BuildResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BuildCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_operations.py deleted file mode 100644 index bcc1f199cf5e..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_builds_operations.py +++ /dev/null @@ -1,567 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, builder_name: str, build_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, builder_name: str, build_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, builder_name: str, build_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/builders/{builderName}/builds/{buildName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "builderName": _SERIALIZER.url( - "builder_name", builder_name, "str", max_length=32, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class BuildsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`builds` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any) -> _models.BuildResource: - """Get a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: BuildResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.BuildResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BuildResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("BuildResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: Union[_models.BuildResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(build_envelope, (IOBase, bytes)): - _content = build_envelope - else: - _json = self._serialize.body(build_envelope, "BuildResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: _models.BuildResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Required. - :type build_envelope: ~azure.mgmt.appcontainers.models.BuildResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Required. - :type build_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - builder_name: str, - build_name: str, - build_envelope: Union[_models.BuildResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BuildResource]: - """Create a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :param build_envelope: Resource create or update parameters. Is either a BuildResource type or - a IO[bytes] type. Required. - :type build_envelope: ~azure.mgmt.appcontainers.models.BuildResource or IO[bytes] - :return: An instance of LROPoller that returns either BuildResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.BuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BuildResource] = 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, - builder_name=builder_name, - build_name=build_name, - build_envelope=build_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BuildResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.BuildResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BuildResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, builder_name: str, build_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a BuildResource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param builder_name: The name of the builder. Required. - :type builder_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - builder_name=builder_name, - build_name=build_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py index 36e8d265de50..965443b7ec4b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +54,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -79,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +87,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -113,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -123,7 +122,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -150,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,7 +158,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -184,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -194,7 +193,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -255,7 +254,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -337,7 +336,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -472,7 +471,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -550,7 +549,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -681,7 +680,7 @@ def update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py index 83e1e99e488e..0dbebff78519 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +54,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -83,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +91,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +120,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -131,7 +130,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -162,7 +161,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +170,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -200,7 +199,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -210,7 +209,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/certificates/{certificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -273,7 +272,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.CertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -355,7 +354,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +489,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -568,7 +567,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -699,7 +698,7 @@ def update( :rtype: ~azure.mgmt.appcontainers.models.Certificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py index 0b8bfb9753a0..b860c6319e75 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_dapr_components_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +54,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -79,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +87,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -113,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -123,7 +122,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -150,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,7 +158,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -184,7 +183,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +192,7 @@ def build_list_secrets_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/daprComponents/{componentName}/listSecrets", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -254,7 +253,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DaprComponentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -336,7 +335,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -471,7 +470,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -546,7 +545,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -605,7 +604,7 @@ def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.DaprSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py index ef3ba4e0eb42..34b98e9d8093 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,13 +48,13 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/connectedEnvironments") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -72,7 +72,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -104,7 +104,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -137,7 +137,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -147,7 +147,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -173,7 +173,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -206,7 +206,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +215,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -239,7 +239,7 @@ def build_check_name_availability_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -249,7 +249,7 @@ def build_check_name_availability_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/checkNameAvailability", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -305,7 +305,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ConnectedEnvi api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConnectedEnvironmentCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ def list_by_resource_group( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ConnectedEnvironmentCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -463,7 +463,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -513,7 +513,7 @@ def _create_or_update_initial( environment_envelope: Union[_models.ConnectedEnvironment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -704,7 +704,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, connected_environment_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -830,7 +830,7 @@ def update( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -959,7 +959,7 @@ def check_name_availability( :rtype: ~azure.mgmt.appcontainers.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py index ca4ee82e2623..9a01d4832b03 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_connected_environments_storages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +43,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +52,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -77,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +85,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -111,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,7 +120,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -148,7 +147,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,7 +156,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/connectedEnvironments/{connectedEnvironmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -212,7 +211,7 @@ def list( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStoragesCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +273,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -410,7 +409,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.ConnectedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -485,7 +484,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py index 42a17070e70f..b227a81c2bcf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_api_client_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +43,7 @@ def build_job_execution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +52,7 @@ def build_job_execution_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -80,7 +79,7 @@ def build_get_custom_domain_verification_id_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +87,7 @@ def build_get_custom_domain_verification_id_request( # pylint: disable=name-too "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/getCustomDomainVerificationId" ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -123,7 +122,7 @@ def job_execution( :rtype: ~azure.mgmt.appcontainers.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -175,7 +174,7 @@ def get_custom_domain_verification_id(self, **kwargs: Any) -> str: :rtype: str :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py index aad3e7f178e2..e8fd9c8b7fe2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_auth_configs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +45,7 @@ def build_list_by_container_app_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +54,7 @@ def build_list_by_container_app_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -79,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +87,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -113,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -123,7 +122,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -150,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,7 +158,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/authConfigs/{authConfigName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -220,7 +219,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AuthConfigCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -302,7 +301,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.AuthConfig :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -437,7 +436,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.AuthConfig :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +511,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_by_container_app_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_by_container_app_operations.py deleted file mode 100644 index c0c6bec4f1e7..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_by_container_app_operations.py +++ /dev/null @@ -1,180 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, container_app_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ContainerAppsBuildsByContainerAppOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`container_apps_builds_by_container_app` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, container_app_name: str, **kwargs: Any - ) -> Iterable["_models.ContainerAppsBuildResource"]: - """List Container Apps Build resources by Container App. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Build is associated. Required. - :type container_app_name: str - :return: An iterator like instance of either ContainerAppsBuildResource or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.ContainerAppsBuildResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ContainerAppsBuildCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ContainerAppsBuildCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_operations.py deleted file mode 100644 index baa987a7159c..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_builds_operations.py +++ /dev/null @@ -1,314 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterator, Optional, Type, TypeVar, Union, cast - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, container_app_name: str, build_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, container_app_name: str, build_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "buildName": _SERIALIZER.url( - "build_name", build_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ContainerAppsBuildsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`container_apps_builds` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, container_app_name: str, build_name: str, **kwargs: Any - ) -> _models.ContainerAppsBuildResource: - """Get a Container Apps Build resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Build is associated. Required. - :type container_app_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: ContainerAppsBuildResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ContainerAppsBuildResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ContainerAppsBuildResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("ContainerAppsBuildResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, container_app_name: str, build_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - build_name=build_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, container_app_name: str, build_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Container Apps Build resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Build is associated. Required. - :type container_app_name: str - :param build_name: The name of a build. Required. - :type build_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - build_name=build_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py index 3f459b466f63..ba2a984b4e83 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar, cast +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +44,7 @@ def build_list_detectors_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +53,7 @@ def build_list_detectors_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -78,7 +77,7 @@ def build_get_detector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +86,7 @@ def build_get_detector_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectors/{detectorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -117,7 +116,7 @@ def build_list_revisions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +125,7 @@ def build_list_revisions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -152,7 +151,7 @@ def build_get_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +160,7 @@ def build_get_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/revisionsApi/revisions/{revisionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -186,7 +185,7 @@ def build_get_root_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,7 +194,7 @@ def build_get_root_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/detectorProperties/rootApi/", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -256,7 +255,7 @@ def list_detectors( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DiagnosticsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -338,7 +337,7 @@ def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -407,7 +406,7 @@ def list_revisions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RevisionCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -490,7 +489,7 @@ def get_revision( :rtype: ~azure.mgmt.appcontainers.models.Revision :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -549,14 +548,11 @@ def get_root(self, resource_group_name: str, container_app_name: str, **kwargs: :rtype: ~azure.mgmt.appcontainers.models.ContainerApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -584,7 +580,7 @@ def get_root(self, resource_group_name: str, container_app_name: str, **kwargs: response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py index 67267d32f72c..a12b500de835 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,13 +48,13 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -72,7 +72,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -104,7 +104,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -137,7 +137,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -147,7 +147,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -173,7 +173,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -206,7 +206,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -216,7 +216,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -247,7 +247,7 @@ def build_list_custom_host_name_analysis_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -256,7 +256,7 @@ def build_list_custom_host_name_analysis_request( # pylint: disable=name-too-lo "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -282,7 +282,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -291,7 +291,7 @@ def build_list_secrets_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listSecrets", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -315,7 +315,7 @@ def build_get_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -324,7 +324,7 @@ def build_get_auth_token_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/getAuthtoken", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -348,7 +348,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -357,7 +357,7 @@ def build_start_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -383,7 +383,7 @@ def build_stop_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -392,7 +392,7 @@ def build_stop_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -447,7 +447,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ContainerApp" api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -527,7 +527,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -604,14 +604,11 @@ def get(self, resource_group_name: str, container_app_name: str, **kwargs: Any) :rtype: ~azure.mgmt.appcontainers.models.ContainerApp :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -639,7 +636,7 @@ def get(self, resource_group_name: str, container_app_name: str, **kwargs: Any) response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -657,7 +654,7 @@ def _create_or_update_initial( container_app_envelope: Union[_models.ContainerApp, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -852,7 +849,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, container_app_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -968,7 +965,7 @@ def _update_initial( container_app_envelope: Union[_models.ContainerApp, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1183,7 +1180,7 @@ def list_custom_host_name_analysis( :rtype: ~azure.mgmt.appcontainers.models.CustomHostnameAnalysisResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1244,7 +1241,7 @@ def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.SecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1304,14 +1301,11 @@ def get_auth_token( :rtype: ~azure.mgmt.appcontainers.models.ContainerAppAuthToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, + 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 404: cast( - Type[HttpResponseError], - lambda response: ResourceNotFoundError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -1339,7 +1333,7 @@ def get_auth_token( response = pipeline_response.http_response if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore + map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -1351,7 +1345,7 @@ def get_auth_token( return deserialized # type: ignore def _start_initial(self, resource_group_name: str, container_app_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1468,7 +1462,7 @@ def get_long_running_output(pipeline_response): ) def _stop_initial(self, resource_group_name: str, container_app_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_patches_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_patches_operations.py deleted file mode 100644 index 5ecf4eda2b9b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_patches_operations.py +++ /dev/null @@ -1,856 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_container_app_request( - resource_group_name: str, - container_app_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, container_app_name: str, patch_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "patchName": _SERIALIZER.url( - "patch_name", patch_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, container_app_name: str, patch_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "patchName": _SERIALIZER.url( - "patch_name", patch_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_skip_configure_request( - resource_group_name: str, container_app_name: str, patch_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/skipConfig", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "patchName": _SERIALIZER.url( - "patch_name", patch_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_apply_request( - resource_group_name: str, container_app_name: str, patch_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/patches/{patchName}/apply", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "patchName": _SERIALIZER.url( - "patch_name", patch_name, "str", max_length=64, min_length=2, pattern=r"^[-\w\._\(\)]+$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ContainerAppsPatchesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`container_apps_patches` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_container_app( - self, resource_group_name: str, container_app_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> Iterable["_models.ContainerAppsPatchResource"]: - """List Container Apps Patch resources by ContainerApp. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param filter: The filter to apply on the operation. For example, - $filter=properties/patchApplyStatus eq 'Succeeded'. Default value is None. - :type filter: str - :return: An iterator like instance of either ContainerAppsPatchResource or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.ContainerAppsPatchResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PatchCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_container_app_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PatchCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> _models.ContainerAppsPatchResource: - """Get details for specific Container Apps Patch by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :return: ContainerAppsPatchResource or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.ContainerAppsPatchResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ContainerAppsPatchResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("ContainerAppsPatchResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete specific Container Apps Patch by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _skip_configure_initial( - self, - resource_group_name: str, - container_app_name: str, - patch_name: str, - patch_skip_config: Union[_models.PatchSkipConfig, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(patch_skip_config, (IOBase, bytes)): - _content = patch_skip_config - else: - _json = self._serialize.body(patch_skip_config, "PatchSkipConfig") - - _request = build_skip_configure_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_skip_configure( - self, - resource_group_name: str, - container_app_name: str, - patch_name: str, - patch_skip_config: _models.PatchSkipConfig, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Configure the Container Apps Patch skip option by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :param patch_skip_config: Configure patcher to skip a patch or not. Required. - :type patch_skip_config: ~azure.mgmt.appcontainers.models.PatchSkipConfig - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_skip_configure( - self, - resource_group_name: str, - container_app_name: str, - patch_name: str, - patch_skip_config: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Configure the Container Apps Patch skip option by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :param patch_skip_config: Configure patcher to skip a patch or not. Required. - :type patch_skip_config: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_skip_configure( - self, - resource_group_name: str, - container_app_name: str, - patch_name: str, - patch_skip_config: Union[_models.PatchSkipConfig, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Configure the Container Apps Patch skip option by patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :param patch_skip_config: Configure patcher to skip a patch or not. Is either a PatchSkipConfig - type or a IO[bytes] type. Required. - :type patch_skip_config: ~azure.mgmt.appcontainers.models.PatchSkipConfig or IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - 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._skip_configure_initial( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - patch_skip_config=patch_skip_config, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _apply_initial( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_apply_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_apply( - self, resource_group_name: str, container_app_name: str, patch_name: str, **kwargs: Any - ) -> LROPoller[_models.ContainerAppsPatchResource]: - """Apply a Container Apps Patch resource with patch name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App the Patch is associated. Required. - :type container_app_name: str - :param patch_name: The name of the patch. Required. - :type patch_name: str - :return: An instance of LROPoller that returns either ContainerAppsPatchResource or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.ContainerAppsPatchResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ContainerAppsPatchResource] = 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._apply_initial( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - patch_name=patch_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ContainerAppsPatchResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ContainerAppsPatchResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ContainerAppsPatchResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py index 5dc5a5a20868..7360e0edb3e9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revision_replicas_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,7 +47,7 @@ def build_get_replica_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -57,7 +56,7 @@ def build_get_replica_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas/{replicaName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -83,7 +82,7 @@ def build_list_replicas_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +91,7 @@ def build_list_replicas_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/replicas", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -151,7 +150,7 @@ def get_replica( :rtype: ~azure.mgmt.appcontainers.models.Replica :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +214,7 @@ def list_replicas( :rtype: ~azure.mgmt.appcontainers.models.ReplicaCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py index 36516fbefb0d..151f06d01c5f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_revisions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,7 @@ def build_list_revisions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +58,7 @@ def build_list_revisions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -85,7 +84,7 @@ def build_get_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +93,7 @@ def build_get_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -119,7 +118,7 @@ def build_activate_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +127,7 @@ def build_activate_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/activate", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -153,7 +152,7 @@ def build_deactivate_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +161,7 @@ def build_deactivate_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/deactivate", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -187,7 +186,7 @@ def build_restart_revision_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -196,7 +195,7 @@ def build_restart_revision_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/restart", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -259,7 +258,7 @@ def list_revisions( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RevisionCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -342,7 +341,7 @@ def get_revision( :rtype: ~azure.mgmt.appcontainers.models.Revision :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -405,7 +404,7 @@ def activate_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -464,7 +463,7 @@ def deactivate_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -523,7 +522,7 @@ def restart_revision( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_session_pools_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_session_pools_operations.py deleted file mode 100644 index 005c216efb9e..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_session_pools_operations.py +++ /dev/null @@ -1,997 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/sessionPools") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, session_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "sessionPoolName": _SERIALIZER.url( - "session_pool_name", session_pool_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, session_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "sessionPoolName": _SERIALIZER.url( - "session_pool_name", session_pool_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, session_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "sessionPoolName": _SERIALIZER.url( - "session_pool_name", session_pool_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, session_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/sessionPools/{sessionPoolName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "sessionPoolName": _SERIALIZER.url( - "session_pool_name", session_pool_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ContainerAppsSessionPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`container_apps_session_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SessionPool"]: - """Get the session pools in a given subscription. - - Get the session pools in a given subscription. - - :return: An iterator like instance of either SessionPool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SessionPoolCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SessionPoolCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.SessionPool"]: - """Get the session pools in a given resource group of a subscription. - - Get the session pools in a given resource group of a subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either SessionPool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SessionPoolCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SessionPoolCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, session_pool_name: str, **kwargs: Any) -> _models.SessionPool: - """Get the properties of a session pool. - - Get the properties of a session pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :return: SessionPool or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.SessionPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SessionPool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("SessionPool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: Union[_models.SessionPool, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(session_pool_envelope, (IOBase, bytes)): - _content = session_pool_envelope - else: - _json = self._serialize.body(session_pool_envelope, "SessionPool") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: _models.SessionPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SessionPool]: - """Create or update a session pool. - - Create or update a session pool with the given properties. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Required. - :type session_pool_envelope: ~azure.mgmt.appcontainers.models.SessionPool - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SessionPool]: - """Create or update a session pool. - - Create or update a session pool with the given properties. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Required. - :type session_pool_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: Union[_models.SessionPool, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SessionPool]: - """Create or update a session pool. - - Create or update a session pool with the given properties. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Is either a SessionPool - type or a IO[bytes] type. Required. - :type session_pool_envelope: ~azure.mgmt.appcontainers.models.SessionPool or IO[bytes] - :return: An instance of LROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SessionPool] = 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, - session_pool_name=session_pool_name, - session_pool_envelope=session_pool_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SessionPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SessionPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SessionPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: Union[_models.SessionPoolUpdatableProperties, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(session_pool_envelope, (IOBase, bytes)): - _content = session_pool_envelope - else: - _json = self._serialize.body(session_pool_envelope, "SessionPoolUpdatableProperties") - - _request = build_update_request( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: _models.SessionPoolUpdatableProperties, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SessionPool]: - """Update properties of a session pool. - - Patches a session pool using JSON merge patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Required. - :type session_pool_envelope: ~azure.mgmt.appcontainers.models.SessionPoolUpdatableProperties - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SessionPool]: - """Update properties of a session pool. - - Patches a session pool using JSON merge patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Required. - :type session_pool_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - session_pool_name: str, - session_pool_envelope: Union[_models.SessionPoolUpdatableProperties, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SessionPool]: - """Update properties of a session pool. - - Patches a session pool using JSON merge patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :param session_pool_envelope: Properties used to create a session pool. Is either a - SessionPoolUpdatableProperties type or a IO[bytes] type. Required. - :type session_pool_envelope: ~azure.mgmt.appcontainers.models.SessionPoolUpdatableProperties or - IO[bytes] - :return: An instance of LROPoller that returns either SessionPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.SessionPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SessionPool] = 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._update_initial( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - session_pool_envelope=session_pool_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SessionPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SessionPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SessionPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, session_pool_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, session_pool_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a session pool. - - Delete the session pool with the given name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param session_pool_name: Name of the session pool. Required. - :type session_pool_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - session_pool_name=session_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py index e546fc010ddf..bc66fd573b44 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_container_apps_source_controls_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,7 @@ def build_list_by_container_app_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +58,7 @@ def build_list_by_container_app_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -83,7 +82,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +91,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -112,18 +111,12 @@ def build_get_request( def build_create_or_update_request( - resource_group_name: str, - container_app_name: str, - source_control_name: str, - subscription_id: str, - *, - x_ms_github_auxiliary: Optional[str] = None, - **kwargs: Any + resource_group_name: str, container_app_name: str, source_control_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -133,7 +126,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -147,8 +140,6 @@ def build_create_or_update_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if x_ms_github_auxiliary is not None: - _headers["x-ms-github-auxiliary"] = _SERIALIZER.header("x_ms_github_auxiliary", x_ms_github_auxiliary, "str") if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") @@ -157,20 +148,12 @@ def build_create_or_update_request( def build_delete_request( - resource_group_name: str, - container_app_name: str, - source_control_name: str, - subscription_id: str, - *, - x_ms_github_auxiliary: Optional[str] = None, - ignore_workflow_deletion_failure: Optional[bool] = None, - delete_workflow: Optional[bool] = None, - **kwargs: Any + resource_group_name: str, container_app_name: str, source_control_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +162,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/sourcecontrols/{sourceControlName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -190,17 +173,9 @@ def build_delete_request( _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if ignore_workflow_deletion_failure is not None: - _params["ignoreWorkflowDeletionFailure"] = _SERIALIZER.query( - "ignore_workflow_deletion_failure", ignore_workflow_deletion_failure, "bool" - ) - if delete_workflow is not None: - _params["deleteWorkflow"] = _SERIALIZER.query("delete_workflow", delete_workflow, "bool") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if x_ms_github_auxiliary is not None: - _headers["x-ms-github-auxiliary"] = _SERIALIZER.header("x_ms_github_auxiliary", x_ms_github_auxiliary, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) @@ -248,7 +223,7 @@ def list_by_container_app( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SourceControlCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -330,7 +305,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.SourceControl :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -380,10 +355,9 @@ def _create_or_update_initial( container_app_name: str, source_control_name: str, source_control_envelope: Union[_models.SourceControl, IO[bytes]], - x_ms_github_auxiliary: Optional[str] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +385,6 @@ def _create_or_update_initial( container_app_name=container_app_name, source_control_name=source_control_name, subscription_id=self._config.subscription_id, - x_ms_github_auxiliary=x_ms_github_auxiliary, api_version=api_version, content_type=content_type, json=_json, @@ -452,7 +425,6 @@ def begin_create_or_update( container_app_name: str, source_control_name: str, source_control_envelope: _models.SourceControl, - x_ms_github_auxiliary: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any @@ -471,9 +443,6 @@ def begin_create_or_update( :param source_control_envelope: Properties used to create a Container App SourceControl. Required. :type source_control_envelope: ~azure.mgmt.appcontainers.models.SourceControl - :param x_ms_github_auxiliary: Github personal access token used for SourceControl. Default - value is None. - :type x_ms_github_auxiliary: str :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -490,7 +459,6 @@ def begin_create_or_update( container_app_name: str, source_control_name: str, source_control_envelope: IO[bytes], - x_ms_github_auxiliary: Optional[str] = None, *, content_type: str = "application/json", **kwargs: Any @@ -509,9 +477,6 @@ def begin_create_or_update( :param source_control_envelope: Properties used to create a Container App SourceControl. Required. :type source_control_envelope: IO[bytes] - :param x_ms_github_auxiliary: Github personal access token used for SourceControl. Default - value is None. - :type x_ms_github_auxiliary: str :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -528,7 +493,6 @@ def begin_create_or_update( container_app_name: str, source_control_name: str, source_control_envelope: Union[_models.SourceControl, IO[bytes]], - x_ms_github_auxiliary: Optional[str] = None, **kwargs: Any ) -> LROPoller[_models.SourceControl]: """Create or update the SourceControl for a Container App. @@ -545,9 +509,6 @@ def begin_create_or_update( :param source_control_envelope: Properties used to create a Container App SourceControl. Is either a SourceControl type or a IO[bytes] type. Required. :type source_control_envelope: ~azure.mgmt.appcontainers.models.SourceControl or IO[bytes] - :param x_ms_github_auxiliary: Github personal access token used for SourceControl. Default - value is None. - :type x_ms_github_auxiliary: str :return: An instance of LROPoller that returns either SourceControl or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.SourceControl] @@ -568,7 +529,6 @@ def begin_create_or_update( container_app_name=container_app_name, source_control_name=source_control_name, source_control_envelope=source_control_envelope, - x_ms_github_auxiliary=x_ms_github_auxiliary, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -603,16 +563,9 @@ def get_long_running_output(pipeline_response): ) def _delete_initial( - self, - resource_group_name: str, - container_app_name: str, - source_control_name: str, - x_ms_github_auxiliary: Optional[str] = None, - ignore_workflow_deletion_failure: Optional[bool] = None, - delete_workflow: Optional[bool] = None, - **kwargs: Any + self, resource_group_name: str, container_app_name: str, source_control_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -631,9 +584,6 @@ def _delete_initial( container_app_name=container_app_name, source_control_name=source_control_name, subscription_id=self._config.subscription_id, - x_ms_github_auxiliary=x_ms_github_auxiliary, - ignore_workflow_deletion_failure=ignore_workflow_deletion_failure, - delete_workflow=delete_workflow, api_version=api_version, headers=_headers, params=_params, @@ -666,14 +616,7 @@ def _delete_initial( @distributed_trace def begin_delete( - self, - resource_group_name: str, - container_app_name: str, - source_control_name: str, - x_ms_github_auxiliary: Optional[str] = None, - ignore_workflow_deletion_failure: Optional[bool] = None, - delete_workflow: Optional[bool] = None, - **kwargs: Any + self, resource_group_name: str, container_app_name: str, source_control_name: str, **kwargs: Any ) -> LROPoller[None]: """Delete a Container App SourceControl. @@ -686,14 +629,6 @@ def begin_delete( :type container_app_name: str :param source_control_name: Name of the Container App SourceControl. Required. :type source_control_name: str - :param x_ms_github_auxiliary: Github personal access token used for SourceControl. Default - value is None. - :type x_ms_github_auxiliary: str - :param ignore_workflow_deletion_failure: Ignore Workflow Deletion Failure. Default value is - None. - :type ignore_workflow_deletion_failure: bool - :param delete_workflow: Delete workflow. Default value is None. - :type delete_workflow: bool :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -711,9 +646,6 @@ def begin_delete( resource_group_name=resource_group_name, container_app_name=container_app_name, source_control_name=source_control_name, - x_ms_github_auxiliary=x_ms_github_auxiliary, - ignore_workflow_deletion_failure=ignore_workflow_deletion_failure, - delete_workflow=delete_workflow, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_component_resiliency_policies_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_component_resiliency_policies_operations.py deleted file mode 100644 index 045f7dd750c2..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_component_resiliency_policies_operations.py +++ /dev/null @@ -1,583 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_name: str, component_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "componentName": _SERIALIZER.url("component_name", component_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, environment_name: str, component_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "componentName": _SERIALIZER.url("component_name", component_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, environment_name: str, component_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "componentName": _SERIALIZER.url("component_name", component_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, environment_name: str, component_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/resiliencyPolicies/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "componentName": _SERIALIZER.url("component_name", component_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DaprComponentResiliencyPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`dapr_component_resiliency_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, component_name: str, **kwargs: Any - ) -> Iterable["_models.DaprComponentResiliencyPolicy"]: - """Get the resiliency policies for a Dapr component. - - Get the resiliency policies for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :return: An iterator like instance of either DaprComponentResiliencyPolicy or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprComponentResiliencyPoliciesCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DaprComponentResiliencyPoliciesCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, environment_name: str, component_name: str, name: str, **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Get a Dapr component resiliency policy. - - Get a Dapr component resiliency policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprComponentResiliencyPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: _models.DaprComponentResiliencyPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Required. - :type dapr_component_resiliency_policy_envelope: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Required. - :type dapr_component_resiliency_policy_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - component_name: str, - name: str, - dapr_component_resiliency_policy_envelope: Union[_models.DaprComponentResiliencyPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DaprComponentResiliencyPolicy: - """Creates or updates a Dapr component resiliency policy. - - Creates or updates a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :param dapr_component_resiliency_policy_envelope: Configuration details of the Dapr Component - Resiliency Policy. Is either a DaprComponentResiliencyPolicy type or a IO[bytes] type. - Required. - :type dapr_component_resiliency_policy_envelope: - ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy or IO[bytes] - :return: DaprComponentResiliencyPolicy or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprComponentResiliencyPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DaprComponentResiliencyPolicy] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_component_resiliency_policy_envelope, (IOBase, bytes)): - _content = dapr_component_resiliency_policy_envelope - else: - _json = self._serialize.body(dapr_component_resiliency_policy_envelope, "DaprComponentResiliencyPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprComponentResiliencyPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, component_name: str, name: str, **kwargs: Any - ) -> None: - """Delete a Dapr component resiliency policy. - - Delete a resiliency policy for a Dapr component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param component_name: Name of the Dapr Component. Required. - :type component_name: str - :param name: Name of the Dapr Component Resiliency Policy. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - component_name=component_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py index 8d9e32077cec..7c6a59d90eb8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_components_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( @@ -32,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -46,7 +45,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -55,7 +54,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -79,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +87,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -113,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -123,7 +122,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -150,7 +149,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -159,7 +158,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -184,7 +183,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -193,7 +192,7 @@ def build_list_secrets_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprComponents/{componentName}/listSecrets", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -252,7 +251,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DaprComponentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +333,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -469,7 +468,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.DaprComponent :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +543,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -603,7 +602,7 @@ def list_secrets( :rtype: ~azure.mgmt.appcontainers.models.DaprSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_subscriptions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_subscriptions_operations.py deleted file mode 100644 index e629225b8b27..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dapr_subscriptions_operations.py +++ /dev/null @@ -1,554 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/daprSubscriptions/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DaprSubscriptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`dapr_subscriptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> Iterable["_models.DaprSubscription"]: - """Get the Dapr subscriptions for a managed environment. - - Get the Dapr subscriptions for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either DaprSubscription or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.DaprSubscription] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprSubscriptionsCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DaprSubscriptionsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> _models.DaprSubscription: - """Get a dapr subscription. - - Get a dapr subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DaprSubscription] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprSubscription", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: _models.DaprSubscription, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Required. - :type dapr_subscription_envelope: ~azure.mgmt.appcontainers.models.DaprSubscription - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Required. - :type dapr_subscription_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dapr_subscription_envelope: Union[_models.DaprSubscription, IO[bytes]], - **kwargs: Any - ) -> _models.DaprSubscription: - """Creates or updates a Dapr subscription. - - Creates or updates a Dapr subscription in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :param dapr_subscription_envelope: Configuration details of the Dapr subscription. Is either a - DaprSubscription type or a IO[bytes] type. Required. - :type dapr_subscription_envelope: ~azure.mgmt.appcontainers.models.DaprSubscription or - IO[bytes] - :return: DaprSubscription or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DaprSubscription - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DaprSubscription] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dapr_subscription_envelope, (IOBase, bytes)): - _content = dapr_subscription_envelope - else: - _json = self._serialize.body(dapr_subscription_envelope, "DaprSubscription") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DaprSubscription", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> None: - """Delete a Dapr subscription. - - Delete a Dapr subscription from a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Dapr subscription. Required. - :type name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dot_net_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dot_net_components_operations.py deleted file mode 100644 index bf63632ced24..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_dot_net_components_operations.py +++ /dev/null @@ -1,932 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/dotNetComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DotNetComponentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`dot_net_components` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> Iterable["_models.DotNetComponent"]: - """Get the .NET Components for a managed environment. - - Get the .NET Components for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either DotNetComponent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DotNetComponentsCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DotNetComponentsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any) -> _models.DotNetComponent: - """Get a .NET Component. - - Get a .NET Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :return: DotNetComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.DotNetComponent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DotNetComponent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("DotNetComponent", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dot_net_component_envelope, (IOBase, bytes)): - _content = dot_net_component_envelope - else: - _json = self._serialize.body(dot_net_component_envelope, "DotNetComponent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: _models.DotNetComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Creates or updates a .NET Component. - - Creates or updates a .NET Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Is either a - DotNetComponent type or a IO[bytes] type. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent or IO[bytes] - :return: An instance of LROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = 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, - environment_name=environment_name, - name=name, - dot_net_component_envelope=dot_net_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DotNetComponent", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DotNetComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DotNetComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(dot_net_component_envelope, (IOBase, bytes)): - _content = dot_net_component_envelope - else: - _json = self._serialize.body(dot_net_component_envelope, "DotNetComponent") - - _request = build_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: _models.DotNetComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Required. - :type dot_net_component_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - dot_net_component_envelope: Union[_models.DotNetComponent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DotNetComponent]: - """Update properties of a .NET Component. - - Patches a .NET Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :param dot_net_component_envelope: Configuration details of the .NET Component. Is either a - DotNetComponent type or a IO[bytes] type. Required. - :type dot_net_component_envelope: ~azure.mgmt.appcontainers.models.DotNetComponent or IO[bytes] - :return: An instance of LROPoller that returns either DotNetComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.DotNetComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DotNetComponent] = 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._update_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - dot_net_component_envelope=dot_net_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DotNetComponent", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.DotNetComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DotNetComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a .NET Component. - - Delete a .NET Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the .NET Component. Required. - :type name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_functions_extension_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_functions_extension_operations.py deleted file mode 100644 index 6f8a36799039..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_functions_extension_operations.py +++ /dev/null @@ -1,170 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_invoke_functions_host_request( - resource_group_name: str, - container_app_name: str, - revision_name: str, - function_app_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/revisions/{revisionName}/providers/Microsoft.App/functions/{functionAppName}/invoke", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "revisionName": _SERIALIZER.url("revision_name", revision_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "functionAppName": _SERIALIZER.url("function_app_name", function_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class FunctionsExtensionOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`functions_extension` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def invoke_functions_host( - self, - resource_group_name: str, - container_app_name: str, - revision_name: str, - function_app_name: str, - **kwargs: Any - ) -> str: - """Proxies a Functions host call to the function app backed by the container app. - - Proxies a Functions host call to the function app backed by the container app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param revision_name: Name of the Container App Revision, the parent resource. Required. - :type revision_name: str - :param function_app_name: Name of the Function App, the extension resource. Required. - :type function_app_name: str - :return: str or the result of cls(response) - :rtype: str - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[str] = kwargs.pop("cls", None) - - _request = build_invoke_functions_host_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - revision_name=revision_name, - function_app_name=function_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("str", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_java_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_java_components_operations.py deleted file mode 100644 index d3f5eb6f249c..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_java_components_operations.py +++ /dev/null @@ -1,930 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, environment_name: str, name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/javaComponents/{name}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "name": _SERIALIZER.url("name", name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class JavaComponentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`java_components` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> Iterable["_models.JavaComponent"]: - """Get the Java Components for a managed environment. - - Get the Java Components for a managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either JavaComponent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JavaComponentsCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JavaComponentsCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any) -> _models.JavaComponent: - """Get a Java Component. - - Get a Java Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :return: JavaComponent or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.JavaComponent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JavaComponent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("JavaComponent", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(java_component_envelope, (IOBase, bytes)): - _content = java_component_envelope - else: - _json = self._serialize.body(java_component_envelope, "JavaComponent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: _models.JavaComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Creates or updates a Java Component. - - Creates or updates a Java Component in a Managed Environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Is either a - JavaComponent type or a IO[bytes] type. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent or IO[bytes] - :return: An instance of LROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = 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, - environment_name=environment_name, - name=name, - java_component_envelope=java_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JavaComponent", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.JavaComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JavaComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(java_component_envelope, (IOBase, bytes)): - _content = java_component_envelope - else: - _json = self._serialize.body(java_component_envelope, "JavaComponent") - - _request = build_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: _models.JavaComponent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Required. - :type java_component_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - environment_name: str, - name: str, - java_component_envelope: Union[_models.JavaComponent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.JavaComponent]: - """Update properties of a Java Component. - - Patches a Java Component using JSON Merge Patch. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :param java_component_envelope: Configuration details of the Java Component. Is either a - JavaComponent type or a IO[bytes] type. Required. - :type java_component_envelope: ~azure.mgmt.appcontainers.models.JavaComponent or IO[bytes] - :return: An instance of LROPoller that returns either JavaComponent or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.JavaComponent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JavaComponent] = 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._update_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - java_component_envelope=java_component_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JavaComponent", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.JavaComponent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JavaComponent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, environment_name: str, name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Java Component. - - Delete a Java Component. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param name: Name of the Java Component. Required. - :type name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - name=name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py index cc7739b4cffd..4136108cfc4c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_executions_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +44,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +53,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -118,7 +117,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ContainerAppJobExecutions] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py index 3d818980ddcc..1c5361b9133e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_jobs_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +50,7 @@ def build_list_detectors_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +59,7 @@ def build_list_detectors_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -83,7 +83,7 @@ def build_get_detector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +92,7 @@ def build_get_detector_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectors/{detectorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -117,7 +117,7 @@ def build_proxy_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +126,7 @@ def build_proxy_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/detectorProperties/{apiName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -149,13 +149,13 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/jobs") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -173,7 +173,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -203,7 +203,7 @@ def build_get_request(resource_group_name: str, job_name: str, subscription_id: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -212,7 +212,7 @@ def build_get_request(resource_group_name: str, job_name: str, subscription_id: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -236,7 +236,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -246,7 +246,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -270,7 +270,7 @@ def build_delete_request(resource_group_name: str, job_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -279,7 +279,7 @@ def build_delete_request(resource_group_name: str, job_name: str, subscription_i "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -301,7 +301,7 @@ def build_update_request(resource_group_name: str, job_name: str, subscription_i _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -311,7 +311,7 @@ def build_update_request(resource_group_name: str, job_name: str, subscription_i "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -335,7 +335,7 @@ def build_start_request(resource_group_name: str, job_name: str, subscription_id _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -345,7 +345,7 @@ def build_start_request(resource_group_name: str, job_name: str, subscription_id "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/start", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -371,7 +371,7 @@ def build_stop_execution_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -380,7 +380,7 @@ def build_stop_execution_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/executions/{jobExecutionName}/stop", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -407,7 +407,7 @@ def build_stop_multiple_executions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -416,7 +416,7 @@ def build_stop_multiple_executions_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/stop", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -440,7 +440,7 @@ def build_list_secrets_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -449,7 +449,7 @@ def build_list_secrets_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/listSecrets", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -467,69 +467,7 @@ def build_list_secrets_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_resume_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/resume", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_suspend_request(resource_group_name: str, job_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/jobs/{jobName}/suspend", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobsOperations: # pylint: disable=too-many-public-methods +class JobsOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -569,7 +507,7 @@ def list_detectors(self, resource_group_name: str, job_name: str, **kwargs: Any) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DiagnosticsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -651,7 +589,7 @@ def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -697,7 +635,7 @@ def get_detector( @distributed_trace def proxy_get(self, resource_group_name: str, job_name: str, api_name: str, **kwargs: Any) -> _models.Job: - """Get the properties for a given Container App Job. + """Get the properties of a Container App Job. Get the properties of a Container App Job. @@ -712,7 +650,7 @@ def proxy_get(self, resource_group_name: str, job_name: str, api_name: str, **kw :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -772,7 +710,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Job"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -852,7 +790,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -929,7 +867,7 @@ def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models :rtype: ~azure.mgmt.appcontainers.models.Job :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -975,7 +913,7 @@ def get(self, resource_group_name: str, job_name: str, **kwargs: Any) -> _models def _create_or_update_initial( self, resource_group_name: str, job_name: str, job_envelope: Union[_models.Job, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1161,7 +1099,7 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.Job](self._client, raw_result, get_long_running_output, polling_method) # type: ignore def _delete_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1277,7 +1215,7 @@ def _update_initial( job_envelope: Union[_models.JobPatchProperties, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1475,7 +1413,7 @@ def _start_initial( template: Optional[Union[_models.JobExecutionTemplate, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1679,7 +1617,7 @@ def get_long_running_output(pipeline_response): def _stop_execution_initial( self, resource_group_name: str, job_name: str, job_execution_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1797,7 +1735,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _stop_multiple_executions_initial( self, resource_group_name: str, job_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1929,7 +1867,7 @@ def list_secrets(self, resource_group_name: str, job_name: str, **kwargs: Any) - :rtype: ~azure.mgmt.appcontainers.models.JobSecretsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1971,233 +1909,3 @@ def list_secrets(self, resource_group_name: str, job_name: str, **kwargs: Any) - return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - def _resume_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_resume(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[_models.Job]: - """Resumes a suspended job. - - Resumes a suspended job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param job_name: Name of the Job. Required. - :type job_name: str - :return: An instance of LROPoller that returns either Job or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Job] = 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._resume_initial( - resource_group_name=resource_group_name, - job_name=job_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Job", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Job].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Job](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _suspend_initial(self, resource_group_name: str, job_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_suspend_request( - resource_group_name=resource_group_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_suspend(self, resource_group_name: str, job_name: str, **kwargs: Any) -> LROPoller[_models.Job]: - """Suspends a job. - - Suspends a job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param job_name: Name of the Job. Required. - :type job_name: str - :return: An instance of LROPoller that returns either Job or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.Job] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Job] = 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._suspend_initial( - resource_group_name=resource_group_name, - job_name=job_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Job", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Job].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Job](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_logic_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_logic_apps_operations.py deleted file mode 100644 index d605e1b98115..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_logic_apps_operations.py +++ /dev/null @@ -1,1074 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, container_app_name: str, logic_app_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "logicAppName": _SERIALIZER.url("logic_app_name", logic_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, container_app_name: str, logic_app_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "logicAppName": _SERIALIZER.url("logic_app_name", logic_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, container_app_name: str, logic_app_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "logicAppName": _SERIALIZER.url("logic_app_name", logic_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_workflows_request( - resource_group_name: str, container_app_name: str, logic_app_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "logicAppName": _SERIALIZER.url("logic_app_name", logic_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_workflow_request( - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - workflow_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/workflows/{workflowName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "logicAppName": _SERIALIZER.url("logic_app_name", logic_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "workflowName": _SERIALIZER.url( - "workflow_name", workflow_name, "str", max_length=63, min_length=3, pattern=r"^[a-z][a-z0-9]*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_deploy_workflow_artifacts_request( - resource_group_name: str, container_app_name: str, logic_app_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/deployWorkflowArtifacts", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "logicAppName": _SERIALIZER.url("logic_app_name", logic_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_workflows_connections_request( - resource_group_name: str, container_app_name: str, logic_app_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/listWorkflowsConnections", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "logicAppName": _SERIALIZER.url("logic_app_name", logic_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_invoke_request( - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - subscription_id: str, - *, - x_ms_logic_apps_proxy_path: str, - x_ms_logic_apps_proxy_method: Union[str, _models.LogicAppsProxyMethod], - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/providers/Microsoft.App/logicApps/{logicAppName}/invoke", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "containerAppName": _SERIALIZER.url( - "container_app_name", container_app_name, "str", pattern=r"^[-\w\._\(\)]+$" - ), - "logicAppName": _SERIALIZER.url("logic_app_name", logic_app_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["x-ms-logicApps-proxy-path"] = _SERIALIZER.header( - "x_ms_logic_apps_proxy_path", x_ms_logic_apps_proxy_path, "str" - ) - _headers["x-ms-logicApps-proxy-method"] = _SERIALIZER.header( - "x_ms_logic_apps_proxy_method", x_ms_logic_apps_proxy_method, "str" - ) - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class LogicAppsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`logic_apps` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any - ) -> _models.LogicApp: - """Gets a logic app extension resource. - - Gets a logic app extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :return: LogicApp or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.LogicApp - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LogicApp] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("LogicApp", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - resource: _models.LogicApp, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LogicApp: - """Create or update a Logic App extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param resource: Logic app resource properties. Required. - :type resource: ~azure.mgmt.appcontainers.models.LogicApp - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: LogicApp or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.LogicApp - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LogicApp: - """Create or update a Logic App extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param resource: Logic app resource properties. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: LogicApp or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.LogicApp - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - resource: Union[_models.LogicApp, IO[bytes]], - **kwargs: Any - ) -> _models.LogicApp: - """Create or update a Logic App extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param resource: Logic app resource properties. Is either a LogicApp type or a IO[bytes] type. - Required. - :type resource: ~azure.mgmt.appcontainers.models.LogicApp or IO[bytes] - :return: LogicApp or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.LogicApp - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LogicApp] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _json = self._serialize.body(resource, "LogicApp") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("LogicApp", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any - ) -> None: - """Deletes a Logic App extension resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_workflows( - self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any - ) -> Iterable["_models.WorkflowEnvelope"]: - """List the workflows for a logic app. - - List the workflows for a logic app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :return: An iterator like instance of either WorkflowEnvelope or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.WorkflowEnvelope] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkflowEnvelopeCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_workflows_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkflowEnvelopeCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_workflow( - self, resource_group_name: str, container_app_name: str, logic_app_name: str, workflow_name: str, **kwargs: Any - ) -> _models.WorkflowEnvelope: - """Get workflow information by its name. - - Get workflow information by its name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param workflow_name: Workflow name. Required. - :type workflow_name: str - :return: WorkflowEnvelope or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.WorkflowEnvelope - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkflowEnvelope] = kwargs.pop("cls", None) - - _request = build_get_workflow_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - workflow_name=workflow_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkflowEnvelope", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - workflow_artifacts: Optional[_models.WorkflowArtifacts] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Creates or updates the artifacts for the logic app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param workflow_artifacts: Application settings and files of the workflow. Default value is - None. - :type workflow_artifacts: ~azure.mgmt.appcontainers.models.WorkflowArtifacts - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - workflow_artifacts: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Creates or updates the artifacts for the logic app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param workflow_artifacts: Application settings and files of the workflow. Default value is - None. - :type workflow_artifacts: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def deploy_workflow_artifacts( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - workflow_artifacts: Optional[Union[_models.WorkflowArtifacts, IO[bytes]]] = None, - **kwargs: Any - ) -> None: - """Creates or updates the artifacts for the logic app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :param workflow_artifacts: Application settings and files of the workflow. Is either a - WorkflowArtifacts type or a IO[bytes] type. Default value is None. - :type workflow_artifacts: ~azure.mgmt.appcontainers.models.WorkflowArtifacts or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - 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(workflow_artifacts, (IOBase, bytes)): - _content = workflow_artifacts - else: - if workflow_artifacts is not None: - _json = self._serialize.body(workflow_artifacts, "WorkflowArtifacts") - else: - _json = None - - _request = build_deploy_workflow_artifacts_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_workflows_connections( - self, resource_group_name: str, container_app_name: str, logic_app_name: str, **kwargs: Any - ) -> _models.WorkflowEnvelope: - """Gets logic app's connections. - - Gets logic app's connections. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the Logic App, the extension resource. Required. - :type logic_app_name: str - :return: WorkflowEnvelope or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.WorkflowEnvelope - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkflowEnvelope] = kwargs.pop("cls", None) - - _request = build_list_workflows_connections_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("WorkflowEnvelope", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def invoke( - self, - resource_group_name: str, - container_app_name: str, - logic_app_name: str, - x_ms_logic_apps_proxy_path: str, - x_ms_logic_apps_proxy_method: Union[str, _models.LogicAppsProxyMethod], - **kwargs: Any - ) -> JSON: - """Proxies a the API call to the logic app backed by the container app. - - Proxies a the API call to the logic app backed by the container app. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param container_app_name: Name of the Container App. Required. - :type container_app_name: str - :param logic_app_name: Name of the LogicApp App, the extension resource. Required. - :type logic_app_name: str - :param x_ms_logic_apps_proxy_path: The proxy path for the API call. Required. - :type x_ms_logic_apps_proxy_path: str - :param x_ms_logic_apps_proxy_method: The proxy method for the API call. Known values are: "GET" - and "POST". Required. - :type x_ms_logic_apps_proxy_method: str or - ~azure.mgmt.appcontainers.models.LogicAppsProxyMethod - :return: JSON or the result of cls(response) - :rtype: JSON - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[JSON] = kwargs.pop("cls", None) - - _request = build_invoke_request( - resource_group_name=resource_group_name, - container_app_name=container_app_name, - logic_app_name=logic_app_name, - subscription_id=self._config.subscription_id, - x_ms_logic_apps_proxy_path=x_ms_logic_apps_proxy_path, - x_ms_logic_apps_proxy_method=x_ms_logic_apps_proxy_method, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.DefaultErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("object", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py index 9f36dced20c6..76d6ea02f60a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_certificates_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -50,7 +49,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -59,7 +58,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -84,7 +83,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -94,7 +93,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -121,7 +120,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -130,7 +129,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -155,7 +154,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -165,7 +164,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates/{managedCertificateName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -192,7 +191,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -201,7 +200,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/managedCertificates", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -257,7 +256,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ManagedCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -309,15 +308,11 @@ def _create_or_update_initial( managed_certificate_envelope: Optional[Union[_models.ManagedCertificate, IO[bytes]]] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, 304: ResourceNotModifiedError, - 400: cast( - Type[HttpResponseError], - lambda response: HttpResponseError(response=response, error_format=ARMErrorFormat), - ), } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -543,7 +538,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -677,7 +672,7 @@ def update( :rtype: ~azure.mgmt.appcontainers.models.ManagedCertificate :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -756,7 +751,7 @@ def list( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedCertificateCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py index 9dc1c93f419e..d5affe9c98b8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_list_detectors_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +51,7 @@ def build_list_detectors_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -76,7 +75,7 @@ def build_get_detector_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +84,7 @@ def build_get_detector_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectors/{detectorName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -140,7 +139,7 @@ def list_detectors( :rtype: ~azure.mgmt.appcontainers.models.DiagnosticsCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -202,7 +201,7 @@ def get_detector( :rtype: ~azure.mgmt.appcontainers.models.Diagnostics :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_endpoint_connections_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_endpoint_connections_operations.py deleted file mode 100644 index bc2a1b0afbbd..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_endpoint_connections_operations.py +++ /dev/null @@ -1,710 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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 io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -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 - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedEnvironmentPrivateEndpointConnectionsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`managed_environment_private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> Iterable["_models.PrivateEndpointConnection"]: - """List private endpoint connections for a given managed environment. - - List private endpoint connections for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either PrivateEndpointConnection or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, environment_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Get a private endpoint connection for a given managed environment. - - Get a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.appcontainers.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection_envelope: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(private_endpoint_connection_envelope, (IOBase, bytes)): - _content = private_endpoint_connection_envelope - else: - _json = self._serialize.body(private_endpoint_connection_envelope, "PrivateEndpointConnection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection_envelope: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of a private endpoint connection for a given managed environment. - - Update the state of a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection_envelope: The resource of private endpoint and its - properties. Required. - :type private_endpoint_connection_envelope: - ~azure.mgmt.appcontainers.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection_envelope: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of a private endpoint connection for a given managed environment. - - Update the state of a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection_envelope: The resource of private endpoint and its - properties. Required. - :type private_endpoint_connection_envelope: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - environment_name: str, - private_endpoint_connection_name: str, - private_endpoint_connection_envelope: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Update the state of a private endpoint connection for a given managed environment. - - Update the state of a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :param private_endpoint_connection_envelope: The resource of private endpoint and its - properties. Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type private_endpoint_connection_envelope: - ~azure.mgmt.appcontainers.models.PrivateEndpointConnection or IO[bytes] - :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.appcontainers.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _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", self._config.api_version)) - 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) - 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, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - private_endpoint_connection_envelope=private_endpoint_connection_envelope, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, environment_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - 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 [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, environment_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a private endpoint connection for a given managed environment. - - Delete a private endpoint connection for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection associated - with the Azure resource. Required. - :type private_endpoint_connection_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - environment_name=environment_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_link_resources_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_link_resources_operations.py deleted file mode 100644 index b0e3381efafc..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_private_link_resources_operations.py +++ /dev/null @@ -1,178 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# 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. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, environment_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/privateLinkResources", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "environmentName": _SERIALIZER.url("environment_name", environment_name, "str", pattern=r"^[-\w\._\(\)]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedEnvironmentPrivateLinkResourcesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.appcontainers.ContainerAppsAPIClient`'s - :attr:`managed_environment_private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, environment_name: str, **kwargs: Any - ) -> Iterable["_models.PrivateLinkResource"]: - """List private link resources for a given managed environment. - - List private link resources for a given managed environment. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param environment_name: Name of the Managed Environment. Required. - :type environment_name: str - :return: An iterator like instance of either PrivateLinkResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.appcontainers.models.PrivateLinkResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - environment_name=environment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - 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=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_usages_operations.py index 1a5c2012b781..bb65531a38a7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environment_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +44,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,7 +53,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/usages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -110,7 +109,7 @@ def list(self, resource_group_name: str, environment_name: str, **kwargs: Any) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py index 3fc779e575d5..6e910faf44cf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_diagnostics_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_get_root_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +51,7 @@ def build_get_root_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/detectorProperties/rootApi/", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -104,7 +103,7 @@ def get_root(self, resource_group_name: str, environment_name: str, **kwargs: An :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py index 7a8ce01af66d..6305ae423fdd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core.exceptions import ( @@ -36,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -48,13 +48,13 @@ 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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.App/managedEnvironments") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -72,7 +72,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +81,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -104,7 +104,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +113,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -137,7 +137,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -147,7 +147,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -173,7 +173,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,7 +182,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -206,7 +206,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -216,7 +216,7 @@ def build_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -242,7 +242,7 @@ def build_get_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -251,7 +251,7 @@ def build_get_auth_token_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/getAuthtoken", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -275,7 +275,7 @@ def build_list_workload_profile_states_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -284,7 +284,7 @@ def build_list_workload_profile_states_request( # pylint: disable=name-too-long "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/workloadProfileStates", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -337,7 +337,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ManagedEnviro api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedEnvironmentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -417,7 +417,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedEnvironmentsCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -494,7 +494,7 @@ def get(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironment :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -544,7 +544,7 @@ def _create_or_update_initial( environment_envelope: Union[_models.ManagedEnvironment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -737,7 +737,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, environment_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -847,7 +847,7 @@ def _update_initial( environment_envelope: Union[_models.ManagedEnvironment, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1056,7 +1056,7 @@ def get_auth_token( :rtype: ~azure.mgmt.appcontainers.models.EnvironmentAuthToken :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1123,7 +1123,7 @@ def list_workload_profile_states( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadProfileStatesCollection] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py index 03461d39e5b0..d147317cecc5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_managed_environments_storages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +43,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,7 +52,7 @@ def build_list_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -77,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +85,7 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -111,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,7 +120,7 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -148,7 +147,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -157,7 +156,7 @@ def build_delete_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/storages/{storageName}", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -212,7 +211,7 @@ def list( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStoragesCollection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +273,7 @@ def get( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -409,7 +408,7 @@ def create_or_update( :rtype: ~azure.mgmt.appcontainers.models.ManagedEnvironmentStorage :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -484,7 +483,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py index fc3bcc72ea79..6e4a17317749 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_namespaces_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +43,7 @@ def build_check_name_availability_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -54,7 +53,7 @@ def build_check_name_availability_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{environmentName}/checkNameAvailability", ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), "resourceGroupName": _SERIALIZER.url( "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), @@ -177,7 +176,7 @@ def check_name_availability( :rtype: ~azure.mgmt.appcontainers.models.CheckNameAvailabilityResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py index 2a59bde3b989..ff1b29321be7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,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: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +90,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationDetail"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.AvailableOperations] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_usages_operations.py index d5a93c241b48..274659d5210c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/azure/mgmt/appcontainers/operations/_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( @@ -31,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-02-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,7 +51,7 @@ def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> Ht ) path_format_arguments = { "location": _SERIALIZER.url("location", location, "str", pattern=r"^[-\w\._]+$"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -102,7 +101,7 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.Usage"]: api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_create_or_update.py deleted file mode 100644 index 5a7c362d5592..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_create_or_update.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.app_resiliency.create_or_update( - resource_group_name="rg", - app_name="testcontainerApp0", - name="resiliency-policy-1", - resiliency_envelope={ - "properties": { - "circuitBreakerPolicy": {"consecutiveErrors": 5, "intervalInSeconds": 10, "maxEjectionPercent": 50}, - "httpConnectionPool": {"http1MaxPendingRequests": 1024, "http2MaxRequests": 1024}, - "httpRetryPolicy": { - "matches": { - "errors": ["5xx", "connect-failure", "reset", "retriable-headers", "retriable-status-codes"], - "headers": [{"header": "X-Content-Type", "match": {"prefixMatch": "GOATS"}}], - "httpStatusCodes": [502, 503], - }, - "maxRetries": 5, - "retryBackOff": {"initialDelayInMilliseconds": 1000, "maxIntervalInMilliseconds": 10000}, - }, - "tcpConnectionPool": {"maxConnections": 100}, - "tcpRetryPolicy": {"maxConnectAttempts": 3}, - "timeoutPolicy": {"connectionTimeoutInSeconds": 5, "responseTimeoutInSeconds": 15}, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_delete.py deleted file mode 100644 index 2a3290b3c7b3..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - client.app_resiliency.delete( - resource_group_name="rg", - app_name="testcontainerApp0", - name="resiliency-policy-1", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_get.py deleted file mode 100644 index 7065799318f7..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.app_resiliency.get( - resource_group_name="rg", - app_name="testcontainerApp0", - name="resiliency-policy-1", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_list.py deleted file mode 100644 index f6775fa9fb55..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.app_resiliency.list( - resource_group_name="rg", - app_name="testcontainerApp0", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_patch.py deleted file mode 100644 index 7098bc5e8eb5..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/app_resiliency_patch.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python app_resiliency_patch.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.app_resiliency.update( - resource_group_name="rg", - app_name="testcontainerApp0", - name="resiliency-policy-1", - resiliency_envelope={ - "properties": {"timeoutPolicy": {"connectionTimeoutInSeconds": 40, "responseTimeoutInSeconds": 30}} - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AppResiliency_Patch.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py index c71fdb6e4cdd..9b9569f91ecb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_create_or_update.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py index 8240d4e413a7..21c98adf07ea 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py index 4c69273b19ca..c120ce52d802 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py index dd0e21b2cdfb..2701f3339112 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/auth_configs_list_by_container.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AuthConfigs_ListByContainer.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AuthConfigs_ListByContainer.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py index 32d0a6b0f796..f7e1088781a7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/available_workload_profiles_get.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/AvailableWorkloadProfiles_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/AvailableWorkloadProfiles_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py index 80c67d53ed01..542d9edc4e72 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/billing_meters_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/BillingMeters_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/BillingMeters_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_create_or_update.py deleted file mode 100644 index 04594ac45949..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_create_or_update.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.begin_create_or_update( - resource_group_name="rg", - builder_name="testBuilder", - builder_envelope={ - "identity": { - "type": "SystemAssigned,UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1": {} - }, - }, - "location": "eastus", - "properties": { - "containerRegistries": [ - { - "containerRegistryServer": "test.azurecr.io", - "identityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", - }, - { - "containerRegistryServer": "test2.azurecr.io", - "identityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", - }, - ], - "environmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg/providers/Microsoft.App/managedEnvironments/testEnv", - }, - "tags": {"company": "Microsoft"}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_delete.py deleted file mode 100644 index 259406317a14..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.builders.begin_delete( - resource_group_name="rg", - builder_name="testBuilder", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_get.py deleted file mode 100644 index e2321d5c4a71..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.get( - resource_group_name="rg", - builder_name="testBuilder", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_resource_group.py deleted file mode 100644 index 2cdceb481671..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_resource_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_list_by_resource_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.list_by_resource_group( - resource_group_name="rg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_ListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_subscription.py deleted file mode 100644 index 13608b9d4dff..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_list_by_subscription.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_list_by_subscription.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_ListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_update.py deleted file mode 100644 index 0d01c2a2e546..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builders_update.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builders_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builders.begin_update( - resource_group_name="rg", - builder_name="testBuilder", - builder_envelope={"tags": {"mytag1": "myvalue1"}}, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builders_Update.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_create_or_update.py deleted file mode 100644 index ae6655d27d86..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_create_or_update.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builds.begin_create_or_update( - resource_group_name="rg", - builder_name="testBuilder", - build_name="testBuild-123456789az", - build_envelope={ - "properties": { - "configuration": { - "baseOs": "DebianBullseye", - "environmentVariables": [{"name": "foo1", "value": "bar1"}, {"name": "foo2", "value": "bar2"}], - "platform": "dotnetcore", - "platformVersion": "7.0", - "preBuildSteps": [ - { - "description": "First pre build step.", - "httpGet": { - "fileName": "output.txt", - "headers": ["foo", "bar"], - "url": "https://microsoft.com", - }, - "scripts": ["echo 'hello'", "echo 'world'"], - }, - { - "description": "Second pre build step.", - "httpGet": {"fileName": "output.txt", "headers": ["foo"], "url": "https://microsoft.com"}, - "scripts": ["echo 'hello'", "echo 'again'"], - }, - ], - }, - "destinationContainerRegistry": {"image": "test.azurecr.io/repo:tag", "server": "test.azurecr.io"}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_delete.py deleted file mode 100644 index 67b8f63959d6..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.builds.begin_delete( - resource_group_name="rg", - builder_name="testBuilder", - build_name="testBuild", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_get.py deleted file mode 100644 index 2148675026f8..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builds.get( - resource_group_name="rg", - builder_name="testBuilder", - build_name="testBuild", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_auth_token.py deleted file mode 100644 index f66fd8c88ea5..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_auth_token.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_list_auth_token.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.build_auth_token.list( - resource_group_name="rg", - builder_name="testBuilder", - build_name="testBuild", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_ListAuthToken.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_by_builder_resource.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_by_builder_resource.py deleted file mode 100644 index cc345a50860d..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/builds_list_by_builder_resource.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python builds_list_by_builder_resource.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.builds_by_builder_resource.list( - resource_group_name="rg", - builder_name="testBuilder", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Builds_ListByBuilderResource.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py index 594148a497b8..4805dfa7171d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update_from_key_vault.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update_from_key_vault.py deleted file mode 100644 index ef33b0ce76c3..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_create_or_update_from_key_vault.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python certificate_create_or_update_from_key_vault.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.certificates.create_or_update( - resource_group_name="examplerg", - environment_name="testcontainerenv", - certificate_name="certificate-firendly-name", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_CreateOrUpdate_FromKeyVault.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py index f23ff120a400..a0abbfb8976f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py index 0828c12aa00b..2800519acebe 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificate_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py index 05ff56b14ce6..be746ac5466f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_check_name_availability.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificates_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificates_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py index 91be5df081a0..77ffa5eacfe9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_list_by_managed_environment.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificates_ListByManagedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificates_ListByManagedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py index bb11fd7d3044..2980e968f4db 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/certificates_patch.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Certificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Certificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py index da89a8a2733e..e4944d4df4b2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py index bb43e5e857eb..d949f0ea3e2d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py index 86116532731b..c2434fd68cde 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificate_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py index 6a53577f801c..e88bc03f5162 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_check_name_availability.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificates_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py index 1e7beb90acf6..ba3dfb6a1e91 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_list_by_connected_environment.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificates_ListByConnectedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py index 18e1b105e2e8..67010b80a742 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_certificates_patch.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsCertificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsCertificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py index 24727ed167a4..62b416badd4f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_create_or_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py index d9b1da9ab451..ba5fe77d8bf6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_create_or_update.py @@ -47,13 +47,6 @@ def main(): ], "scopes": ["container-app-1", "container-app-2"], "secrets": [{"name": "masterkey", "value": "keyvalue"}], - "serviceComponentBind": [ - { - "metadata": {"name": "daprcomponentBind", "value": "redis-bind"}, - "name": "statestore", - "serviceId": "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", - } - ], "version": "v1", } }, @@ -61,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py index 76733621cead..f336b924c420 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py index b3dbdff17128..57f2d9982902 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py index dc4e642bcea1..e6ec22c92c49 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py index 10a102b48849..9209803f5fdd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_dapr_components_list_secrets.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsDaprComponents_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py index b6b488e37f47..5c4ed97c0fda 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py index ae85090e64f1..ce3168aad8a3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py index 91340e4d4d70..a2ff361cc6ff 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py index ffe41e43b870..f7cbcb699ccf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py index 9392818cb7a2..f6c29ae6c941 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_patch.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironments_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironments_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py index 094e1d0ce1a1..9630e65c9581 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_create_or_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py index 05d1bf87a369..e1c6fdca32f8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsStorages_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py index 391eec19758c..0e36e6e51b51 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsStorages_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py index c73dc0806d5a..74d2dc5d2280 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/connected_environments_storages_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ConnectedEnvironmentsStorages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ConnectedEnvironmentsStorages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_delete.py deleted file mode 100644 index 1a7c4db19768..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_builds_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.container_apps_builds.begin_delete( - resource_group_name="rg", - container_app_name="testCapp", - build_name="testBuild", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_get.py deleted file mode 100644 index a1d2cf259996..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_builds_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.container_apps_builds.get( - resource_group_name="rg", - container_app_name="testCapp", - build_name="testBuild", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_list_by_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_list_by_container_app.py deleted file mode 100644 index c9c0d99d4e1f..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_builds_list_by_container_app.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_builds_list_by_container_app.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.container_apps_builds_by_container_app.list( - resource_group_name="rg", - container_app_name="testCapp", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsBuilds_ListByContainerApp.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py index c39bd4f29d8d..f721af3dacaf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_check_name_availability.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_CheckNameAvailability.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_CheckNameAvailability.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py index 1ad3f2c2c0ab..647a078fb4fd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update.py @@ -32,14 +32,8 @@ def main(): response = client.container_apps.begin_create_or_update( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", container_app_envelope={ - "identity": { - "type": "SystemAssigned,UserAssigned", - "userAssignedIdentities": { - "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity": {} - }, - }, "location": "East US", "properties": { "configuration": { @@ -52,13 +46,6 @@ def main(): "httpReadBufferSize": 30, "logLevel": "debug", }, - "identitySettings": [ - { - "identity": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", - "lifecycle": "All", - }, - {"identity": "system", "lifecycle": "Init"}, - ], "ingress": { "additionalPortMappings": [ {"external": True, "targetPort": 1234}, @@ -102,29 +89,17 @@ def main(): ], "stickySessions": {"affinity": "sticky"}, "targetPort": 3000, - "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], + "traffic": [{"label": "production", "revisionName": "testcontainerapp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, - "runtime": { - "dotnet": {"autoConfigureDataProtection": True}, - "java": { - "enableMetrics": True, - "javaAgent": { - "enabled": True, - "logging": { - "loggerSettings": [{"level": "debug", "logger": "org.springframework.boot"}] - }, - }, - }, - }, "service": {"type": "redis"}, }, "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", "template": { "containers": [ { - "image": "repo/testcontainerApp0:v1", - "name": "testcontainerApp0", + "image": "repo/testcontainerapp0:v1", + "name": "testcontainerapp0", "probes": [ { "httpGet": { @@ -137,19 +112,15 @@ def main(): "type": "Liveness", } ], - "volumeMounts": [ - {"mountPath": "/mnt/path1", "subPath": "subPath1", "volumeName": "azurefile"}, - {"mountPath": "/mnt/path2", "subPath": "subPath2", "volumeName": "nfsazurefile"}, - ], } ], "initContainers": [ { "args": ["-c", "while true; do echo hello; sleep 10;done"], "command": ["/bin/sh"], - "image": "repo/testcontainerApp0:v4", + "image": "repo/testcontainerapp0:v4", "name": "testinitcontainerApp0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, + "resources": {"cpu": 0.5, "memory": "1Gi"}, } ], "scale": { @@ -187,16 +158,10 @@ def main(): }, "serviceBinds": [ { - "clientType": "dotnet", - "customizedKeys": {"DesiredKey": "defaultKey"}, "name": "redisService", "serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService", } ], - "volumes": [ - {"name": "azurefile", "storageName": "storage", "storageType": "AzureFile"}, - {"name": "nfsazurefile", "storageName": "nfsStorage", "storageType": "NfsAzureFile"}, - ], }, "workloadProfileName": "My-GP-01", }, @@ -205,6 +170,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update_connected_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update_connected_environment.py deleted file mode 100644 index 982c44339883..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_create_or_update_connected_environment.py +++ /dev/null @@ -1,162 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_create_or_update_connected_environment.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.container_apps.begin_create_or_update( - resource_group_name="rg", - container_app_name="testcontainerApp0", - container_app_envelope={ - "extendedLocation": { - "name": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.ExtendedLocation/customLocations/testcustomlocation", - "type": "CustomLocation", - }, - "location": "East US", - "properties": { - "configuration": { - "dapr": { - "appPort": 3000, - "appProtocol": "http", - "enableApiLogging": True, - "enabled": True, - "httpMaxRequestSize": 10, - "httpReadBufferSize": 30, - "logLevel": "debug", - }, - "ingress": { - "additionalPortMappings": [ - {"external": True, "targetPort": 1234}, - {"exposedPort": 3456, "external": False, "targetPort": 2345}, - ], - "clientCertificateMode": "accept", - "corsPolicy": { - "allowCredentials": True, - "allowedHeaders": ["HEADER1", "HEADER2"], - "allowedMethods": ["GET", "POST"], - "allowedOrigins": ["https://a.test.com", "https://b.test.com"], - "exposeHeaders": ["HEADER3", "HEADER4"], - "maxAge": 1234, - }, - "customDomains": [ - { - "bindingType": "SniEnabled", - "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com", - "name": "www.my-name.com", - }, - { - "bindingType": "SniEnabled", - "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com", - "name": "www.my-other-name.com", - }, - ], - "external": True, - "ipSecurityRestrictions": [ - { - "action": "Allow", - "description": "Allowing all IP's within the subnet below to access containerapp", - "ipAddressRange": "192.168.1.1/32", - "name": "Allow work IP A subnet", - }, - { - "action": "Allow", - "description": "Allowing all IP's within the subnet below to access containerapp", - "ipAddressRange": "192.168.1.1/8", - "name": "Allow work IP B subnet", - }, - ], - "stickySessions": {"affinity": "sticky"}, - "targetPort": 3000, - "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], - }, - "maxInactiveRevisions": 10, - "runtime": { - "dotnet": {"autoConfigureDataProtection": True}, - "java": { - "enableMetrics": True, - "javaAgent": { - "enabled": True, - "logging": { - "loggerSettings": [{"level": "debug", "logger": "org.springframework.boot"}] - }, - }, - }, - }, - }, - "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/connectedEnvironments/demokube", - "template": { - "containers": [ - { - "image": "repo/testcontainerApp0:v1", - "name": "testcontainerApp0", - "probes": [ - { - "httpGet": { - "httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}], - "path": "/health", - "port": 8080, - }, - "initialDelaySeconds": 3, - "periodSeconds": 3, - "type": "Liveness", - } - ], - } - ], - "initContainers": [ - { - "args": ["-c", "while true; do echo hello; sleep 10;done"], - "command": ["/bin/sh"], - "image": "repo/testcontainerApp0:v4", - "name": "testinitcontainerApp0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, - } - ], - "scale": { - "cooldownPeriod": 350, - "maxReplicas": 5, - "minReplicas": 1, - "pollingInterval": 35, - "rules": [ - { - "custom": {"metadata": {"concurrentRequests": "50"}, "type": "http"}, - "name": "httpscalingrule", - } - ], - }, - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_CreateOrUpdate_ConnectedEnvironment.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py index be555431bf19..411680a6f8c0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_delete.py @@ -32,10 +32,10 @@ def main(): client.container_apps.begin_delete( resource_group_name="rg", - container_app_name="testWorkerApp0", + container_app_name="testworkerapp0", ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py index 6a6cba62774f..5940968675c3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsDiagnostics_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerAppsDiagnostics_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py index 44e30c8edd2c..ce98d274c863 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_diagnostics_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsDiagnostics_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerAppsDiagnostics_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py index f5f2cf370cd5..631def6ccb19 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps_diagnostics.get_root( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py index 42aaf1991bc1..ec5f56b5b4d7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_get_auth_token.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.get_auth_token( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_GetAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_GetAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_kind_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_kind_create_or_update.py deleted file mode 100644 index 0710f88d9a99..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_kind_create_or_update.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_kind_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.container_apps.begin_create_or_update( - resource_group_name="rg", - container_app_name="testcontainerAppKind", - container_app_envelope={ - "kind": "workflowapp", - "location": "East Us", - "managedBy": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Web/sites/testcontainerAppKind", - "properties": { - "configuration": { - "activeRevisionsMode": "Single", - "ingress": {"allowInsecure": True, "external": True, "targetPort": 80}, - }, - "managedEnvironmentId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/testmanagedenv3", - "template": { - "containers": [ - { - "image": "default/logicapps-base:latest", - "name": "logicapps-container", - "resources": {"cpu": 1, "memory": "2.0Gi"}, - } - ], - "scale": {"cooldownPeriod": 350, "maxReplicas": 30, "minReplicas": 1, "pollingInterval": 35}, - }, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Kind_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py index 1bc694dc2101..311fe3c0e07d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py index eca4c3765a5a..a81ca3dc2b05 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py index f057938529c9..f6bc1a24a3d3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_custom_host_name_analysis.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.list_custom_host_name_analysis( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListCustomHostNameAnalysis.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ListCustomHostNameAnalysis.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py index b06c04f37800..04c15cdc26d0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_list_secrets.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.list_secrets( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py index 0567ceee69bc..c41549c54961 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_managed_by_create_or_update.py @@ -32,7 +32,7 @@ def main(): response = client.container_apps.begin_create_or_update( resource_group_name="rg", - container_app_name="testcontainerAppManagedBy", + container_app_name="testcontainerappmanagedby", container_app_envelope={ "location": "East US", "managedBy": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.AppPlatform/Spring/springapp", @@ -42,7 +42,7 @@ def main(): "exposedPort": 4000, "external": True, "targetPort": 3000, - "traffic": [{"revisionName": "testcontainerAppManagedBy-ab1234", "weight": 100}], + "traffic": [{"revisionName": "testcontainerappmanagedby-ab1234", "weight": 100}], "transport": "tcp", } }, @@ -50,8 +50,8 @@ def main(): "template": { "containers": [ { - "image": "repo/testcontainerAppManagedBy:v1", - "name": "testcontainerAppManagedBy", + "image": "repo/testcontainerappmanagedby:v1", + "name": "testcontainerappmanagedby", "probes": [ { "initialDelaySeconds": 3, @@ -76,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_ManagedBy_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_ManagedBy_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py index 614ee5f6f01e..29db8a7a8829 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patch.py @@ -32,7 +32,7 @@ def main(): response = client.container_apps.begin_update( resource_group_name="rg", - container_app_name="testcontainerApp0", + container_app_name="testcontainerapp0", container_app_envelope={ "location": "East US", "properties": { @@ -76,28 +76,16 @@ def main(): ], "stickySessions": {"affinity": "sticky"}, "targetPort": 3000, - "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], + "traffic": [{"label": "production", "revisionName": "testcontainerapp0-ab1234", "weight": 100}], }, "maxInactiveRevisions": 10, - "runtime": { - "dotnet": {"autoConfigureDataProtection": True}, - "java": { - "enableMetrics": True, - "javaAgent": { - "enabled": True, - "logging": { - "loggerSettings": [{"level": "debug", "logger": "org.springframework.boot"}] - }, - }, - }, - }, "service": {"type": "redis"}, }, "template": { "containers": [ { - "image": "repo/testcontainerApp0:v1", - "name": "testcontainerApp0", + "image": "repo/testcontainerapp0:v1", + "name": "testcontainerapp0", "probes": [ { "httpGet": { @@ -114,9 +102,9 @@ def main(): ], "initContainers": [ { - "image": "repo/testcontainerApp0:v4", + "image": "repo/testcontainerapp0:v4", "name": "testinitcontainerApp0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, + "resources": {"cpu": 0.5, "memory": "1Gi"}, } ], "scale": { @@ -133,8 +121,6 @@ def main(): }, "serviceBinds": [ { - "clientType": "dotnet", - "customizedKeys": {"DesiredKey": "defaultKey"}, "name": "service", "serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/service", } @@ -147,6 +133,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_apply.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_apply.py deleted file mode 100644 index 3ae8181fb130..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_apply.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_patches_apply.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.container_apps_patches.begin_apply( - resource_group_name="rg", - container_app_name="test-app", - patch_name="testPatch-25fe4b", - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Apply.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_delete.py deleted file mode 100644 index 46e89807a6d6..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_patches_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.container_apps_patches.begin_delete( - resource_group_name="rg", - container_app_name="test-app", - patch_name="testPatch-25fe4b", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_get.py deleted file mode 100644 index ea96d388a69a..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_patches_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.container_apps_patches.get( - resource_group_name="rg", - container_app_name="test-app", - patch_name="testPatch-25fe4b", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_list_by_container_app.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_list_by_container_app.py deleted file mode 100644 index 137b60c3a890..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_list_by_container_app.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_patches_list_by_container_app.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.container_apps_patches.list_by_container_app( - resource_group_name="rg", - container_app_name="test-app", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_ListByContainerApp.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_skip_configure.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_skip_configure.py deleted file mode 100644 index 8c6cf0adfa0b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_patches_skip_configure.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_patches_skip_configure.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - client.container_apps_patches.begin_skip_configure( - resource_group_name="rg", - container_app_name="test-app", - patch_name="testPatch-25fe4b", - patch_skip_config={"skip": True}, - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerAppsPatches_Skip_Configure.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_source_to_cloud_app_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_source_to_cloud_app_create_or_update.py deleted file mode 100644 index 7a0d2a37f956..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_source_to_cloud_app_create_or_update.py +++ /dev/null @@ -1,166 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python container_apps_source_to_cloud_app_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.container_apps.begin_create_or_update( - resource_group_name="rg", - container_app_name="testcontainerApp0", - container_app_envelope={ - "location": "East US", - "properties": { - "configuration": { - "dapr": { - "appPort": 3000, - "appProtocol": "http", - "enableApiLogging": True, - "enabled": True, - "httpMaxRequestSize": 10, - "httpReadBufferSize": 30, - "logLevel": "debug", - }, - "ingress": { - "additionalPortMappings": [ - {"external": True, "targetPort": 1234}, - {"exposedPort": 3456, "external": False, "targetPort": 2345}, - ], - "clientCertificateMode": "accept", - "corsPolicy": { - "allowCredentials": True, - "allowedHeaders": ["HEADER1", "HEADER2"], - "allowedMethods": ["GET", "POST"], - "allowedOrigins": ["https://a.test.com", "https://b.test.com"], - "exposeHeaders": ["HEADER3", "HEADER4"], - "maxAge": 1234, - }, - "customDomains": [ - { - "bindingType": "SniEnabled", - "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-name-dot-com", - "name": "www.my-name.com", - }, - { - "bindingType": "SniEnabled", - "certificateId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube/certificates/my-certificate-for-my-other-name-dot-com", - "name": "www.my-other-name.com", - }, - ], - "external": True, - "ipSecurityRestrictions": [ - { - "action": "Allow", - "description": "Allowing all IP's within the subnet below to access containerapp", - "ipAddressRange": "192.168.1.1/32", - "name": "Allow work IP A subnet", - }, - { - "action": "Allow", - "description": "Allowing all IP's within the subnet below to access containerapp", - "ipAddressRange": "192.168.1.1/8", - "name": "Allow work IP B subnet", - }, - ], - "stickySessions": {"affinity": "sticky"}, - "targetPort": 3000, - "traffic": [{"label": "production", "revisionName": "testcontainerApp0-ab1234", "weight": 100}], - }, - "maxInactiveRevisions": 10, - "service": {"type": "redis"}, - }, - "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", - "patchingConfiguration": {"patchingMode": "Automatic"}, - "template": { - "containers": [ - { - "image": "", - "imageType": "CloudBuild", - "name": "testcontainerApp0", - "probes": [ - { - "httpGet": { - "httpHeaders": [{"name": "Custom-Header", "value": "Awesome"}], - "path": "/health", - "port": 8080, - }, - "initialDelaySeconds": 3, - "periodSeconds": 3, - "type": "Liveness", - } - ], - "volumeMounts": [ - {"mountPath": "/mnt/path1", "subPath": "subPath1", "volumeName": "azurefile"}, - {"mountPath": "/mnt/path2", "subPath": "subPath2", "volumeName": "nfsazurefile"}, - ], - } - ], - "initContainers": [ - { - "args": ["-c", "while true; do echo hello; sleep 10;done"], - "command": ["/bin/sh"], - "image": "repo/testcontainerApp0:v4", - "name": "testinitcontainerApp0", - "resources": {"cpu": 0.2, "memory": "100Mi"}, - } - ], - "scale": { - "cooldownPeriod": 350, - "maxReplicas": 5, - "minReplicas": 1, - "pollingInterval": 35, - "rules": [ - { - "custom": {"metadata": {"concurrentRequests": "50"}, "type": "http"}, - "name": "httpscalingrule", - } - ], - }, - "serviceBinds": [ - { - "clientType": "dotnet", - "customizedKeys": {"DesiredKey": "defaultKey"}, - "name": "redisService", - "serviceId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/redisService", - } - ], - "volumes": [ - {"name": "azurefile", "storageName": "storage", "storageType": "AzureFile"}, - {"name": "nfsazurefile", "storageName": "nfsStorage", "storageType": "NfsAzureFile"}, - ], - }, - "workloadProfileName": "My-GP-01", - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_SourceToCloudApp_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py index b931704058da..8cab72d6d371 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_start.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.begin_start( resource_group_name="rg", - container_app_name="testWorkerApp0", + container_app_name="testworkerapp0", ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Start.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Start.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py index 4e53aecae74d..51cc6db16b48 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_stop.py @@ -32,11 +32,11 @@ def main(): response = client.container_apps.begin_stop( resource_group_name="rg", - container_app_name="testWorkerApp0", + container_app_name="testworkerApp0", ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_Stop.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_Stop.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py index 9088967d2cec..2967da7ed1fc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/container_apps_tcp_app_create_or_update.py @@ -32,7 +32,7 @@ def main(): response = client.container_apps.begin_create_or_update( resource_group_name="rg", - container_app_name="testcontainerAppTcp", + container_app_name="testcontainerapptcp", container_app_envelope={ "location": "East US", "properties": { @@ -41,7 +41,7 @@ def main(): "exposedPort": 4000, "external": True, "targetPort": 3000, - "traffic": [{"revisionName": "testcontainerAppTcp-ab1234", "weight": 100}], + "traffic": [{"revisionName": "testcontainerapptcp-ab1234", "weight": 100}], "transport": "tcp", } }, @@ -49,8 +49,8 @@ def main(): "template": { "containers": [ { - "image": "repo/testcontainerAppTcp:v1", - "name": "testcontainerAppTcp", + "image": "repo/testcontainerapptcp:v1", + "name": "testcontainerapptcp", "probes": [ { "initialDelaySeconds": 3, @@ -75,6 +75,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ContainerApps_TcpApp_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ContainerApps_TcpApp_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_delete.py deleted file mode 100644 index 394bfb98e13f..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_delete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policies_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.dapr_component_resiliency_policies.delete( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicies_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_get.py deleted file mode 100644 index 7c171732cfb2..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policies_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.get( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicies_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_list.py deleted file mode 100644 index 64e1d88ee179..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policies_list.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policies_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.list( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicies_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_all_options.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_all_options.py deleted file mode 100644 index c4c74ea43170..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_all_options.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policy_create_or_update_all_options.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - dapr_component_resiliency_policy_envelope={ - "properties": { - "inboundPolicy": { - "circuitBreakerPolicy": {"consecutiveErrors": 5, "intervalInSeconds": 4, "timeoutInSeconds": 10}, - "httpRetryPolicy": { - "maxRetries": 15, - "retryBackOff": {"initialDelayInMilliseconds": 2000, "maxIntervalInMilliseconds": 5500}, - }, - "timeoutPolicy": {"responseTimeoutInSeconds": 30}, - }, - "outboundPolicy": { - "circuitBreakerPolicy": {"consecutiveErrors": 3, "intervalInSeconds": 60, "timeoutInSeconds": 20}, - "httpRetryPolicy": { - "maxRetries": 5, - "retryBackOff": {"initialDelayInMilliseconds": 100, "maxIntervalInMilliseconds": 30000}, - }, - "timeoutPolicy": {"responseTimeoutInSeconds": 12}, - }, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_AllOptions.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_outbound_only.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_outbound_only.py deleted file mode 100644 index 7ba3b3bded64..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_outbound_only.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policy_create_or_update_outbound_only.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - dapr_component_resiliency_policy_envelope={ - "properties": { - "outboundPolicy": { - "circuitBreakerPolicy": {"consecutiveErrors": 3, "intervalInSeconds": 60, "timeoutInSeconds": 20}, - "httpRetryPolicy": { - "maxRetries": 5, - "retryBackOff": {"initialDelayInMilliseconds": 100, "maxIntervalInMilliseconds": 30000}, - }, - "timeoutPolicy": {"responseTimeoutInSeconds": 12}, - } - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_OutboundOnly.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_sparse_options.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_sparse_options.py deleted file mode 100644 index d6699ea9382e..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_component_resiliency_policy_create_or_update_sparse_options.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_component_resiliency_policy_create_or_update_sparse_options.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_component_resiliency_policies.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - component_name="mydaprcomponent", - name="myresiliencypolicy", - dapr_component_resiliency_policy_envelope={ - "properties": { - "inboundPolicy": { - "circuitBreakerPolicy": {"consecutiveErrors": 3, "timeoutInSeconds": 20}, - "httpRetryPolicy": { - "maxRetries": 5, - "retryBackOff": {"initialDelayInMilliseconds": 2000, "maxIntervalInMilliseconds": 5500}, - }, - }, - "outboundPolicy": {"timeoutPolicy": {"responseTimeoutInSeconds": 12}}, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponentResiliencyPolicy_CreateOrUpdate_SparseOptions.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py index 9e65fca11fad..16b47465b1e2 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secret_store_component.py @@ -47,13 +47,6 @@ def main(): ], "scopes": ["container-app-1", "container-app-2"], "secretStoreComponent": "my-secret-store", - "serviceComponentBind": [ - { - "metadata": {"name": "daprcomponentBind", "value": "redis-bind"}, - "name": "statestore", - "serviceId": "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", - } - ], "version": "v1", } }, @@ -61,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_CreateOrUpdate_SecretStoreComponent.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py index fd9f72adf0ee..907f039c81cf 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_create_or_update_secrets.py @@ -47,13 +47,6 @@ def main(): ], "scopes": ["container-app-1", "container-app-2"], "secrets": [{"name": "masterkey", "value": "keyvalue"}], - "serviceComponentBind": [ - { - "metadata": {"name": "daprcomponentBind", "value": "redis-bind"}, - "name": "statestore", - "serviceId": "/subscriptions/9f7371f1-b593-4c3c-84e2-9167806ad358/resourceGroups/ca-syn2-group/providers/Microsoft.App/containerapps/cappredis", - } - ], "version": "v1", } }, @@ -61,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_CreateOrUpdate_Secrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_CreateOrUpdate_Secrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py index bc2d152efa0b..19ac68952456 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py index ddb007ce3e77..d0103315f147 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secret_store_component.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Get_SecretStoreComponent.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_SecretStoreComponent.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py index 58575899c8e3..e14a9a46a900 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_get_secrets.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_Get_Secrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_Get_Secrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py index d714ed7bca74..76f45340747b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py index 0f1599cd7207..336caa930d96 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_components_list_secrets.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprComponents_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/DaprComponents_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_bulk_subscribe_and_scopes.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_bulk_subscribe_and_scopes.py deleted file mode 100644 index a806104af44e..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_bulk_subscribe_and_scopes.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_create_or_update_bulk_subscribe_and_scopes.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mysubscription", - dapr_subscription_envelope={ - "properties": { - "bulkSubscribe": {"enabled": True, "maxAwaitDurationMs": 500, "maxMessagesCount": 123}, - "pubsubName": "mypubsubcomponent", - "routes": {"default": "/products"}, - "scopes": ["warehouseapp", "customersupportapp"], - "topic": "inventory", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_CreateOrUpdate_BulkSubscribeAndScopes.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_default_route.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_default_route.py deleted file mode 100644 index 861b72b01334..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_default_route.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_create_or_update_default_route.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mysubscription", - dapr_subscription_envelope={ - "properties": {"pubsubName": "mypubsubcomponent", "routes": {"default": "/products"}, "topic": "inventory"} - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_CreateOrUpdate_DefaultRoute.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_route_rules_and_metadata.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_route_rules_and_metadata.py deleted file mode 100644 index b9190c4a3420..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_create_or_update_route_rules_and_metadata.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_create_or_update_route_rules_and_metadata.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mysubscription", - dapr_subscription_envelope={ - "properties": { - "metadata": {"foo": "bar", "hello": "world"}, - "pubsubName": "mypubsubcomponent", - "routes": { - "default": "/products", - "rules": [ - {"match": "event.type == 'widget'", "path": "/widgets"}, - {"match": "event.type == 'gadget'", "path": "/gadgets"}, - ], - }, - "topic": "inventory", - } - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_CreateOrUpdate_RouteRulesAndMetadata.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_delete.py deleted file mode 100644 index 5531aaa71688..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.dapr_subscriptions.delete( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mysubscription", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_bulk_subscribe_and_scopes.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_bulk_subscribe_and_scopes.py deleted file mode 100644 index 76c9018263a1..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_bulk_subscribe_and_scopes.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_get_bulk_subscribe_and_scopes.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mypubsubcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Get_BulkSubscribeAndScopes.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_default_route.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_default_route.py deleted file mode 100644 index eab424bf711a..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_default_route.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_get_default_route.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mypubsubcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Get_DefaultRoute.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_route_rules_and_metadata.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_route_rules_and_metadata.py deleted file mode 100644 index 0bd6e9711f36..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_get_route_rules_and_metadata.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_get_route_rules_and_metadata.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mypubsubcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_Get_RouteRulesAndMetadata.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_list.py deleted file mode 100644 index 04baa56e6474..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dapr_subscriptions_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dapr_subscriptions_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dapr_subscriptions.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DaprSubscriptions_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update.py deleted file mode 100644 index 7bf97b63e080..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.begin_create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - dot_net_component_envelope={ - "properties": { - "componentType": "AspireDashboard", - "configurations": [{"propertyName": "dashboard-theme", "value": "dark"}], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update_service_bind.py deleted file mode 100644 index bdf0d33a3abb..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_create_or_update_service_bind.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_create_or_update_service_bind.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.begin_create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - dot_net_component_envelope={ - "properties": { - "componentType": "AspireDashboard", - "configurations": [{"propertyName": "dashboard-theme", "value": "dark"}], - "serviceBinds": [ - { - "name": "yellowcat", - "serviceId": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat", - } - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_CreateOrUpdate_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_delete.py deleted file mode 100644 index 08d450b57995..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.dot_net_components.begin_delete( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get.py deleted file mode 100644 index af8ccf93d2d3..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get_service_bind.py deleted file mode 100644 index 95a45b0579e1..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_get_service_bind.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_get_service_bind.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Get_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list.py deleted file mode 100644 index e20c21100d1d..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list_service_bind.py deleted file mode 100644 index 5509186a4fa4..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_list_service_bind.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_list_service_bind.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_List_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch.py deleted file mode 100644 index b12aa6939207..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_patch.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.begin_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - dot_net_component_envelope={ - "properties": { - "componentType": "AspireDashboard", - "configurations": [{"propertyName": "dashboard-theme", "value": "dark"}], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Patch.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch_service_bind.py deleted file mode 100644 index d439a50b57cf..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/dot_net_components_patch_service_bind.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python dot_net_components_patch_service_bind.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.dot_net_components.begin_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="mydotnetcomponent", - dot_net_component_envelope={ - "properties": { - "componentType": "AspireDashboard", - "configurations": [{"propertyName": "dashboard-theme", "value": "dark"}], - "serviceBinds": [ - { - "name": "yellowcat", - "serviceId": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/dotNetComponents/yellowcat", - } - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/DotNetComponents_Patch_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/functions_extension_post.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/functions_extension_post.py deleted file mode 100644 index 46a70524d072..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/functions_extension_post.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python functions_extension_post.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.functions_extension.invoke_functions_host( - resource_group_name="rg", - container_app_name="testcontainerApp0", - revision_name="testcontainerApp0-pjxhsye", - function_app_name="testcontainerApp0", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/FunctionsExtension_Post.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update.py deleted file mode 100644 index 78359218bf25..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.begin_create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - java_component_envelope={ - "properties": { - "componentType": "SpringBootAdmin", - "configurations": [ - {"propertyName": "spring.boot.admin.ui.enable-toasts", "value": "true"}, - {"propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms"}, - ], - "scale": {"maxReplicas": 1, "minReplicas": 1}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update_service_bind.py deleted file mode 100644 index 0a963ba92c96..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_create_or_update_service_bind.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_create_or_update_service_bind.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.begin_create_or_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - java_component_envelope={ - "properties": { - "componentType": "SpringBootAdmin", - "configurations": [ - {"propertyName": "spring.boot.admin.ui.enable-toasts", "value": "true"}, - {"propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms"}, - ], - "scale": {"maxReplicas": 1, "minReplicas": 1}, - "serviceBinds": [ - { - "name": "yellowcat", - "serviceId": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat", - } - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_CreateOrUpdate_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_delete.py deleted file mode 100644 index 783cb50c8e1a..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.java_components.begin_delete( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get.py deleted file mode 100644 index f1f2f6ba1733..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get_service_bind.py deleted file mode 100644 index 9f764f970b73..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_get_service_bind.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_get_service_bind.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.get( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Get_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list.py deleted file mode 100644 index 1dfffd9db9f7..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list_service_bind.py deleted file mode 100644 index 7e7008efcfbb..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_list_service_bind.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_list_service_bind.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.list( - resource_group_name="examplerg", - environment_name="myenvironment", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_List_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch.py deleted file mode 100644 index 7b56ab8543fd..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_patch.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.begin_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - java_component_envelope={ - "properties": { - "componentType": "SpringBootAdmin", - "configurations": [ - {"propertyName": "spring.boot.admin.ui.enable-toasts", "value": "true"}, - {"propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms"}, - ], - "scale": {"maxReplicas": 1, "minReplicas": 1}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Patch.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch_service_bind.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch_service_bind.py deleted file mode 100644 index a8fcc4eba3ed..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/java_components_patch_service_bind.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python java_components_patch_service_bind.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.java_components.begin_update( - resource_group_name="examplerg", - environment_name="myenvironment", - name="myjavacomponent", - java_component_envelope={ - "properties": { - "componentType": "SpringBootAdmin", - "configurations": [ - {"propertyName": "spring.boot.admin.ui.enable-toasts", "value": "true"}, - {"propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms"}, - ], - "scale": {"maxReplicas": 1, "minReplicas": 1}, - "serviceBinds": [ - { - "name": "yellowcat", - "serviceId": "/subscriptions/8efdecc5-919e-44eb-b179-915dca89ebf9/resourceGroups/examplerg/providers/Microsoft.App/managedEnvironments/myenvironment/javaComponents/yellowcat", - } - ], - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/JavaComponents_Patch_ServiceBind.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py index 5aad6377c5c5..71b9fc6a80aa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_delete.py @@ -32,10 +32,10 @@ def main(): client.jobs.begin_delete( resource_group_name="rg", - job_name="testWorkerContainerAppsJob0", + job_name="testworkercontainerappsjob0", ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py index 6f1ec8ca2fe3..6fa5c4800ec6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_execution_get.py @@ -32,12 +32,12 @@ def main(): response = client.job_execution( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", job_execution_name="jobExecution1", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Execution_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Execution_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py index 787f2903c41c..d3189928a62e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_executions_get.py @@ -32,12 +32,12 @@ def main(): response = client.jobs_executions.list( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ) for item in response: print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Executions_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Executions_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py index 432732fb53e2..a3fc44344343 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get.py @@ -32,11 +32,11 @@ def main(): response = client.jobs.get( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get_detector.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get_detector.py index c0cd4f3e5e07..f4e1e1217211 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get_detector.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_get_detector.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_GetDetector.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_GetDetector.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_detectors.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_detectors.py index 8e3ed688b03d..95d09ed0dc3b 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_detectors.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_detectors.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListDetectors.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ListDetectors.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py index 45a5d1f3eda2..22a547c831eb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_list_secrets.py @@ -32,11 +32,11 @@ def main(): response = client.jobs.list_secrets( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ListSecrets.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ListSecrets.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_proxy_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_proxy_get.py index 166007f8aa4f..af7cc41c4a6c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_proxy_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_proxy_get.py @@ -32,12 +32,12 @@ def main(): response = client.jobs.proxy_get( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", api_name="rootApi", ) print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_ProxyGet.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_ProxyGet.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py index 660e975ae04e..38312b3441a1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_start.py @@ -32,11 +32,11 @@ def main(): response = client.jobs.begin_start( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Start.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Start.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py index d9efac99f737..12b75f09d0a5 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_execution.py @@ -32,11 +32,11 @@ def main(): client.jobs.begin_stop_execution( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", job_execution_name="jobExecution1", ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Stop_Execution.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Stop_Execution.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py index 964d950f3103..58d4b2b90ee1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/job_stop_multiple.py @@ -32,11 +32,11 @@ def main(): response = client.jobs.begin_stop_multiple_executions( resource_group_name="rg", - job_name="testcontainerAppsJob0", + job_name="testcontainerappsjob0", ).result() print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Job_Stop_Multiple.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Job_Stop_Multiple.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py index 394544855a3b..fdfe2533a7b6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Jobs_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py index 901b6ca6b3c4..3f25481775a7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Jobs_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_resume.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_resume.py deleted file mode 100644 index d5103965c699..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_resume.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python jobs_resume.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.jobs.begin_resume( - resource_group_name="rg", - job_name="testcontainerAppsJob0", - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Resume.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_suspend.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_suspend.py deleted file mode 100644 index 494dc3570660..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/jobs_suspend.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python jobs_suspend.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.jobs.begin_suspend( - resource_group_name="rg", - job_name="testcontainerAppsJob0", - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Jobs_Suspend.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_create.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_create.py deleted file mode 100644 index b17a83a1db5a..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_create.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python logic_apps_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.logic_apps.create_or_update( - resource_group_name="examplerg", - container_app_name="testcontainerApp0", - logic_app_name="testcontainerApp0", - resource={"properties": {}}, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Create.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete.py deleted file mode 100644 index 3723a6b14dc0..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python logic_apps_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.logic_apps.delete( - resource_group_name="examplerg", - container_app_name="testcontainerApp0", - logic_app_name="testcontainerApp0", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete_deploy_workflow_artifacts.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete_deploy_workflow_artifacts.py deleted file mode 100644 index 53a088ad48e8..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_delete_deploy_workflow_artifacts.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python logic_apps_delete_deploy_workflow_artifacts.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - client.logic_apps.deploy_workflow_artifacts( - resource_group_name="testrg123", - container_app_name="testapp2", - logic_app_name="testapp2", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_DeleteDeployWorkflowArtifacts.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get.py deleted file mode 100644 index 3f3bbb065063..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python logic_apps_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.logic_apps.get( - resource_group_name="examplerg", - container_app_name="testcontainerApp0", - logic_app_name="testcontainerApp0", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get_workflow.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get_workflow.py deleted file mode 100644 index 10cc104a38d5..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_get_workflow.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python logic_apps_get_workflow.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.logic_apps.get_workflow( - resource_group_name="examplerg", - container_app_name="testcontainerApp0", - logic_app_name="testcontainerApp0", - workflow_name="stateful1", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_GetWorkflow.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_connections.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_connections.py deleted file mode 100644 index 0df82c749ed7..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_connections.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python logic_apps_list_connections.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.logic_apps.list_workflows_connections( - resource_group_name="testrg123", - container_app_name="testapp2", - logic_app_name="testapp2", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListConnections.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_workflows.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_workflows.py deleted file mode 100644 index 1760beb7571c..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_list_workflows.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python logic_apps_list_workflows.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.logic_apps.list_workflows( - resource_group_name="examplerg", - container_app_name="testcontainerApp0", - logic_app_name="testcontainerApp0", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_ListWorkflows.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_post_deploy_workflow_artifacts.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_post_deploy_workflow_artifacts.py deleted file mode 100644 index f2d1b47a8a05..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/logic_apps_post_deploy_workflow_artifacts.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python logic_apps_post_deploy_workflow_artifacts.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - client.logic_apps.deploy_workflow_artifacts( - resource_group_name="testrg123", - container_app_name="testapp2", - logic_app_name="testapp2", - ) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/LogicApps_PostDeployWorkflowArtifacts.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py index 0a78917c2a1b..dbef2311317c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_create_or_update.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py index 88d24e1ba8fb..26c488f40f2e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py index af53b64175c2..6363cc973522 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificate_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificate_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificate_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py index a75a51c33023..aa938ecc1d8c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_list_by_managed_environment.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificates_ListByManagedEnvironment.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificates_ListByManagedEnvironment.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py index b05a6fd36ff3..131b5969aa63 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_certificates_patch.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedCertificates_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedCertificates_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py index f0059c7b40bb..37d1d55b79ed 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentDiagnostics_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentDiagnostics_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py index 05db0567889d..4175370c499c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_diagnostics_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentDiagnostics_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentDiagnostics_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_create_or_update.py deleted file mode 100644 index ac50de426bf2..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_create_or_update.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environment_private_endpoint_connections_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.managed_environment_private_endpoint_connections.begin_create_or_update( - resource_group_name="examplerg", - environment_name="managedEnv", - private_endpoint_connection_name="jlaw-demo1", - private_endpoint_connection_envelope={ - "properties": {"privateLinkServiceConnectionState": {"actionsRequired": "None", "status": "Approved"}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_delete.py deleted file mode 100644 index 4cda07073ec4..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environment_private_endpoint_connections_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - client.managed_environment_private_endpoint_connections.begin_delete( - resource_group_name="examplerg", - environment_name="managedEnv", - private_endpoint_connection_name="jlaw-demo1", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_get.py deleted file mode 100644 index f294ecfe6ebc..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environment_private_endpoint_connections_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.managed_environment_private_endpoint_connections.get( - resource_group_name="examplerg", - environment_name="managedEnv", - private_endpoint_connection_name="jlaw-demo1", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_list.py deleted file mode 100644 index f324695db3db..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_endpoint_connections_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environment_private_endpoint_connections_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.managed_environment_private_endpoint_connections.list( - resource_group_name="examplerg", - environment_name="managedEnv", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateEndpointConnections_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_link_resources_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_link_resources_list.py deleted file mode 100644 index 771e0aa19b54..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_private_link_resources_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environment_private_link_resources_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.managed_environment_private_link_resources.list( - resource_group_name="examplerg", - environment_name="managedEnv", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentPrivateLinkResources_List.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_usages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_usages_list.py index aa809adeb2e3..0016c3e63401 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_usages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environment_usages_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentUsages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentUsages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py index 5fa930b36332..7c0b2e0263c9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_create_or_update.py @@ -34,46 +34,15 @@ def main(): resource_group_name="examplerg", environment_name="testcontainerenv", environment_envelope={ - "identity": { - "type": "SystemAssigned, UserAssigned", - "userAssignedIdentities": { - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {} - }, - }, "location": "East US", "properties": { - "appInsightsConfiguration": { - "connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/" - }, - "appLogsConfiguration": { - "logAnalyticsConfiguration": { - "customerId": "string", - "dynamicJsonColumns": True, - "sharedKey": "string", - } - }, + "appLogsConfiguration": {"logAnalyticsConfiguration": {"customerId": "string", "sharedKey": "string"}}, "customDomainConfiguration": { "certificatePassword": "1234", "certificateValue": "Y2VydA==", "dnsSuffix": "www.my-name.com", }, "daprAIConnectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://northcentralus-0.in.applicationinsights.azure.com/", - "openTelemetryConfiguration": { - "destinationsConfiguration": { - "dataDogConfiguration": {"key": "000000000000000000000000", "site": "string"}, - "otlpConfigurations": [ - { - "endpoint": "dashboard.k8s.region.azurecontainerapps.io:80", - "headers": [{"key": "api-key", "value": "xxxxxxxxxxx"}], - "insecure": True, - "name": "dashboard", - } - ], - }, - "logsConfiguration": {"destinations": ["appInsights"]}, - "metricsConfiguration": {"destinations": ["dataDog"], "includeKeda": True}, - "tracesConfiguration": {"destinations": ["appInsights"], "includeDapr": True}, - }, "peerAuthentication": {"mtls": {"enabled": True}}, "peerTrafficConfiguration": {"encryption": {"enabled": True}}, "vnetConfiguration": { @@ -81,7 +50,6 @@ def main(): }, "workloadProfiles": [ { - "enableFips": True, "maximumCount": 12, "minimumCount": 3, "name": "My-GP-01", @@ -108,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py index 8f8767d800dc..15a5bf1f7791 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_custom_infrastructure_resource_group_create.py @@ -49,7 +49,6 @@ def main(): }, "workloadProfiles": [ { - "enableFips": True, "maximumCount": 12, "minimumCount": 3, "name": "My-GP-01", @@ -76,6 +75,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_CustomInfrastructureResourceGroup_Create.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py index 835a60c6ba03..c2730b198849 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py index 7318e63a3949..766110c4579f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get.py @@ -9,7 +9,6 @@ from azure.identity import DefaultAzureCredential from azure.mgmt.appcontainers import ContainerAppsAPIClient - """ # PREREQUISITES pip install azure-identity @@ -22,8 +21,6 @@ AZURE_CLIENT_SECRET. For more info about how to get the value, please see: https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal """ - - def main(): client = ContainerAppsAPIClient( credential=DefaultAzureCredential(), @@ -31,12 +28,13 @@ def main(): ) response = client.managed_environments.get( - resource_group_name="examplerg", - environment_name="jlaw-demo1", + resource_group_name='examplerg', + environment_name='jlaw-demo1', ) print(response) - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Get.json if __name__ == "__main__": main() +n__": + main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py index d62bf60ab031..47ff3ea362e3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_get_auth_token.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_GetAuthToken.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_GetAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py index f6b0a88941b7..0bc799224b04 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_ListByResourceGroup.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py index fa26dbe7803e..6a07ac8369b1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_ListBySubscription.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py index 61c26bbbff07..cb54352bc5f9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_list_workload_profile_states.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_ListWorkloadProfileStates.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_ListWorkloadProfileStates.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py index a42e432b9031..772f6f38a293 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_patch.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironments_Patch.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironments_Patch.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py index a3d5b15e6e3a..64f7d2adf80f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update_nfs_azure_file.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update_nfs_azure_file.py deleted file mode 100644 index 87655ae18c0e..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_create_or_update_nfs_azure_file.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environments_storages_create_or_update_nfs_azure_file.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.managed_environments_storages.create_or_update( - resource_group_name="examplerg", - environment_name="managedEnv", - storage_name="jlaw-demo1", - storage_envelope={ - "properties": {"nfsAzureFile": {"accessMode": "ReadOnly", "server": "server1", "shareName": "share1"}} - }, - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate_NfsAzureFile.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py index e8d45d34bc46..3b5327d95b57 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py index 1506b49d9b30..74e3995c96c9 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get_nfs_azure_file.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get_nfs_azure_file.py deleted file mode 100644 index a69c23be4467..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_get_nfs_azure_file.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python managed_environments_storages_get_nfs_azure_file.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="8efdecc5-919e-44eb-b179-915dca89ebf9", - ) - - response = client.managed_environments_storages.get( - resource_group_name="examplerg", - environment_name="managedEnv", - storage_name="jlaw-demo1", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_Get_NfsAzureFile.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py index e27605853999..6ee483edda79 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/managed_environments_storages_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/ManagedEnvironmentsStorages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/ManagedEnvironmentsStorages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py index d945168ac5c0..9da550318741 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Operations_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Operations_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py index 4d55341354b1..4d45a399094d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Replicas_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Replicas_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py index 1620ba85d3de..07bd69f7497a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/replicas_list.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Replicas_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Replicas_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py index c1fc63f741ea..ce059b20cd09 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_activate.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Activate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Activate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py index 50cdbdd917af..1271902d47fe 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_deactivate.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Deactivate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Deactivate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py index 0cb1046f492b..4bc48fb920ad 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py index fc17ef5677bc..95850c56385a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py index 018d3b7f8917..7373cf52aa20 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/revisions_restart.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Revisions_Restart.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Revisions_Restart.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_create_or_update.py deleted file mode 100644 index a9466d929675..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_create_or_update.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python session_pools_create_or_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.container_apps_session_pools.begin_create_or_update( - resource_group_name="rg", - session_pool_name="testsessionpool", - session_pool_envelope={ - "location": "East US", - "properties": { - "containerType": "CustomContainer", - "customContainerTemplate": { - "containers": [ - { - "args": ["-c", "while true; do echo hello; sleep 10;done"], - "command": ["/bin/sh"], - "image": "repo/testcontainer:v4", - "name": "testinitcontainer", - "resources": {"cpu": 0.25, "memory": "0.5Gi"}, - } - ], - "ingress": {"targetPort": 80}, - }, - "dynamicPoolConfiguration": {"cooldownPeriodInSeconds": 600, "executionType": "Timed"}, - "environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", - "poolManagementType": "Dynamic", - "scaleConfiguration": {"maxConcurrentSessions": 500, "readySessionInstances": 100}, - "sessionNetworkConfiguration": {"status": "EgressEnabled"}, - }, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_CreateOrUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_delete.py deleted file mode 100644 index 87437162a7c2..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python session_pools_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - client.container_apps_session_pools.begin_delete( - resource_group_name="rg", - session_pool_name="testsessionpool", - ).result() - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Delete.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_get.py deleted file mode 100644 index 2c8cced5037b..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python session_pools_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.container_apps_session_pools.get( - resource_group_name="rg", - session_pool_name="testsessionpool", - ) - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Get.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_resource_group.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_resource_group.py deleted file mode 100644 index ecc34901eb6e..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_resource_group.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python session_pools_list_by_resource_group.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.container_apps_session_pools.list_by_resource_group( - resource_group_name="rg", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_ListByResourceGroup.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_subscription.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_subscription.py deleted file mode 100644 index 5a621a6ca5bb..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_list_by_subscription.py +++ /dev/null @@ -1,40 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python session_pools_list_by_subscription.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.container_apps_session_pools.list_by_subscription() - for item in response: - print(item) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_ListBySubscription.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_patch.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_patch.py deleted file mode 100644 index ec4fb6a3bff4..000000000000 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/session_pools_patch.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.appcontainers import ContainerAppsAPIClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-appcontainers -# USAGE - python session_pools_patch.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = ContainerAppsAPIClient( - credential=DefaultAzureCredential(), - subscription_id="34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", - ) - - response = client.container_apps_session_pools.begin_update( - resource_group_name="rg", - session_pool_name="testsessionpool", - session_pool_envelope={ - "properties": { - "customContainerTemplate": { - "containers": [ - { - "args": ["-c", "while true; do echo hello; sleep 10;done"], - "command": ["/bin/sh"], - "image": "repo/testcontainer:v4", - "name": "testinitcontainer", - "resources": {"cpu": 0.25, "memory": "0.5Gi"}, - } - ], - "ingress": {"targetPort": 80}, - }, - "dynamicPoolConfiguration": {"cooldownPeriodInSeconds": 600, "executionType": "Timed"}, - "scaleConfiguration": {"maxConcurrentSessions": 500, "readySessionInstances": 100}, - "sessionNetworkConfiguration": {"status": "EgressEnabled"}, - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SessionPools_Patch.json -if __name__ == "__main__": - main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py index 546e8c7f7c50..4e36f63339f7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_create_or_update.py @@ -44,9 +44,7 @@ def main(): "kind": "feaderated", "tenantId": "", }, - "buildEnvironmentVariables": [{"name": "foo1", "value": "bar1"}, {"name": "foo2", "value": "bar2"}], "contextPath": "./", - "dockerfilePath": "./Dockerfile", "githubPersonalAccessToken": "test", "image": "image/tag", "registryInfo": { @@ -62,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_CreateOrUpdate.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py index 190c5f835db5..5644a664be66 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_Delete.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_Delete.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py index fe678c5d8efb..f60ae4f0994a 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_Get.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_Get.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py index 858543e28e02..bf652250e9c8 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/source_controls_list_by_container.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/SourceControls_ListByContainer.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/SourceControls_ListByContainer.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/subscriptions_get_custom_domain_verification_id.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/subscriptions_get_custom_domain_verification_id.py index 16e4146f2b8a..1ae469b8a678 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/subscriptions_get_custom_domain_verification_id.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/subscriptions_get_custom_domain_verification_id.py @@ -34,6 +34,6 @@ def main(): print(response) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Subscriptions_GetCustomDomainVerificationId.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Subscriptions_GetCustomDomainVerificationId.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py index 62f7320f33b0..4c263a58cb52 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_samples/usages_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2024-08-02-preview/examples/Usages_List.json +# x-ms-original-file: specification/app/resource-manager/Microsoft.App/stable/2025-01-01/examples/Usages_List.json if __name__ == "__main__": main() diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/conftest.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/conftest.py index 961ce7cf468a..d6403655d30d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/conftest.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/conftest.py @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): containerappsapi_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api.py index 94215044ea12..33b1fd8d5efa 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api.py @@ -25,7 +25,7 @@ def test_job_execution(self, resource_group): resource_group_name=resource_group.name, job_name="str", job_execution_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -35,7 +35,7 @@ def test_job_execution(self, resource_group): @recorded_by_proxy def test_get_custom_domain_verification_id(self, resource_group): response = self.client.get_custom_domain_verification_id( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_async.py index ef584fad5d2d..684dbf7e46bb 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_async.py @@ -26,7 +26,7 @@ async def test_job_execution(self, resource_group): resource_group_name=resource_group.name, job_name="str", job_execution_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -36,7 +36,7 @@ async def test_job_execution(self, resource_group): @recorded_by_proxy_async async def test_get_custom_domain_verification_id(self, resource_group): response = await self.client.get_custom_domain_verification_id( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations.py index 8eae410d0d89..e479bffcac29 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_available_workload_profiles_get(self, resource_group): response = self.client.available_workload_profiles.get( location="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations_async.py index f1c9e48ffecb..49bfee6f61ff 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_available_workload_profiles_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_available_workload_profiles_get(self, resource_group): response = self.client.available_workload_profiles.get( location="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations.py index 275a3238118c..284ffaa8aa23 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_billing_meters_get(self, resource_group): response = self.client.billing_meters.get( location="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations_async.py index f0b99ca05854..d4dc3d9cb717 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_billing_meters_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_billing_meters_get(self, resource_group): response = await self.client.billing_meters.get( location="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations.py index bb71a5ae354f..ce65f9bef662 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_certificates_list(self, resource_group): response = self.client.certificates.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_certificates_get(self, resource_group): response = self.client.certificates.get( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_certificates_create_or_update(self, resource_group): response = self.client.certificates.create_or_update( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,12 +58,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_certificates_delete(self, resource_group): response = self.client.certificates.delete( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,13 +71,13 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_certificates_update(self, resource_group): response = self.client.certificates.update( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations_async.py index fa7528f15ff7..b5ffb708fa3c 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_certificates_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_certificates_list(self, resource_group): response = self.client.certificates.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_certificates_get(self, resource_group): response = await self.client.certificates.get( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,12 +46,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_certificates_create_or_update(self, resource_group): response = await self.client.certificates.create_or_update( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,12 +59,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_certificates_delete(self, resource_group): response = await self.client.certificates.delete( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -72,13 +72,13 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_certificates_update(self, resource_group): response = await self.client.certificates.update( resource_group_name=resource_group.name, environment_name="str", certificate_name="str", certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations.py index 90e7557395ce..00082d23d9bc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_connected_environments_certificates_list(self, resource_group): response = self.client.connected_environments_certificates.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_connected_environments_certificates_get(self, resource_group): response = self.client.connected_environments_certificates.get( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_connected_environments_certificates_create_or_update(self, resource_group): response = self.client.connected_environments_certificates.create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,12 +58,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_connected_environments_certificates_delete(self, resource_group): response = self.client.connected_environments_certificates.delete( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,13 +71,13 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_connected_environments_certificates_update(self, resource_group): response = self.client.connected_environments_certificates.update( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations_async.py index 1aecd0cca672..4bee350c4a7d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_certificates_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_connected_environments_certificates_list(self, resource_group): response = self.client.connected_environments_certificates.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_connected_environments_certificates_get(self, resource_group): response = await self.client.connected_environments_certificates.get( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,12 +46,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_connected_environments_certificates_create_or_update(self, resource_group): response = await self.client.connected_environments_certificates.create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,12 +59,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_connected_environments_certificates_delete(self, resource_group): response = await self.client.connected_environments_certificates.delete( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -72,13 +72,13 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_connected_environments_certificates_update(self, resource_group): response = await self.client.connected_environments_certificates.update( resource_group_name=resource_group.name, connected_environment_name="str", certificate_name="str", certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations.py index d8e59805808a..81aa0ba3d21d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_connected_environments_dapr_components_list(self, resource_group): response = self.client.connected_environments_dapr_components.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_connected_environments_dapr_components_get(self, resource_group): response = self.client.connected_environments_dapr_components.get( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_connected_environments_dapr_components_create_or_update(self, resource_group): response = self.client.connected_environments_dapr_components.create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", @@ -60,9 +60,6 @@ def test_create_or_update(self, resource_group): "scopes": ["str"], "secretStoreComponent": "str", "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], - "serviceComponentBind": [ - {"metadata": {"name": "str", "value": "str"}, "name": "str", "serviceId": "str"} - ], "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -74,7 +71,7 @@ def test_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -82,12 +79,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_connected_environments_dapr_components_delete(self, resource_group): response = self.client.connected_environments_dapr_components.delete( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -95,12 +92,12 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secrets(self, resource_group): + def test_connected_environments_dapr_components_list_secrets(self, resource_group): response = self.client.connected_environments_dapr_components.list_secrets( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations_async.py index 1c70aa13e458..a8358e671894 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_dapr_components_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_connected_environments_dapr_components_list(self, resource_group): response = self.client.connected_environments_dapr_components.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_connected_environments_dapr_components_get(self, resource_group): response = await self.client.connected_environments_dapr_components.get( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_connected_environments_dapr_components_create_or_update(self, resource_group): response = await self.client.connected_environments_dapr_components.create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", @@ -61,9 +61,6 @@ async def test_create_or_update(self, resource_group): "scopes": ["str"], "secretStoreComponent": "str", "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], - "serviceComponentBind": [ - {"metadata": {"name": "str", "value": "str"}, "name": "str", "serviceId": "str"} - ], "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -75,7 +72,7 @@ async def test_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -83,12 +80,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_connected_environments_dapr_components_delete(self, resource_group): response = await self.client.connected_environments_dapr_components.delete( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -96,12 +93,12 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secrets(self, resource_group): + async def test_connected_environments_dapr_components_list_secrets(self, resource_group): response = await self.client.connected_environments_dapr_components.list_secrets( resource_group_name=resource_group.name, connected_environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations.py index d8d65eaeb645..6050da73c0e1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_connected_environments_list_by_subscription(self, resource_group): response = self.client.connected_environments.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_connected_environments_list_by_resource_group(self, resource_group): response = self.client.connected_environments.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_connected_environments_get(self, resource_group): response = self.client.connected_environments.get( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,14 +53,13 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_connected_environments_begin_create_or_update(self, resource_group): response = self.client.connected_environments.begin_create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", environment_envelope={ "location": "str", "customDomainConfiguration": { - "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", "certificateValue": bytes("bytes", encoding="utf-8"), "customDomainVerificationId": "str", @@ -88,7 +87,7 @@ def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -96,11 +95,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_connected_environments_begin_delete(self, resource_group): response = self.client.connected_environments.begin_delete( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -108,11 +107,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_connected_environments_update(self, resource_group): response = self.client.connected_environments.update( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -120,12 +119,12 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_check_name_availability(self, resource_group): + def test_connected_environments_check_name_availability(self, resource_group): response = self.client.connected_environments.check_name_availability( resource_group_name=resource_group.name, connected_environment_name="str", check_name_availability_request={"name": "str", "type": "str"}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations_async.py index 20b583aecca8..c865e3760fb3 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_connected_environments_list_by_subscription(self, resource_group): response = self.client.connected_environments.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_connected_environments_list_by_resource_group(self, resource_group): response = self.client.connected_environments.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_connected_environments_get(self, resource_group): response = await self.client.connected_environments.get( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_connected_environments_begin_create_or_update(self, resource_group): response = await ( await self.client.connected_environments.begin_create_or_update( resource_group_name=resource_group.name, @@ -62,7 +62,6 @@ async def test_begin_create_or_update(self, resource_group): environment_envelope={ "location": "str", "customDomainConfiguration": { - "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", "certificateValue": bytes("bytes", encoding="utf-8"), "customDomainVerificationId": "str", @@ -90,7 +89,7 @@ async def test_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -99,12 +98,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_connected_environments_begin_delete(self, resource_group): response = await ( await self.client.connected_environments.begin_delete( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -113,11 +112,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_connected_environments_update(self, resource_group): response = await self.client.connected_environments.update( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -125,12 +124,12 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_check_name_availability(self, resource_group): + async def test_connected_environments_check_name_availability(self, resource_group): response = await self.client.connected_environments.check_name_availability( resource_group_name=resource_group.name, connected_environment_name="str", check_name_availability_request={"name": "str", "type": "str"}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations.py index 9d23204d77e3..c07dcd24210f 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_connected_environments_storages_list(self, resource_group): response = self.client.connected_environments_storages.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_connected_environments_storages_get(self, resource_group): response = self.client.connected_environments_storages.get( resource_group_name=resource_group.name, connected_environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_connected_environments_storages_create_or_update(self, resource_group): response = self.client.connected_environments_storages.create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", @@ -54,15 +54,7 @@ def test_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"}, - "smb": { - "accessMode": "str", - "domain": "str", - "host": "str", - "password": "str", - "shareName": "str", - "username": "str", - }, + "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"} }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -74,7 +66,7 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -82,12 +74,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_connected_environments_storages_delete(self, resource_group): response = self.client.connected_environments_storages.delete( resource_group_name=resource_group.name, connected_environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations_async.py index 2f61ad4ecc5a..6f7bc4287813 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_connected_environments_storages_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_connected_environments_storages_list(self, resource_group): response = await self.client.connected_environments_storages.list( resource_group_name=resource_group.name, connected_environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_connected_environments_storages_get(self, resource_group): response = await self.client.connected_environments_storages.get( resource_group_name=resource_group.name, connected_environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_connected_environments_storages_create_or_update(self, resource_group): response = await self.client.connected_environments_storages.create_or_update( resource_group_name=resource_group.name, connected_environment_name="str", @@ -55,15 +55,7 @@ async def test_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"}, - "smb": { - "accessMode": "str", - "domain": "str", - "host": "str", - "password": "str", - "shareName": "str", - "username": "str", - }, + "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"} }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -75,7 +67,7 @@ async def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -83,12 +75,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_connected_environments_storages_delete(self, resource_group): response = await self.client.connected_environments_storages.delete( resource_group_name=resource_group.name, connected_environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations.py index a05430f40e0d..8a4f17359cd6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_container_app(self, resource_group): + def test_container_apps_auth_configs_list_by_container_app(self, resource_group): response = self.client.container_apps_auth_configs.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_auth_configs_get(self, resource_group): response = self.client.container_apps_auth_configs.get( resource_group_name=resource_group.name, container_app_name="str", auth_config_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_container_apps_auth_configs_create_or_update(self, resource_group): response = self.client.container_apps_auth_configs.create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -161,7 +161,7 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -169,12 +169,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_container_apps_auth_configs_delete(self, resource_group): response = self.client.container_apps_auth_configs.delete( resource_group_name=resource_group.name, container_app_name="str", auth_config_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations_async.py index a5de3d34523f..d0f6ded65abc 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_auth_configs_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_container_app(self, resource_group): + async def test_container_apps_auth_configs_list_by_container_app(self, resource_group): response = self.client.container_apps_auth_configs.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_auth_configs_get(self, resource_group): response = await self.client.container_apps_auth_configs.get( resource_group_name=resource_group.name, container_app_name="str", auth_config_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_container_apps_auth_configs_create_or_update(self, resource_group): response = await self.client.container_apps_auth_configs.create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -162,7 +162,7 @@ async def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -170,12 +170,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_container_apps_auth_configs_delete(self, resource_group): response = await self.client.container_apps_auth_configs.delete( resource_group_name=resource_group.name, container_app_name="str", auth_config_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations.py index 6feb281ecca7..886a834da688 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_detectors(self, resource_group): + def test_container_apps_diagnostics_list_detectors(self, resource_group): response = self.client.container_apps_diagnostics.list_detectors( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_detector(self, resource_group): + def test_container_apps_diagnostics_get_detector(self, resource_group): response = self.client.container_apps_diagnostics.get_detector( resource_group_name=resource_group.name, container_app_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,11 +45,11 @@ def test_get_detector(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_revisions(self, resource_group): + def test_container_apps_diagnostics_list_revisions(self, resource_group): response = self.client.container_apps_diagnostics.list_revisions( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -57,12 +57,12 @@ def test_list_revisions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_revision(self, resource_group): + def test_container_apps_diagnostics_get_revision(self, resource_group): response = self.client.container_apps_diagnostics.get_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -70,11 +70,11 @@ def test_get_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_root(self, resource_group): + def test_container_apps_diagnostics_get_root(self, resource_group): response = self.client.container_apps_diagnostics.get_root( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations_async.py index 31469c25d996..53446dc8a3b4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_diagnostics_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_detectors(self, resource_group): + async def test_container_apps_diagnostics_list_detectors(self, resource_group): response = self.client.container_apps_diagnostics.list_detectors( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_detector(self, resource_group): + async def test_container_apps_diagnostics_get_detector(self, resource_group): response = await self.client.container_apps_diagnostics.get_detector( resource_group_name=resource_group.name, container_app_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,11 +46,11 @@ async def test_get_detector(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_revisions(self, resource_group): + async def test_container_apps_diagnostics_list_revisions(self, resource_group): response = self.client.container_apps_diagnostics.list_revisions( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -58,12 +58,12 @@ async def test_list_revisions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_revision(self, resource_group): + async def test_container_apps_diagnostics_get_revision(self, resource_group): response = await self.client.container_apps_diagnostics.get_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,11 +71,11 @@ async def test_get_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_root(self, resource_group): + async def test_container_apps_diagnostics_get_root(self, resource_group): response = await self.client.container_apps_diagnostics.get_root( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations.py index 990c849a6efc..4b10ee7e8222 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_container_apps_list_by_subscription(self, resource_group): response = self.client.container_apps.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_container_apps_list_by_resource_group(self, resource_group): response = self.client.container_apps.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_get(self, resource_group): response = self.client.container_apps.get( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_container_apps_begin_create_or_update(self, resource_group): response = self.client.container_apps.begin_create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -71,7 +71,6 @@ def test_begin_create_or_update(self, resource_group): "httpReadBufferSize": 0, "logLevel": "str", }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], "ingress": { "additionalPortMappings": [{"external": bool, "targetPort": 0, "exposedPort": 0}], "allowInsecure": False, @@ -93,27 +92,15 @@ def test_begin_create_or_update(self, resource_group): ], "stickySessions": {"affinity": "str"}, "targetPort": 0, - "targetPortHttpScheme": "str", "traffic": [{"label": "str", "latestRevision": False, "revisionName": "str", "weight": 0}], "transport": "auto", }, "maxInactiveRevisions": 0, "registries": [{"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"}], - "runtime": { - "dotnet": {"autoConfigureDataProtection": bool}, - "java": { - "enableMetrics": bool, - "javaAgent": { - "enabled": bool, - "logging": {"loggerSettings": [{"level": "str", "logger": "str"}]}, - }, - }, - }, "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], "service": {"type": "str"}, }, "customDomainVerificationId": "str", - "deploymentErrors": "str", "environmentId": "str", "eventStreamEndpoint": "str", "extendedLocation": {"name": "str", "type": "str"}, @@ -124,7 +111,6 @@ def test_begin_create_or_update(self, resource_group): "tenantId": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - "kind": "str", "latestReadyRevisionName": "str", "latestRevisionFqdn": "str", "latestRevisionName": "str", @@ -132,7 +118,6 @@ def test_begin_create_or_update(self, resource_group): "managedEnvironmentId": "str", "name": "str", "outboundIpAddresses": ["str"], - "patchingConfiguration": {"patchingMode": "str"}, "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -150,7 +135,6 @@ def test_begin_create_or_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "probes": [ { @@ -181,7 +165,6 @@ def test_begin_create_or_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], @@ -222,9 +205,7 @@ def test_begin_create_or_update(self, resource_group): } ], }, - "serviceBinds": [ - {"clientType": "str", "customizedKeys": {"str": "str"}, "name": "str", "serviceId": "str"} - ], + "serviceBinds": [{"name": "str", "serviceId": "str"}], "terminationGracePeriodSeconds": 0, "volumes": [ { @@ -239,7 +220,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -247,11 +228,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_container_apps_begin_delete(self, resource_group): response = self.client.container_apps.begin_delete( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -259,7 +240,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_container_apps_begin_update(self, resource_group): response = self.client.container_apps.begin_update( resource_group_name=resource_group.name, container_app_name="str", @@ -277,7 +258,6 @@ def test_begin_update(self, resource_group): "httpReadBufferSize": 0, "logLevel": "str", }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], "ingress": { "additionalPortMappings": [{"external": bool, "targetPort": 0, "exposedPort": 0}], "allowInsecure": False, @@ -299,27 +279,15 @@ def test_begin_update(self, resource_group): ], "stickySessions": {"affinity": "str"}, "targetPort": 0, - "targetPortHttpScheme": "str", "traffic": [{"label": "str", "latestRevision": False, "revisionName": "str", "weight": 0}], "transport": "auto", }, "maxInactiveRevisions": 0, "registries": [{"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"}], - "runtime": { - "dotnet": {"autoConfigureDataProtection": bool}, - "java": { - "enableMetrics": bool, - "javaAgent": { - "enabled": bool, - "logging": {"loggerSettings": [{"level": "str", "logger": "str"}]}, - }, - }, - }, "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], "service": {"type": "str"}, }, "customDomainVerificationId": "str", - "deploymentErrors": "str", "environmentId": "str", "eventStreamEndpoint": "str", "extendedLocation": {"name": "str", "type": "str"}, @@ -330,7 +298,6 @@ def test_begin_update(self, resource_group): "tenantId": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - "kind": "str", "latestReadyRevisionName": "str", "latestRevisionFqdn": "str", "latestRevisionName": "str", @@ -338,7 +305,6 @@ def test_begin_update(self, resource_group): "managedEnvironmentId": "str", "name": "str", "outboundIpAddresses": ["str"], - "patchingConfiguration": {"patchingMode": "str"}, "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -356,7 +322,6 @@ def test_begin_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "probes": [ { @@ -387,7 +352,6 @@ def test_begin_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], @@ -428,9 +392,7 @@ def test_begin_update(self, resource_group): } ], }, - "serviceBinds": [ - {"clientType": "str", "customizedKeys": {"str": "str"}, "name": "str", "serviceId": "str"} - ], + "serviceBinds": [{"name": "str", "serviceId": "str"}], "terminationGracePeriodSeconds": 0, "volumes": [ { @@ -445,7 +407,7 @@ def test_begin_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -453,11 +415,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_custom_host_name_analysis(self, resource_group): + def test_container_apps_list_custom_host_name_analysis(self, resource_group): response = self.client.container_apps.list_custom_host_name_analysis( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -465,11 +427,11 @@ def test_list_custom_host_name_analysis(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secrets(self, resource_group): + def test_container_apps_list_secrets(self, resource_group): response = self.client.container_apps.list_secrets( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -477,11 +439,11 @@ def test_list_secrets(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_auth_token(self, resource_group): + def test_container_apps_get_auth_token(self, resource_group): response = self.client.container_apps.get_auth_token( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -489,11 +451,11 @@ def test_get_auth_token(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_start(self, resource_group): + def test_container_apps_begin_start(self, resource_group): response = self.client.container_apps.begin_start( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -501,11 +463,11 @@ def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_stop(self, resource_group): + def test_container_apps_begin_stop(self, resource_group): response = self.client.container_apps.begin_stop( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations_async.py index 79bf6b517286..85780d1821c0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_container_apps_list_by_subscription(self, resource_group): response = self.client.container_apps.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_container_apps_list_by_resource_group(self, resource_group): response = self.client.container_apps.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_get(self, resource_group): response = await self.client.container_apps.get( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_container_apps_begin_create_or_update(self, resource_group): response = await ( await self.client.container_apps.begin_create_or_update( resource_group_name=resource_group.name, @@ -73,7 +73,6 @@ async def test_begin_create_or_update(self, resource_group): "httpReadBufferSize": 0, "logLevel": "str", }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], "ingress": { "additionalPortMappings": [{"external": bool, "targetPort": 0, "exposedPort": 0}], "allowInsecure": False, @@ -95,7 +94,6 @@ async def test_begin_create_or_update(self, resource_group): ], "stickySessions": {"affinity": "str"}, "targetPort": 0, - "targetPortHttpScheme": "str", "traffic": [{"label": "str", "latestRevision": False, "revisionName": "str", "weight": 0}], "transport": "auto", }, @@ -103,21 +101,10 @@ async def test_begin_create_or_update(self, resource_group): "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} ], - "runtime": { - "dotnet": {"autoConfigureDataProtection": bool}, - "java": { - "enableMetrics": bool, - "javaAgent": { - "enabled": bool, - "logging": {"loggerSettings": [{"level": "str", "logger": "str"}]}, - }, - }, - }, "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], "service": {"type": "str"}, }, "customDomainVerificationId": "str", - "deploymentErrors": "str", "environmentId": "str", "eventStreamEndpoint": "str", "extendedLocation": {"name": "str", "type": "str"}, @@ -128,7 +115,6 @@ async def test_begin_create_or_update(self, resource_group): "tenantId": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - "kind": "str", "latestReadyRevisionName": "str", "latestRevisionFqdn": "str", "latestRevisionName": "str", @@ -136,7 +122,6 @@ async def test_begin_create_or_update(self, resource_group): "managedEnvironmentId": "str", "name": "str", "outboundIpAddresses": ["str"], - "patchingConfiguration": {"patchingMode": "str"}, "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -154,7 +139,6 @@ async def test_begin_create_or_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "probes": [ { @@ -185,7 +169,6 @@ async def test_begin_create_or_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], @@ -226,9 +209,7 @@ async def test_begin_create_or_update(self, resource_group): } ], }, - "serviceBinds": [ - {"clientType": "str", "customizedKeys": {"str": "str"}, "name": "str", "serviceId": "str"} - ], + "serviceBinds": [{"name": "str", "serviceId": "str"}], "terminationGracePeriodSeconds": 0, "volumes": [ { @@ -243,7 +224,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -252,12 +233,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_container_apps_begin_delete(self, resource_group): response = await ( await self.client.container_apps.begin_delete( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -266,7 +247,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_container_apps_begin_update(self, resource_group): response = await ( await self.client.container_apps.begin_update( resource_group_name=resource_group.name, @@ -285,7 +266,6 @@ async def test_begin_update(self, resource_group): "httpReadBufferSize": 0, "logLevel": "str", }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], "ingress": { "additionalPortMappings": [{"external": bool, "targetPort": 0, "exposedPort": 0}], "allowInsecure": False, @@ -307,7 +287,6 @@ async def test_begin_update(self, resource_group): ], "stickySessions": {"affinity": "str"}, "targetPort": 0, - "targetPortHttpScheme": "str", "traffic": [{"label": "str", "latestRevision": False, "revisionName": "str", "weight": 0}], "transport": "auto", }, @@ -315,21 +294,10 @@ async def test_begin_update(self, resource_group): "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} ], - "runtime": { - "dotnet": {"autoConfigureDataProtection": bool}, - "java": { - "enableMetrics": bool, - "javaAgent": { - "enabled": bool, - "logging": {"loggerSettings": [{"level": "str", "logger": "str"}]}, - }, - }, - }, "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], "service": {"type": "str"}, }, "customDomainVerificationId": "str", - "deploymentErrors": "str", "environmentId": "str", "eventStreamEndpoint": "str", "extendedLocation": {"name": "str", "type": "str"}, @@ -340,7 +308,6 @@ async def test_begin_update(self, resource_group): "tenantId": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - "kind": "str", "latestReadyRevisionName": "str", "latestRevisionFqdn": "str", "latestRevisionName": "str", @@ -348,7 +315,6 @@ async def test_begin_update(self, resource_group): "managedEnvironmentId": "str", "name": "str", "outboundIpAddresses": ["str"], - "patchingConfiguration": {"patchingMode": "str"}, "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -366,7 +332,6 @@ async def test_begin_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "probes": [ { @@ -397,7 +362,6 @@ async def test_begin_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], @@ -438,9 +402,7 @@ async def test_begin_update(self, resource_group): } ], }, - "serviceBinds": [ - {"clientType": "str", "customizedKeys": {"str": "str"}, "name": "str", "serviceId": "str"} - ], + "serviceBinds": [{"name": "str", "serviceId": "str"}], "terminationGracePeriodSeconds": 0, "volumes": [ { @@ -455,7 +417,7 @@ async def test_begin_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -464,11 +426,11 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_custom_host_name_analysis(self, resource_group): + async def test_container_apps_list_custom_host_name_analysis(self, resource_group): response = await self.client.container_apps.list_custom_host_name_analysis( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -476,11 +438,11 @@ async def test_list_custom_host_name_analysis(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secrets(self, resource_group): + async def test_container_apps_list_secrets(self, resource_group): response = await self.client.container_apps.list_secrets( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -488,11 +450,11 @@ async def test_list_secrets(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_auth_token(self, resource_group): + async def test_container_apps_get_auth_token(self, resource_group): response = await self.client.container_apps.get_auth_token( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -500,12 +462,12 @@ async def test_get_auth_token(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_start(self, resource_group): + async def test_container_apps_begin_start(self, resource_group): response = await ( await self.client.container_apps.begin_start( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -514,12 +476,12 @@ async def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_stop(self, resource_group): + async def test_container_apps_begin_stop(self, resource_group): response = await ( await self.client.container_apps.begin_stop( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations.py index 2a146342491d..c38504879473 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations.py @@ -20,13 +20,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_replica(self, resource_group): + def test_container_apps_revision_replicas_get_replica(self, resource_group): response = self.client.container_apps_revision_replicas.get_replica( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", replica_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -34,12 +34,12 @@ def test_get_replica(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_replicas(self, resource_group): + def test_container_apps_revision_replicas_list_replicas(self, resource_group): response = self.client.container_apps_revision_replicas.list_replicas( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations_async.py index 2057852c3796..d23b27efd061 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revision_replicas_operations_async.py @@ -21,13 +21,13 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_replica(self, resource_group): + async def test_container_apps_revision_replicas_get_replica(self, resource_group): response = await self.client.container_apps_revision_replicas.get_replica( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", replica_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -35,12 +35,12 @@ async def test_get_replica(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_replicas(self, resource_group): + async def test_container_apps_revision_replicas_list_replicas(self, resource_group): response = await self.client.container_apps_revision_replicas.list_replicas( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations.py index 94d92dbc0bfb..a9f5286a688e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_revisions(self, resource_group): + def test_container_apps_revisions_list_revisions(self, resource_group): response = self.client.container_apps_revisions.list_revisions( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_revisions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_revision(self, resource_group): + def test_container_apps_revisions_get_revision(self, resource_group): response = self.client.container_apps_revisions.get_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_get_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_activate_revision(self, resource_group): + def test_container_apps_revisions_activate_revision(self, resource_group): response = self.client.container_apps_revisions.activate_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,12 +58,12 @@ def test_activate_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_deactivate_revision(self, resource_group): + def test_container_apps_revisions_deactivate_revision(self, resource_group): response = self.client.container_apps_revisions.deactivate_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,12 +71,12 @@ def test_deactivate_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restart_revision(self, resource_group): + def test_container_apps_revisions_restart_revision(self, resource_group): response = self.client.container_apps_revisions.restart_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations_async.py index a1947378e9ec..61767f087626 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_revisions_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_revisions(self, resource_group): + async def test_container_apps_revisions_list_revisions(self, resource_group): response = self.client.container_apps_revisions.list_revisions( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_revisions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_revision(self, resource_group): + async def test_container_apps_revisions_get_revision(self, resource_group): response = await self.client.container_apps_revisions.get_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,12 +46,12 @@ async def test_get_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_activate_revision(self, resource_group): + async def test_container_apps_revisions_activate_revision(self, resource_group): response = await self.client.container_apps_revisions.activate_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,12 +59,12 @@ async def test_activate_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_deactivate_revision(self, resource_group): + async def test_container_apps_revisions_deactivate_revision(self, resource_group): response = await self.client.container_apps_revisions.deactivate_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -72,12 +72,12 @@ async def test_deactivate_revision(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restart_revision(self, resource_group): + async def test_container_apps_revisions_restart_revision(self, resource_group): response = await self.client.container_apps_revisions.restart_revision( resource_group_name=resource_group.name, container_app_name="str", revision_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations.py index d1c3378482b3..cbaadc2d8f06 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_container_app(self, resource_group): + def test_container_apps_source_controls_list_by_container_app(self, resource_group): response = self.client.container_apps_source_controls.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_container_apps_source_controls_get(self, resource_group): response = self.client.container_apps_source_controls.get( resource_group_name=resource_group.name, container_app_name="str", source_control_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_container_apps_source_controls_begin_create_or_update(self, resource_group): response = self.client.container_apps_source_controls.begin_create_or_update( resource_group_name=resource_group.name, container_app_name="str", @@ -60,9 +60,7 @@ def test_begin_create_or_update(self, resource_group): "subscriptionId": "str", "tenantId": "str", }, - "buildEnvironmentVariables": [{"name": "str", "value": "str"}], "contextPath": "str", - "dockerfilePath": "str", "githubPersonalAccessToken": "str", "image": "str", "os": "str", @@ -85,7 +83,7 @@ def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -93,12 +91,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_container_apps_source_controls_begin_delete(self, resource_group): response = self.client.container_apps_source_controls.begin_delete( resource_group_name=resource_group.name, container_app_name="str", source_control_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations_async.py index e7bdc90db6a5..c96811cbf602 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_container_apps_source_controls_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_container_app(self, resource_group): + async def test_container_apps_source_controls_list_by_container_app(self, resource_group): response = self.client.container_apps_source_controls.list_by_container_app( resource_group_name=resource_group.name, container_app_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_by_container_app(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_container_apps_source_controls_get(self, resource_group): response = await self.client.container_apps_source_controls.get( resource_group_name=resource_group.name, container_app_name="str", source_control_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_container_apps_source_controls_begin_create_or_update(self, resource_group): response = await ( await self.client.container_apps_source_controls.begin_create_or_update( resource_group_name=resource_group.name, @@ -62,9 +62,7 @@ async def test_begin_create_or_update(self, resource_group): "subscriptionId": "str", "tenantId": "str", }, - "buildEnvironmentVariables": [{"name": "str", "value": "str"}], "contextPath": "str", - "dockerfilePath": "str", "githubPersonalAccessToken": "str", "image": "str", "os": "str", @@ -87,7 +85,7 @@ async def test_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -96,13 +94,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_container_apps_source_controls_begin_delete(self, resource_group): response = await ( await self.client.container_apps_source_controls.begin_delete( resource_group_name=resource_group.name, container_app_name="str", source_control_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations.py index bbd3070f070f..67620925bfe1 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_dapr_components_list(self, resource_group): response = self.client.dapr_components.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_dapr_components_get(self, resource_group): response = self.client.dapr_components.get( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_dapr_components_create_or_update(self, resource_group): response = self.client.dapr_components.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -60,9 +60,6 @@ def test_create_or_update(self, resource_group): "scopes": ["str"], "secretStoreComponent": "str", "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], - "serviceComponentBind": [ - {"metadata": {"name": "str", "value": "str"}, "name": "str", "serviceId": "str"} - ], "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -74,7 +71,7 @@ def test_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -82,12 +79,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_dapr_components_delete(self, resource_group): response = self.client.dapr_components.delete( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -95,12 +92,12 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secrets(self, resource_group): + def test_dapr_components_list_secrets(self, resource_group): response = self.client.dapr_components.list_secrets( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations_async.py index 59f9d86584b9..39ad80091bbd 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_dapr_components_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_dapr_components_list(self, resource_group): response = self.client.dapr_components.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_dapr_components_get(self, resource_group): response = await self.client.dapr_components.get( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_dapr_components_create_or_update(self, resource_group): response = await self.client.dapr_components.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -61,9 +61,6 @@ async def test_create_or_update(self, resource_group): "scopes": ["str"], "secretStoreComponent": "str", "secrets": [{"identity": "str", "keyVaultUrl": "str", "name": "str", "value": "str"}], - "serviceComponentBind": [ - {"metadata": {"name": "str", "value": "str"}, "name": "str", "serviceId": "str"} - ], "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -75,7 +72,7 @@ async def test_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -83,12 +80,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_dapr_components_delete(self, resource_group): response = await self.client.dapr_components.delete( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -96,12 +93,12 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secrets(self, resource_group): + async def test_dapr_components_list_secrets(self, resource_group): response = await self.client.dapr_components.list_secrets( resource_group_name=resource_group.name, environment_name="str", component_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations.py index c2e31ca66ea3..b0a3bf9a74c0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_jobs_executions_list(self, resource_group): response = self.client.jobs_executions.list( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations_async.py index 3bc443073725..ac06b2710202 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_executions_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_jobs_executions_list(self, resource_group): response = self.client.jobs_executions.list( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations.py index 9f8d3be2d07f..e101dea6f02e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_detectors(self, resource_group): + def test_jobs_list_detectors(self, resource_group): response = self.client.jobs.list_detectors( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_detector(self, resource_group): + def test_jobs_get_detector(self, resource_group): response = self.client.jobs.get_detector( resource_group_name=resource_group.name, job_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ def test_get_detector(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_proxy_get(self, resource_group): + def test_jobs_proxy_get(self, resource_group): response = self.client.jobs.proxy_get( resource_group_name=resource_group.name, job_name="str", api_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,9 +58,9 @@ def test_proxy_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_jobs_list_by_subscription(self, resource_group): response = self.client.jobs.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -68,10 +68,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_jobs_list_by_resource_group(self, resource_group): response = self.client.jobs.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -79,11 +79,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_jobs_get(self, resource_group): response = self.client.jobs.get( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -91,7 +91,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_jobs_begin_create_or_update(self, resource_group): response = self.client.jobs.begin_create_or_update( resource_group_name=resource_group.name, job_name="str", @@ -118,7 +118,6 @@ def test_begin_create_or_update(self, resource_group): ], }, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], "manualTriggerConfig": {"parallelism": 0, "replicaCompletionCount": 0}, "registries": [{"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"}], "replicaRetryLimit": 0, @@ -127,7 +126,6 @@ def test_begin_create_or_update(self, resource_group): }, "environmentId": "str", "eventStreamEndpoint": "str", - "extendedLocation": {"name": "str", "type": "str"}, "id": "str", "identity": { "type": "str", @@ -138,7 +136,6 @@ def test_begin_create_or_update(self, resource_group): "name": "str", "outboundIpAddresses": ["str"], "provisioningState": "str", - "runningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -155,7 +152,6 @@ def test_begin_create_or_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "probes": [ { @@ -186,7 +182,6 @@ def test_begin_create_or_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], @@ -205,7 +200,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -213,11 +208,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_jobs_begin_delete(self, resource_group): response = self.client.jobs.begin_delete( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -225,12 +220,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_jobs_begin_update(self, resource_group): response = self.client.jobs.begin_update( resource_group_name=resource_group.name, job_name="str", job_envelope={ - "extendedLocation": {"name": "str", "type": "str"}, "identity": { "type": "str", "principalId": "str", @@ -259,7 +253,6 @@ def test_begin_update(self, resource_group): ], }, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], "manualTriggerConfig": {"parallelism": 0, "replicaCompletionCount": 0}, "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} @@ -282,7 +275,6 @@ def test_begin_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "probes": [ { @@ -313,7 +305,6 @@ def test_begin_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], @@ -332,7 +323,7 @@ def test_begin_update(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -340,11 +331,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_start(self, resource_group): + def test_jobs_begin_start(self, resource_group): response = self.client.jobs.begin_start( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -352,12 +343,12 @@ def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_stop_execution(self, resource_group): + def test_jobs_begin_stop_execution(self, resource_group): response = self.client.jobs.begin_stop_execution( resource_group_name=resource_group.name, job_name="str", job_execution_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -365,11 +356,11 @@ def test_begin_stop_execution(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_stop_multiple_executions(self, resource_group): + def test_jobs_begin_stop_multiple_executions(self, resource_group): response = self.client.jobs.begin_stop_multiple_executions( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -377,36 +368,12 @@ def test_begin_stop_multiple_executions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_secrets(self, resource_group): + def test_jobs_list_secrets(self, resource_group): response = self.client.jobs.list_secrets( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_resume(self, resource_group): - response = self.client.jobs.begin_resume( - resource_group_name=resource_group.name, - job_name="str", - api_version="2024-08-02-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_suspend(self, resource_group): - response = self.client.jobs.begin_suspend( - resource_group_name=resource_group.name, - job_name="str", - api_version="2024-08-02-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations_async.py index 09e16b1e7465..b95fdea3b0f7 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_jobs_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_detectors(self, resource_group): + async def test_jobs_list_detectors(self, resource_group): response = self.client.jobs.list_detectors( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_detector(self, resource_group): + async def test_jobs_get_detector(self, resource_group): response = await self.client.jobs.get_detector( resource_group_name=resource_group.name, job_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,12 +46,12 @@ async def test_get_detector(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_proxy_get(self, resource_group): + async def test_jobs_proxy_get(self, resource_group): response = await self.client.jobs.proxy_get( resource_group_name=resource_group.name, job_name="str", api_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,9 +59,9 @@ async def test_proxy_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_jobs_list_by_subscription(self, resource_group): response = self.client.jobs.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -69,10 +69,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_jobs_list_by_resource_group(self, resource_group): response = self.client.jobs.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -80,11 +80,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_jobs_get(self, resource_group): response = await self.client.jobs.get( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -92,7 +92,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_jobs_begin_create_or_update(self, resource_group): response = await ( await self.client.jobs.begin_create_or_update( resource_group_name=resource_group.name, @@ -120,7 +120,6 @@ async def test_begin_create_or_update(self, resource_group): ], }, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], "manualTriggerConfig": {"parallelism": 0, "replicaCompletionCount": 0}, "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} @@ -135,7 +134,6 @@ async def test_begin_create_or_update(self, resource_group): }, "environmentId": "str", "eventStreamEndpoint": "str", - "extendedLocation": {"name": "str", "type": "str"}, "id": "str", "identity": { "type": "str", @@ -146,7 +144,6 @@ async def test_begin_create_or_update(self, resource_group): "name": "str", "outboundIpAddresses": ["str"], "provisioningState": "str", - "runningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -163,7 +160,6 @@ async def test_begin_create_or_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "probes": [ { @@ -194,7 +190,6 @@ async def test_begin_create_or_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], @@ -213,7 +208,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", "workloadProfileName": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -222,12 +217,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_jobs_begin_delete(self, resource_group): response = await ( await self.client.jobs.begin_delete( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -236,13 +231,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_jobs_begin_update(self, resource_group): response = await ( await self.client.jobs.begin_update( resource_group_name=resource_group.name, job_name="str", job_envelope={ - "extendedLocation": {"name": "str", "type": "str"}, "identity": { "type": "str", "principalId": "str", @@ -271,7 +265,6 @@ async def test_begin_update(self, resource_group): ], }, }, - "identitySettings": [{"identity": "str", "lifecycle": "All"}], "manualTriggerConfig": {"parallelism": 0, "replicaCompletionCount": 0}, "registries": [ {"identity": "str", "passwordSecretRef": "str", "server": "str", "username": "str"} @@ -294,7 +287,6 @@ async def test_begin_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "probes": [ { @@ -325,7 +317,6 @@ async def test_begin_update(self, resource_group): "command": ["str"], "env": [{"name": "str", "secretRef": "str", "value": "str"}], "image": "str", - "imageType": "str", "name": "str", "resources": {"cpu": 0.0, "ephemeralStorage": "str", "memory": "str"}, "volumeMounts": [{"mountPath": "str", "subPath": "str", "volumeName": "str"}], @@ -344,7 +335,7 @@ async def test_begin_update(self, resource_group): }, "tags": {"str": "str"}, }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -353,12 +344,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_start(self, resource_group): + async def test_jobs_begin_start(self, resource_group): response = await ( await self.client.jobs.begin_start( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -367,13 +358,13 @@ async def test_begin_start(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_stop_execution(self, resource_group): + async def test_jobs_begin_stop_execution(self, resource_group): response = await ( await self.client.jobs.begin_stop_execution( resource_group_name=resource_group.name, job_name="str", job_execution_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -382,12 +373,12 @@ async def test_begin_stop_execution(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_stop_multiple_executions(self, resource_group): + async def test_jobs_begin_stop_multiple_executions(self, resource_group): response = await ( await self.client.jobs.begin_stop_multiple_executions( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -396,40 +387,12 @@ async def test_begin_stop_multiple_executions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_secrets(self, resource_group): + async def test_jobs_list_secrets(self, resource_group): response = await self.client.jobs.list_secrets( resource_group_name=resource_group.name, job_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_resume(self, resource_group): - response = await ( - await self.client.jobs.begin_resume( - resource_group_name=resource_group.name, - job_name="str", - api_version="2024-08-02-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_suspend(self, resource_group): - response = await ( - await self.client.jobs.begin_suspend( - resource_group_name=resource_group.name, - job_name="str", - api_version="2024-08-02-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations.py index 15cb79a15a31..838c10882e57 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_certificates_get(self, resource_group): response = self.client.managed_certificates.get( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_managed_certificates_begin_create_or_update(self, resource_group): response = self.client.managed_certificates.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -46,12 +46,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_managed_certificates_delete(self, resource_group): response = self.client.managed_certificates.delete( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,13 +59,13 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_managed_certificates_update(self, resource_group): response = self.client.managed_certificates.update( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", managed_certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -73,11 +73,11 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_certificates_list(self, resource_group): response = self.client.managed_certificates.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations_async.py index aa2880913e1e..f1aec82b9e11 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_certificates_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_certificates_get(self, resource_group): response = await self.client.managed_certificates.get( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -34,13 +34,13 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_managed_certificates_begin_create_or_update(self, resource_group): response = await ( await self.client.managed_certificates.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -49,12 +49,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_managed_certificates_delete(self, resource_group): response = await self.client.managed_certificates.delete( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,13 +62,13 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_managed_certificates_update(self, resource_group): response = await self.client.managed_certificates.update( resource_group_name=resource_group.name, environment_name="str", managed_certificate_name="str", managed_certificate_envelope={"tags": {"str": "str"}}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -76,11 +76,11 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_certificates_list(self, resource_group): response = self.client.managed_certificates.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations.py index e99594c282e9..32c87961ef58 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_detectors(self, resource_group): + def test_managed_environment_diagnostics_list_detectors(self, resource_group): response = self.client.managed_environment_diagnostics.list_detectors( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_detector(self, resource_group): + def test_managed_environment_diagnostics_get_detector(self, resource_group): response = self.client.managed_environment_diagnostics.get_detector( resource_group_name=resource_group.name, environment_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations_async.py index b9e3e94e8464..233b55bc9b2d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_diagnostics_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_detectors(self, resource_group): + async def test_managed_environment_diagnostics_list_detectors(self, resource_group): response = await self.client.managed_environment_diagnostics.list_detectors( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list_detectors(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_detector(self, resource_group): + async def test_managed_environment_diagnostics_get_detector(self, resource_group): response = await self.client.managed_environment_diagnostics.get_detector( resource_group_name=resource_group.name, environment_name="str", detector_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations.py index 849c8b722162..da9554410ba0 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_environment_usages_list(self, resource_group): response = self.client.managed_environment_usages.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations_async.py index 92e527da68b4..b2128275576d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environment_usages_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_environment_usages_list(self, resource_group): response = self.client.managed_environment_usages.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations.py index 10da13959b88..45f1167f0f83 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_root(self, resource_group): + def test_managed_environments_diagnostics_get_root(self, resource_group): response = self.client.managed_environments_diagnostics.get_root( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations_async.py index 62bd4fd73518..89accd86b443 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_diagnostics_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_root(self, resource_group): + async def test_managed_environments_diagnostics_get_root(self, resource_group): response = await self.client.managed_environments_diagnostics.get_root( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations.py index ca60ccd51d1a..4ae3921e2026 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_managed_environments_list_by_subscription(self, resource_group): response = self.client.managed_environments.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_managed_environments_list_by_resource_group(self, resource_group): response = self.client.managed_environments.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,11 +41,11 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_environments_get(self, resource_group): response = self.client.managed_environments.get( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,19 +53,17 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_managed_environments_begin_create_or_update(self, resource_group): response = self.client.managed_environments.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", environment_envelope={ "location": "str", - "appInsightsConfiguration": {"connectionString": "str"}, "appLogsConfiguration": { "destination": "str", - "logAnalyticsConfiguration": {"customerId": "str", "dynamicJsonColumns": bool, "sharedKey": "str"}, + "logAnalyticsConfiguration": {"customerId": "str", "sharedKey": "str"}, }, "customDomainConfiguration": { - "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", "certificateValue": bytes("bytes", encoding="utf-8"), "customDomainVerificationId": "str", @@ -81,59 +79,13 @@ def test_begin_create_or_update(self, resource_group): "deploymentErrors": "str", "eventStreamEndpoint": "str", "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "infrastructureResourceGroup": "str", "kedaConfiguration": {"version": "str"}, "kind": "str", "name": "str", - "openTelemetryConfiguration": { - "destinationsConfiguration": { - "dataDogConfiguration": {"key": "str", "site": "str"}, - "otlpConfigurations": [ - { - "endpoint": "str", - "headers": [{"key": "str", "value": "str"}], - "insecure": bool, - "name": "str", - } - ], - }, - "logsConfiguration": {"destinations": ["str"]}, - "metricsConfiguration": {"destinations": ["str"], "includeKeda": bool}, - "tracesConfiguration": {"destinations": ["str"], "includeDapr": bool}, - }, "peerAuthentication": {"mtls": {"enabled": bool}}, "peerTrafficConfiguration": {"encryption": {"enabled": bool}}, - "privateEndpointConnections": [ - { - "groupIds": ["str"], - "id": "str", - "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "actionsRequired": "str", - "description": "str", - "status": "str", - }, - "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - } - ], "provisioningState": "str", - "publicNetworkAccess": "str", "staticIp": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -153,17 +105,11 @@ def test_begin_create_or_update(self, resource_group): "platformReservedDnsIP": "str", }, "workloadProfiles": [ - { - "name": "str", - "workloadProfileType": "str", - "enableFips": False, - "maximumCount": 0, - "minimumCount": 0, - } + {"name": "str", "workloadProfileType": "str", "maximumCount": 0, "minimumCount": 0} ], "zoneRedundant": bool, }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -171,11 +117,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_managed_environments_begin_delete(self, resource_group): response = self.client.managed_environments.begin_delete( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -183,19 +129,17 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_managed_environments_begin_update(self, resource_group): response = self.client.managed_environments.begin_update( resource_group_name=resource_group.name, environment_name="str", environment_envelope={ "location": "str", - "appInsightsConfiguration": {"connectionString": "str"}, "appLogsConfiguration": { "destination": "str", - "logAnalyticsConfiguration": {"customerId": "str", "dynamicJsonColumns": bool, "sharedKey": "str"}, + "logAnalyticsConfiguration": {"customerId": "str", "sharedKey": "str"}, }, "customDomainConfiguration": { - "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", "certificateValue": bytes("bytes", encoding="utf-8"), "customDomainVerificationId": "str", @@ -211,59 +155,13 @@ def test_begin_update(self, resource_group): "deploymentErrors": "str", "eventStreamEndpoint": "str", "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "infrastructureResourceGroup": "str", "kedaConfiguration": {"version": "str"}, "kind": "str", "name": "str", - "openTelemetryConfiguration": { - "destinationsConfiguration": { - "dataDogConfiguration": {"key": "str", "site": "str"}, - "otlpConfigurations": [ - { - "endpoint": "str", - "headers": [{"key": "str", "value": "str"}], - "insecure": bool, - "name": "str", - } - ], - }, - "logsConfiguration": {"destinations": ["str"]}, - "metricsConfiguration": {"destinations": ["str"], "includeKeda": bool}, - "tracesConfiguration": {"destinations": ["str"], "includeDapr": bool}, - }, "peerAuthentication": {"mtls": {"enabled": bool}}, "peerTrafficConfiguration": {"encryption": {"enabled": bool}}, - "privateEndpointConnections": [ - { - "groupIds": ["str"], - "id": "str", - "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "actionsRequired": "str", - "description": "str", - "status": "str", - }, - "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - } - ], "provisioningState": "str", - "publicNetworkAccess": "str", "staticIp": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -283,17 +181,11 @@ def test_begin_update(self, resource_group): "platformReservedDnsIP": "str", }, "workloadProfiles": [ - { - "name": "str", - "workloadProfileType": "str", - "enableFips": False, - "maximumCount": 0, - "minimumCount": 0, - } + {"name": "str", "workloadProfileType": "str", "maximumCount": 0, "minimumCount": 0} ], "zoneRedundant": bool, }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -301,11 +193,11 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_auth_token(self, resource_group): + def test_managed_environments_get_auth_token(self, resource_group): response = self.client.managed_environments.get_auth_token( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -313,11 +205,11 @@ def test_get_auth_token(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_workload_profile_states(self, resource_group): + def test_managed_environments_list_workload_profile_states(self, resource_group): response = self.client.managed_environments.list_workload_profile_states( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations_async.py index 822bdeec9d75..7b9f6beece7e 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_managed_environments_list_by_subscription(self, resource_group): response = self.client.managed_environments.list_by_subscription( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_managed_environments_list_by_resource_group(self, resource_group): response = self.client.managed_environments.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,11 +42,11 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_environments_get(self, resource_group): response = await self.client.managed_environments.get( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,24 +54,18 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_managed_environments_begin_create_or_update(self, resource_group): response = await ( await self.client.managed_environments.begin_create_or_update( resource_group_name=resource_group.name, environment_name="str", environment_envelope={ "location": "str", - "appInsightsConfiguration": {"connectionString": "str"}, "appLogsConfiguration": { "destination": "str", - "logAnalyticsConfiguration": { - "customerId": "str", - "dynamicJsonColumns": bool, - "sharedKey": "str", - }, + "logAnalyticsConfiguration": {"customerId": "str", "sharedKey": "str"}, }, "customDomainConfiguration": { - "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", "certificateValue": bytes("bytes", encoding="utf-8"), "customDomainVerificationId": "str", @@ -87,59 +81,13 @@ async def test_begin_create_or_update(self, resource_group): "deploymentErrors": "str", "eventStreamEndpoint": "str", "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "infrastructureResourceGroup": "str", "kedaConfiguration": {"version": "str"}, "kind": "str", "name": "str", - "openTelemetryConfiguration": { - "destinationsConfiguration": { - "dataDogConfiguration": {"key": "str", "site": "str"}, - "otlpConfigurations": [ - { - "endpoint": "str", - "headers": [{"key": "str", "value": "str"}], - "insecure": bool, - "name": "str", - } - ], - }, - "logsConfiguration": {"destinations": ["str"]}, - "metricsConfiguration": {"destinations": ["str"], "includeKeda": bool}, - "tracesConfiguration": {"destinations": ["str"], "includeDapr": bool}, - }, "peerAuthentication": {"mtls": {"enabled": bool}}, "peerTrafficConfiguration": {"encryption": {"enabled": bool}}, - "privateEndpointConnections": [ - { - "groupIds": ["str"], - "id": "str", - "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "actionsRequired": "str", - "description": "str", - "status": "str", - }, - "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - } - ], "provisioningState": "str", - "publicNetworkAccess": "str", "staticIp": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -159,17 +107,11 @@ async def test_begin_create_or_update(self, resource_group): "platformReservedDnsIP": "str", }, "workloadProfiles": [ - { - "name": "str", - "workloadProfileType": "str", - "enableFips": False, - "maximumCount": 0, - "minimumCount": 0, - } + {"name": "str", "workloadProfileType": "str", "maximumCount": 0, "minimumCount": 0} ], "zoneRedundant": bool, }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -178,12 +120,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_managed_environments_begin_delete(self, resource_group): response = await ( await self.client.managed_environments.begin_delete( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -192,24 +134,18 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_managed_environments_begin_update(self, resource_group): response = await ( await self.client.managed_environments.begin_update( resource_group_name=resource_group.name, environment_name="str", environment_envelope={ "location": "str", - "appInsightsConfiguration": {"connectionString": "str"}, "appLogsConfiguration": { "destination": "str", - "logAnalyticsConfiguration": { - "customerId": "str", - "dynamicJsonColumns": bool, - "sharedKey": "str", - }, + "logAnalyticsConfiguration": {"customerId": "str", "sharedKey": "str"}, }, "customDomainConfiguration": { - "certificateKeyVaultProperties": {"identity": "str", "keyVaultUrl": "str"}, "certificatePassword": "str", "certificateValue": bytes("bytes", encoding="utf-8"), "customDomainVerificationId": "str", @@ -225,59 +161,13 @@ async def test_begin_update(self, resource_group): "deploymentErrors": "str", "eventStreamEndpoint": "str", "id": "str", - "identity": { - "type": "str", - "principalId": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "infrastructureResourceGroup": "str", "kedaConfiguration": {"version": "str"}, "kind": "str", "name": "str", - "openTelemetryConfiguration": { - "destinationsConfiguration": { - "dataDogConfiguration": {"key": "str", "site": "str"}, - "otlpConfigurations": [ - { - "endpoint": "str", - "headers": [{"key": "str", "value": "str"}], - "insecure": bool, - "name": "str", - } - ], - }, - "logsConfiguration": {"destinations": ["str"]}, - "metricsConfiguration": {"destinations": ["str"], "includeKeda": bool}, - "tracesConfiguration": {"destinations": ["str"], "includeDapr": bool}, - }, "peerAuthentication": {"mtls": {"enabled": bool}}, "peerTrafficConfiguration": {"encryption": {"enabled": bool}}, - "privateEndpointConnections": [ - { - "groupIds": ["str"], - "id": "str", - "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "actionsRequired": "str", - "description": "str", - "status": "str", - }, - "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - } - ], "provisioningState": "str", - "publicNetworkAccess": "str", "staticIp": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -297,17 +187,11 @@ async def test_begin_update(self, resource_group): "platformReservedDnsIP": "str", }, "workloadProfiles": [ - { - "name": "str", - "workloadProfileType": "str", - "enableFips": False, - "maximumCount": 0, - "minimumCount": 0, - } + {"name": "str", "workloadProfileType": "str", "maximumCount": 0, "minimumCount": 0} ], "zoneRedundant": bool, }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -316,11 +200,11 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_auth_token(self, resource_group): + async def test_managed_environments_get_auth_token(self, resource_group): response = await self.client.managed_environments.get_auth_token( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -328,11 +212,11 @@ async def test_get_auth_token(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_workload_profile_states(self, resource_group): + async def test_managed_environments_list_workload_profile_states(self, resource_group): response = self.client.managed_environments.list_workload_profile_states( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations.py index 07d3f3d84dd2..3c462f150735 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_managed_environments_storages_list(self, resource_group): response = self.client.managed_environments_storages.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -32,12 +32,12 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_environments_storages_get(self, resource_group): response = self.client.managed_environments_storages.get( resource_group_name=resource_group.name, environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_managed_environments_storages_create_or_update(self, resource_group): response = self.client.managed_environments_storages.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -54,8 +54,7 @@ def test_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"}, - "nfsAzureFile": {"accessMode": "str", "server": "str", "shareName": "str"}, + "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"} }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -67,7 +66,7 @@ def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -75,12 +74,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_managed_environments_storages_delete(self, resource_group): response = self.client.managed_environments_storages.delete( resource_group_name=resource_group.name, environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations_async.py index 5e6af988708e..fa3917ff0188 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_managed_environments_storages_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_managed_environments_storages_list(self, resource_group): response = await self.client.managed_environments_storages.list( resource_group_name=resource_group.name, environment_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_environments_storages_get(self, resource_group): response = await self.client.managed_environments_storages.get( resource_group_name=resource_group.name, environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_managed_environments_storages_create_or_update(self, resource_group): response = await self.client.managed_environments_storages.create_or_update( resource_group_name=resource_group.name, environment_name="str", @@ -55,8 +55,7 @@ async def test_create_or_update(self, resource_group): "id": "str", "name": "str", "properties": { - "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"}, - "nfsAzureFile": {"accessMode": "str", "server": "str", "shareName": "str"}, + "azureFile": {"accessMode": "str", "accountKey": "str", "accountName": "str", "shareName": "str"} }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -68,7 +67,7 @@ async def test_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -76,12 +75,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_managed_environments_storages_delete(self, resource_group): response = await self.client.managed_environments_storages.delete( resource_group_name=resource_group.name, environment_name="str", storage_name="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations.py index 2c6343949e2f..962229ae1783 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_check_name_availability(self, resource_group): + def test_namespaces_check_name_availability(self, resource_group): response = self.client.namespaces.check_name_availability( resource_group_name=resource_group.name, environment_name="str", check_name_availability_request={"name": "str", "type": "str"}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations_async.py index 4d7d402a20d7..9324213427b4 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_namespaces_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_check_name_availability(self, resource_group): + async def test_namespaces_check_name_availability(self, resource_group): response = await self.client.namespaces.check_name_availability( resource_group_name=resource_group.name, environment_name="str", check_name_availability_request={"name": "str", "type": "str"}, - api_version="2024-08-02-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations.py index a6f1201eb482..d5e6e83a4963 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations_async.py index 79e186721f08..2dfb01d4073d 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations.py index 04acf42ae22d..041661a85d28 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_usages_list(self, resource_group): response = self.client.usages.list( location="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations_async.py b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations_async.py index d463d34828e8..27a750bc17e6 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations_async.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/generated_tests/test_container_apps_api_usages_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_usages_list(self, resource_group): response = self.client.usages.list( location="str", - api_version="2024-08-02-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/appcontainers/azure-mgmt-appcontainers/setup.py b/sdk/appcontainers/azure-mgmt-appcontainers/setup.py index 2f3300f3cf4f..f4a701461b04 100644 --- a/sdk/appcontainers/azure-mgmt-appcontainers/setup.py +++ b/sdk/appcontainers/azure-mgmt-appcontainers/setup.py @@ -22,11 +22,9 @@ # Version extraction inspired from 'requests' with open( - ( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py") - ), + os.path.join(package_folder_path, "version.py") + if os.path.exists(os.path.join(package_folder_path, "version.py")) + else os.path.join(package_folder_path, "_version.py"), "r", ) as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)