|
| 1 | +# coding=utf-8 |
| 2 | +# -------------------------------------------------------------------------- |
| 3 | +# Copyright (c) Microsoft Corporation. All rights reserved. |
| 4 | +# Licensed under the MIT License. See License.txt in the project root for license information. |
| 5 | +# Code generated by Microsoft (R) AutoRest Code Generator. |
| 6 | +# Changes may cause incorrect behavior and will be lost if the code is regenerated. |
| 7 | +# -------------------------------------------------------------------------- |
| 8 | + |
| 9 | +from copy import deepcopy |
| 10 | +from typing import Any, Optional, TYPE_CHECKING |
| 11 | + |
| 12 | +from azure.core.rest import HttpRequest, HttpResponse |
| 13 | +from azure.mgmt.core import ARMPipelineClient |
| 14 | +from msrest import Deserializer, Serializer |
| 15 | + |
| 16 | +from . import models |
| 17 | +from ._configuration import ContainerAppsAPIClientConfiguration |
| 18 | +from .operations import CertificatesOperations, ContainerAppsAuthConfigsOperations, ContainerAppsOperations, ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, ContainerAppsSourceControlsOperations, DaprComponentsOperations, ManagedEnvironmentsOperations, ManagedEnvironmentsStoragesOperations, Operations |
| 19 | + |
| 20 | +if TYPE_CHECKING: |
| 21 | + # pylint: disable=unused-import,ungrouped-imports |
| 22 | + from azure.core.credentials import TokenCredential |
| 23 | + |
| 24 | +class ContainerAppsAPIClient: |
| 25 | + """ContainerAppsAPIClient. |
| 26 | +
|
| 27 | + :ivar container_apps: ContainerAppsOperations operations |
| 28 | + :vartype container_apps: container_apps_api_client.operations.ContainerAppsOperations |
| 29 | + :ivar container_apps_revisions: ContainerAppsRevisionsOperations operations |
| 30 | + :vartype container_apps_revisions: |
| 31 | + container_apps_api_client.operations.ContainerAppsRevisionsOperations |
| 32 | + :ivar container_apps_revision_replicas: ContainerAppsRevisionReplicasOperations operations |
| 33 | + :vartype container_apps_revision_replicas: |
| 34 | + container_apps_api_client.operations.ContainerAppsRevisionReplicasOperations |
| 35 | + :ivar managed_environments: ManagedEnvironmentsOperations operations |
| 36 | + :vartype managed_environments: |
| 37 | + container_apps_api_client.operations.ManagedEnvironmentsOperations |
| 38 | + :ivar certificates: CertificatesOperations operations |
| 39 | + :vartype certificates: container_apps_api_client.operations.CertificatesOperations |
| 40 | + :ivar operations: Operations operations |
| 41 | + :vartype operations: container_apps_api_client.operations.Operations |
| 42 | + :ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations |
| 43 | + :vartype container_apps_source_controls: |
| 44 | + container_apps_api_client.operations.ContainerAppsSourceControlsOperations |
| 45 | + :ivar dapr_components: DaprComponentsOperations operations |
| 46 | + :vartype dapr_components: container_apps_api_client.operations.DaprComponentsOperations |
| 47 | + :ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations |
| 48 | + :vartype container_apps_auth_configs: |
| 49 | + container_apps_api_client.operations.ContainerAppsAuthConfigsOperations |
| 50 | + :ivar managed_environments_storages: ManagedEnvironmentsStoragesOperations operations |
| 51 | + :vartype managed_environments_storages: |
| 52 | + container_apps_api_client.operations.ManagedEnvironmentsStoragesOperations |
| 53 | + :param credential: Credential needed for the client to connect to Azure. |
| 54 | + :type credential: ~azure.core.credentials.TokenCredential |
| 55 | + :param subscription_id: The ID of the target subscription. |
| 56 | + :type subscription_id: str |
| 57 | + :param base_url: Service URL. Default value is 'https://management.azure.com'. |
| 58 | + :type base_url: str |
| 59 | + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no |
| 60 | + Retry-After header is present. |
| 61 | + """ |
| 62 | + |
| 63 | + def __init__( |
| 64 | + self, |
| 65 | + credential: "TokenCredential", |
| 66 | + subscription_id: str, |
| 67 | + base_url: str = "https://management.azure.com", |
| 68 | + **kwargs: Any |
| 69 | + ) -> None: |
| 70 | + self._config = ContainerAppsAPIClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) |
| 71 | + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) |
| 72 | + |
| 73 | + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} |
| 74 | + self._serialize = Serializer(client_models) |
| 75 | + self._deserialize = Deserializer(client_models) |
| 76 | + self._serialize.client_side_validation = False |
| 77 | + self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize) |
| 78 | + self.container_apps_revisions = ContainerAppsRevisionsOperations(self._client, self._config, self._serialize, self._deserialize) |
| 79 | + self.container_apps_revision_replicas = ContainerAppsRevisionReplicasOperations(self._client, self._config, self._serialize, self._deserialize) |
| 80 | + self.managed_environments = ManagedEnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize) |
| 81 | + self.certificates = CertificatesOperations(self._client, self._config, self._serialize, self._deserialize) |
| 82 | + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) |
| 83 | + self.container_apps_source_controls = ContainerAppsSourceControlsOperations(self._client, self._config, self._serialize, self._deserialize) |
| 84 | + self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize) |
| 85 | + self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations(self._client, self._config, self._serialize, self._deserialize) |
| 86 | + self.managed_environments_storages = ManagedEnvironmentsStoragesOperations(self._client, self._config, self._serialize, self._deserialize) |
| 87 | + |
| 88 | + |
| 89 | + def _send_request( |
| 90 | + self, |
| 91 | + request, # type: HttpRequest |
| 92 | + **kwargs: Any |
| 93 | + ) -> HttpResponse: |
| 94 | + """Runs the network request through the client's chained policies. |
| 95 | +
|
| 96 | + >>> from azure.core.rest import HttpRequest |
| 97 | + >>> request = HttpRequest("GET", "https://www.example.org/") |
| 98 | + <HttpRequest [GET], url: 'https://www.example.org/'> |
| 99 | + >>> response = client._send_request(request) |
| 100 | + <HttpResponse: 200 OK> |
| 101 | +
|
| 102 | + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart |
| 103 | +
|
| 104 | + :param request: The network request you want to make. Required. |
| 105 | + :type request: ~azure.core.rest.HttpRequest |
| 106 | + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. |
| 107 | + :return: The response of your network call. Does not do error handling on your response. |
| 108 | + :rtype: ~azure.core.rest.HttpResponse |
| 109 | + """ |
| 110 | + |
| 111 | + request_copy = deepcopy(request) |
| 112 | + request_copy.url = self._client.format_url(request_copy.url) |
| 113 | + return self._client.send_request(request_copy, **kwargs) |
| 114 | + |
| 115 | + def close(self): |
| 116 | + # type: () -> None |
| 117 | + self._client.close() |
| 118 | + |
| 119 | + def __enter__(self): |
| 120 | + # type: () -> ContainerAppsAPIClient |
| 121 | + self._client.__enter__() |
| 122 | + return self |
| 123 | + |
| 124 | + def __exit__(self, *exc_details): |
| 125 | + # type: (Any) -> None |
| 126 | + self._client.__exit__(*exc_details) |
0 commit comments