Skip to content

Commit

Permalink
CodeGen from PR 25051 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Release microsoft.app 2023 05 02 preview (Azure#25051)

* Adds base for updating Microsoft.App from version preview/2023-04-01-preview to version 2023-05-02-preview

* Updates readme

* Updates API version in new specs and examples

* fix description for endTime in JobExecution (Azure#24359)

* fix description for endTime in JobExecution

* fix for breaking change error

* Introduce Microsoft.App/builders tracked resource and Microsoft.App/builds proxy resource (Azure#24240)

* cherry picked commit to introduce builders and builds, and updated api version

* added linting suppressions to readme

* pre feedback: v3 -> v5, common build/er params, rename identity to identityresourceid, inprogress -> creating

* fix typo

* fix model validation

* added updating provisioning status, and fixed a missed provisioning status ref

* Create identity to registry mapping in builder object (Azure#24275)

* create identity to registry mapping in builder object

* update mapping to be a dictionary of container registries, to enforce single container registry

* run prettier

* run prettier on examples fil

* pr feedback: v5 -> v3 and added x ms param location

* fix plural naming to singular

* Add GetVerificationId API (Azure#24286)

* add api

* fix typo

* fix spacing

* fix spacing

* change version

---------

Co-authored-by: Chenghui Yu <chenghuiyu@microsoft.com>

* Support multiple port for container app (Azure#24332) (Azure#24459)

* Support multiple port for container app

* lint

* comment

* Add blob storage token store support (Azure#24455)

* add blob storage token store support

* update

* update trigger type enum - schedule for jobs (Azure#24399)

* update trigger type enum - schedule for jobs

* update trigger type enum - schedule for jobs

* add previous changes merged to main

* add encryption settings (Azure#24822)

* rename verification id to custom domain verification id (Azure#24874)

Co-authored-by: Chenghui Yu <chenghuiyu@microsoft.com>

* Removed SourceToCloud feature from 2023-05-02-preview (Azure#24860)

* Anfranci/fixstartexectemplateabv0423 (Azure#24863)

* fix start job exec template required property

* fix start job exec template required property

* fix start job exec template required property

* fix start job exec template required property

* Add list usages api for Microsoft.App (Azure#24833)

* add api

* update

* update

* update

* update

* empty line

---------

Co-authored-by: Paul Dorsch <107068277+pauld-msft@users.noreply.github.com>
Co-authored-by: anandanthony <anfranci@microsoft.com>
Co-authored-by: Seris370 <38371667+Seris370@users.noreply.github.com>
Co-authored-by: Chenghui Yu <chenghuiyu@microsoft.com>
Co-authored-by: zhenqxuMSFT <zhenqxu@microsoft.com>
Co-authored-by: njucz <740360112@qq.com>
Co-authored-by: Xingjian Wang <79332479+xwang971@users.noreply.github.com>
  • Loading branch information
8 people committed Aug 11, 2023
1 parent ee15f44 commit c9986d8
Show file tree
Hide file tree
Showing 163 changed files with 2,266 additions and 763 deletions.
10 changes: 5 additions & 5 deletions sdk/appcontainers/azure-mgmt-appcontainers/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "3c639105c011765893db51cbb0dda056e34dc994",
"commit": "5b51ccefb0ba7799bbeac5e5460d9eec84ce55fa",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"autorest": "3.9.7",
"use": [
"@autorest/python@6.4.8",
"@autorest/modelerfour@4.24.3"
"@autorest/python@6.7.1",
"@autorest/modelerfour@4.26.2"
],
"autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/app/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
"readme": "specification/app/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2022-11-01-preview")
api_version: str = kwargs.pop("api_version", "2023-05-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ConnectedEnvironmentsDaprComponentsOperations,
ConnectedEnvironmentsOperations,
ConnectedEnvironmentsStoragesOperations,
ContainerAppsAPIClientOperationsMixin,
ContainerAppsAuthConfigsOperations,
ContainerAppsDiagnosticsOperations,
ContainerAppsOperations,
Expand All @@ -46,7 +47,9 @@
from azure.core.credentials import TokenCredential


class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
class ContainerAppsAPIClient(
ContainerAppsAPIClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""ContainerAppsAPIClient.
:ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations
Expand All @@ -73,10 +76,6 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
azure.mgmt.appcontainers.operations.ConnectedEnvironmentsStoragesOperations
:ivar container_apps: ContainerAppsOperations operations
:vartype container_apps: azure.mgmt.appcontainers.operations.ContainerAppsOperations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.operations.JobsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.operations.JobsExecutionsOperations
:ivar container_apps_revisions: ContainerAppsRevisionsOperations operations
:vartype container_apps_revisions:
azure.mgmt.appcontainers.operations.ContainerAppsRevisionsOperations
Expand All @@ -94,6 +93,10 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
azure.mgmt.appcontainers.operations.ManagedEnvironmentsDiagnosticsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.appcontainers.operations.Operations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.operations.JobsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.operations.JobsExecutionsOperations
:ivar managed_environments: ManagedEnvironmentsOperations operations
:vartype managed_environments:
azure.mgmt.appcontainers.operations.ManagedEnvironmentsOperations
Expand All @@ -118,8 +121,8 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
: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 "2022-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-05-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.
Expand Down Expand Up @@ -161,8 +164,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_revisions = ContainerAppsRevisionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -179,6 +180,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environments = ManagedEnvironmentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
_serialized.update(_new_attr) # type: ignore
_new_attr = _new_attr[k] # type: ignore
_serialized = _serialized[k]
except ValueError:
continue
except ValueError as err:
if isinstance(err, SerializationError):
raise

except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
Expand Down Expand Up @@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs):
:param data: The data to be serialized.
:param str data_type: The type to be serialized from.
:keyword bool skip_quote: Whether to skip quote the serialized result.
Defaults to False.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
Expand All @@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs):
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
if not kwargs.get("skip_quote", False):
data = [quote(str(d), safe="") for d in data]
return str(self.serialize_iter(data, internal_data_type, **kwargs))
do_quote = not kwargs.get("skip_quote", False)
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))

# Not a list, regular serialization
output = self.serialize_data(data, data_type, **kwargs)
Expand Down Expand Up @@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
Defaults to False.
:rtype: list, str
"""
if isinstance(data, str):
Expand All @@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
for d in data:
try:
serialized.append(self.serialize_data(d, iter_type, **kwargs))
except ValueError:
except ValueError as err:
if isinstance(err, SerializationError):
raise
serialized.append(None)

if kwargs.get("do_quote", False):
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]

if div:
serialized = ["" if s is None else str(s) for s in serialized]
serialized = div.join(serialized)
Expand Down Expand Up @@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
for key, value in attr.items():
try:
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
except ValueError:
except ValueError as err:
if isinstance(err, SerializationError):
raise
serialized[self.serialize_unicode(key)] = None

if "xml" in serialization_ctxt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import List, cast
from abc import ABC
from typing import TYPE_CHECKING

from azure.core.pipeline.transport import HttpRequest

from ._configuration import ContainerAppsAPIClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient

from ._serialization import Deserializer, Serializer


def _convert_request(request, files=None):
data = request.content if not files else None
Expand All @@ -18,13 +27,10 @@ def _convert_request(request, files=None):
return request


def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
try:
return template.format(**kwargs)
except KeyError as key:
# Need the cast, as for some reasons "split" is typed as list[str | Any]
formatted_components = cast(List[str], template.split("/"))
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)
class ContainerAppsAPIClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

_client: "PipelineClient"
_config: ContainerAppsAPIClientConfiguration
_serialize: "Serializer"
_deserialize: "Deserializer"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "3.0.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2022-11-01-preview")
api_version: str = kwargs.pop("api_version", "2023-05-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
ConnectedEnvironmentsDaprComponentsOperations,
ConnectedEnvironmentsOperations,
ConnectedEnvironmentsStoragesOperations,
ContainerAppsAPIClientOperationsMixin,
ContainerAppsAuthConfigsOperations,
ContainerAppsDiagnosticsOperations,
ContainerAppsOperations,
Expand All @@ -46,7 +47,9 @@
from azure.core.credentials_async import AsyncTokenCredential


class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
class ContainerAppsAPIClient(
ContainerAppsAPIClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""ContainerAppsAPIClient.
:ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations
Expand All @@ -73,10 +76,6 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
azure.mgmt.appcontainers.aio.operations.ConnectedEnvironmentsStoragesOperations
:ivar container_apps: ContainerAppsOperations operations
:vartype container_apps: azure.mgmt.appcontainers.aio.operations.ContainerAppsOperations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.aio.operations.JobsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.aio.operations.JobsExecutionsOperations
:ivar container_apps_revisions: ContainerAppsRevisionsOperations operations
:vartype container_apps_revisions:
azure.mgmt.appcontainers.aio.operations.ContainerAppsRevisionsOperations
Expand All @@ -94,6 +93,10 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsDiagnosticsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.appcontainers.aio.operations.Operations
:ivar jobs: JobsOperations operations
:vartype jobs: azure.mgmt.appcontainers.aio.operations.JobsOperations
:ivar jobs_executions: JobsExecutionsOperations operations
:vartype jobs_executions: azure.mgmt.appcontainers.aio.operations.JobsExecutionsOperations
:ivar managed_environments: ManagedEnvironmentsOperations operations
:vartype managed_environments:
azure.mgmt.appcontainers.aio.operations.ManagedEnvironmentsOperations
Expand All @@ -118,8 +121,8 @@ class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyw
: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 "2022-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2023-05-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.
Expand Down Expand Up @@ -161,8 +164,6 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_revisions = ContainerAppsRevisionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -179,6 +180,8 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
self.jobs_executions = JobsExecutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environments = ManagedEnvironmentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# --------------------------------------------------------------------------
# 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 abc import ABC
from typing import TYPE_CHECKING

from azure.core.pipeline.transport import HttpRequest

from ._configuration import ContainerAppsAPIClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import AsyncPipelineClient

from .._serialization import Deserializer, Serializer


class ContainerAppsAPIClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

_client: "AsyncPipelineClient"
_config: ContainerAppsAPIClientConfiguration
_serialize: "Serializer"
_deserialize: "Deserializer"
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
from ._connected_environments_dapr_components_operations import ConnectedEnvironmentsDaprComponentsOperations
from ._connected_environments_storages_operations import ConnectedEnvironmentsStoragesOperations
from ._container_apps_operations import ContainerAppsOperations
from ._jobs_operations import JobsOperations
from ._jobs_executions_operations import JobsExecutionsOperations
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 ._operations import Operations
from ._jobs_operations import JobsOperations
from ._jobs_executions_operations import JobsExecutionsOperations
from ._container_apps_api_client_operations import ContainerAppsAPIClientOperationsMixin
from ._managed_environments_operations import ManagedEnvironmentsOperations
from ._certificates_operations import CertificatesOperations
from ._managed_certificates_operations import ManagedCertificatesOperations
Expand All @@ -43,14 +44,15 @@
"ConnectedEnvironmentsDaprComponentsOperations",
"ConnectedEnvironmentsStoragesOperations",
"ContainerAppsOperations",
"JobsOperations",
"JobsExecutionsOperations",
"ContainerAppsRevisionsOperations",
"ContainerAppsRevisionReplicasOperations",
"ContainerAppsDiagnosticsOperations",
"ManagedEnvironmentDiagnosticsOperations",
"ManagedEnvironmentsDiagnosticsOperations",
"Operations",
"JobsOperations",
"JobsExecutionsOperations",
"ContainerAppsAPIClientOperationsMixin",
"ManagedEnvironmentsOperations",
"CertificatesOperations",
"ManagedCertificatesOperations",
Expand Down
Loading

0 comments on commit c9986d8

Please sign in to comment.