Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-resource] [Resources] Config readme.python #172

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/resources/azure-mgmt-resource/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"@autorest/python@5.13.0",
"@autorest/modelerfour@4.19.3"
],
"commit": "572d71d6c4134db8dd00055d9cd3f76b2d414a7b",
"commit": "ddf8e84034735bd996bdecc96a2273dc17a0110f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/resources/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"autorest_command": "autorest specification/resources/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"readme": "specification/resources/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ChangesClient(MultiApiClientMixin, _SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2022-03-01-preview'
DEFAULT_API_VERSION = '2022-05-01'
_PROFILE_TAG = "azure.mgmt.resource.changes.ChangesClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand Down Expand Up @@ -89,21 +89,28 @@ def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 2022-03-01-preview: :mod:`v2022_03_01_preview.models<azure.mgmt.resource.changes.v2022_03_01_preview.models>`
* 2022-05-01: :mod:`v2022_05_01.models<azure.mgmt.resource.changes.v2022_05_01.models>`
"""
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview import models
return models
elif api_version == '2022-05-01':
from .v2022_05_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def changes(self):
"""Instance depends on the API version:

* 2022-03-01-preview: :class:`ChangesOperations<azure.mgmt.resource.changes.v2022_03_01_preview.operations.ChangesOperations>`
* 2022-05-01: :class:`ChangesOperations<azure.mgmt.resource.changes.v2022_05_01.operations.ChangesOperations>`
"""
api_version = self._get_api_version('changes')
if api_version == '2022-03-01-preview':
from .v2022_03_01_preview.operations import ChangesOperations as OperationClass
elif api_version == '2022-05-01':
from .v2022_05_01.operations import ChangesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'changes'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ChangesClient(MultiApiClientMixin, _SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2022-03-01-preview'
DEFAULT_API_VERSION = '2022-05-01'
_PROFILE_TAG = "azure.mgmt.resource.changes.ChangesClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand Down Expand Up @@ -88,21 +88,28 @@ def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 2022-03-01-preview: :mod:`v2022_03_01_preview.models<azure.mgmt.resource.changes.v2022_03_01_preview.models>`
* 2022-05-01: :mod:`v2022_05_01.models<azure.mgmt.resource.changes.v2022_05_01.models>`
"""
if api_version == '2022-03-01-preview':
from ..v2022_03_01_preview import models
return models
elif api_version == '2022-05-01':
from ..v2022_05_01 import models
return models
raise ValueError("API version {} is not available".format(api_version))

@property
def changes(self):
"""Instance depends on the API version:

* 2022-03-01-preview: :class:`ChangesOperations<azure.mgmt.resource.changes.v2022_03_01_preview.aio.operations.ChangesOperations>`
* 2022-05-01: :class:`ChangesOperations<azure.mgmt.resource.changes.v2022_05_01.aio.operations.ChangesOperations>`
"""
api_version = self._get_api_version('changes')
if api_version == '2022-03-01-preview':
from ..v2022_03_01_preview.aio.operations import ChangesOperations as OperationClass
elif api_version == '2022-05-01':
from ..v2022_05_01.aio.operations import ChangesOperations as OperationClass
else:
raise ValueError("API version {} does not have operation group 'changes'".format(api_version))
return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2022_03_01_preview.models import *
from .v2022_05_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ class ChangesClient:
"""The Resource Changes Client.

:ivar changes: ChangesOperations operations
:vartype changes: azure.mgmt.resource.changes.v2022_03_01_preview.operations.ChangesOperations
:vartype changes: azure.mgmt.resource.changes.v2022_05_01.operations.ChangesOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000).
: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-03-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class ChangesClientConfiguration(Configuration): # pylint: disable=too-many-ins
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000).
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-03-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

Expand All @@ -42,7 +42,7 @@ def __init__(
**kwargs: Any
) -> None:
super(ChangesClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-03-01-preview") # type: str
api_version = kwargs.pop('api_version', "2022-05-01") # type: str

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2022-03-01-preview",
"total_api_version_list": ["2022-03-01-preview"],
"chosen_version": "2022-05-01",
"total_api_version_list": ["2022-05-01"],
"client": {
"name": "ChangesClient",
"filename": "_changes_client",
Expand Down
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 = "21.1.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,16 @@ class ChangesClient:
"""The Resource Changes Client.

:ivar changes: ChangesOperations operations
:vartype changes:
azure.mgmt.resource.changes.v2022_03_01_preview.aio.operations.ChangesOperations
:vartype changes: azure.mgmt.resource.changes.v2022_05_01.aio.operations.ChangesOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000).
: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-03-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class ChangesClientConfiguration(Configuration): # pylint: disable=too-many-ins
:param subscription_id: The Azure subscription ID. This is a GUID-formatted string (e.g.
00000000-0000-0000-0000-000000000000).
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-03-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2022-05-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

Expand All @@ -42,7 +42,7 @@ def __init__(
**kwargs: Any
) -> None:
super(ChangesClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-03-01-preview") # type: str
api_version = kwargs.pop('api_version', "2022-05-01") # type: str

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 @@ -30,7 +30,7 @@ class ChangesOperations:
instantiates it for you and attaches it as an attribute.

:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.resource.changes.v2022_03_01_preview.models
:type models: ~azure.mgmt.resource.changes.v2022_05_01.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
Expand Down Expand Up @@ -74,10 +74,10 @@ def list(
:return: An iterator like instance of either ChangeResourceListResult or the result of
cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeResourceListResult]
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.resource.changes.v2022_05_01.models.ChangeResourceListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2022-03-01-preview") # type: str
api_version = kwargs.pop('api_version', "2022-05-01") # type: str

cls = kwargs.pop('cls', None) # type: ClsType["_models.ChangeResourceListResult"]
error_map = {
Expand Down Expand Up @@ -170,7 +170,7 @@ async def get(
:type change_resource_id: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: ChangeResourceResult, or the result of cls(response)
:rtype: ~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeResourceResult
:rtype: ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeResourceResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.ChangeResourceResult"]
Expand All @@ -179,7 +179,7 @@ async def get(
}
error_map.update(kwargs.pop('error_map', {}))

api_version = kwargs.pop('api_version', "2022-03-01-preview") # type: str
api_version = kwargs.pop('api_version', "2022-05-01") # type: str


request = build_changes_get_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class ChangeCategory(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
USER = "User"
#: System initiated change.
SYSTEM = "System"
#: A newly created resource.
CREATE = "Create"

class ChangeType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
"""The type of change that was captured in the resource
"""

#: An existing resource underwent a change.
UPDATE = "Update"
#: An existing resource was deleted.
DELETE = "Delete"
#: A newly created resource.
CREATE = "Create"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ class ChangeBase(msrest.serialization.Model):
:ivar property_change_type: The type of change that occurred. Possible values include:
"Update", "Insert", "Remove".
:vartype property_change_type: str or
~azure.mgmt.resource.changes.v2022_03_01_preview.models.PropertyChangeType
~azure.mgmt.resource.changes.v2022_05_01.models.PropertyChangeType
:ivar change_category: The entity that made the change. Possible values include: "User",
"System", "Create".
:vartype change_category: str or
~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeCategory
"System".
:vartype change_category: str or ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeCategory
:ivar previous_value: The target resource property value before the change.
:vartype previous_value: str
:ivar new_value: The target resource property value after the change.
Expand Down Expand Up @@ -115,14 +114,13 @@ class ChangeProperties(msrest.serialization.Model):
:ivar target_resource_type: The namespace and type of the resource.
:vartype target_resource_type: str
:ivar change_type: The type of change that was captured in the resource. Possible values
include: "Update", "Create".
:vartype change_type: str or ~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeType
include: "Update", "Delete", "Create".
:vartype change_type: str or ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeType
:ivar change_attributes: Details about the change resource.
:vartype change_attributes:
~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeAttributes
:vartype change_attributes: ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeAttributes
:ivar changes: A dictionary with changed property name as a key and the change details as the
value.
:vartype changes: dict[str, ~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeBase]
:vartype changes: dict[str, ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeBase]
"""

_validation = {
Expand All @@ -148,12 +146,10 @@ def __init__(
):
"""
:keyword change_attributes: Details about the change resource.
:paramtype change_attributes:
~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeAttributes
:paramtype change_attributes: ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeAttributes
:keyword changes: A dictionary with changed property name as a key and the change details as
the value.
:paramtype changes: dict[str,
~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeBase]
:paramtype changes: dict[str, ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeBase]
"""
super(ChangeProperties, self).__init__(**kwargs)
self.target_resource_id = None
Expand All @@ -169,8 +165,7 @@ class ChangeResourceListResult(msrest.serialization.Model):
:ivar next_link: The link used to get the next page of Change Resources.
:vartype next_link: str
:ivar value: The list of resources.
:vartype value:
list[~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeResourceResult]
:vartype value: list[~azure.mgmt.resource.changes.v2022_05_01.models.ChangeResourceResult]
"""

_attribute_map = {
Expand All @@ -189,8 +184,7 @@ def __init__(
:keyword next_link: The link used to get the next page of Change Resources.
:paramtype next_link: str
:keyword value: The list of resources.
:paramtype value:
list[~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeResourceResult]
:paramtype value: list[~azure.mgmt.resource.changes.v2022_05_01.models.ChangeResourceResult]
"""
super(ChangeResourceListResult, self).__init__(**kwargs)
self.next_link = next_link
Expand Down Expand Up @@ -250,7 +244,7 @@ class ChangeResourceResult(Resource):
"Microsoft.Storage/storageAccounts".
:vartype type: str
:ivar properties: The properties of a change.
:vartype properties: ~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeProperties
:vartype properties: ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeProperties
"""

_validation = {
Expand All @@ -274,7 +268,7 @@ def __init__(
):
"""
:keyword properties: The properties of a change.
:paramtype properties: ~azure.mgmt.resource.changes.v2022_03_01_preview.models.ChangeProperties
:paramtype properties: ~azure.mgmt.resource.changes.v2022_05_01.models.ChangeProperties
"""
super(ChangeResourceResult, self).__init__(**kwargs)
self.properties = properties
Expand Down Expand Up @@ -324,10 +318,10 @@ class ErrorDetail(msrest.serialization.Model):
:ivar target: The error target.
:vartype target: str
:ivar details: The error details.
:vartype details: list[~azure.mgmt.resource.changes.v2022_03_01_preview.models.ErrorDetail]
:vartype details: list[~azure.mgmt.resource.changes.v2022_05_01.models.ErrorDetail]
:ivar additional_info: The error additional info.
:vartype additional_info:
list[~azure.mgmt.resource.changes.v2022_03_01_preview.models.ErrorAdditionalInfo]
list[~azure.mgmt.resource.changes.v2022_05_01.models.ErrorAdditionalInfo]
"""

_validation = {
Expand Down Expand Up @@ -364,7 +358,7 @@ class ErrorResponse(msrest.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.).

:ivar error: The error object.
:vartype error: ~azure.mgmt.resource.changes.v2022_03_01_preview.models.ErrorDetail
:vartype error: ~azure.mgmt.resource.changes.v2022_05_01.models.ErrorDetail
"""

_attribute_map = {
Expand All @@ -379,7 +373,7 @@ def __init__(
):
"""
:keyword error: The error object.
:paramtype error: ~azure.mgmt.resource.changes.v2022_03_01_preview.models.ErrorDetail
:paramtype error: ~azure.mgmt.resource.changes.v2022_05_01.models.ErrorDetail
"""
super(ErrorResponse, self).__init__(**kwargs)
self.error = error
Loading