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

test,version,CHANGELOG #17535

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
8 changes: 8 additions & 0 deletions sdk/deviceupdate/azure-mgmt-deviceupdate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History

## 1.0.0b2 (2021-03-24)

**Breaking changes**

- Model ErrorDefinition has a new signature
- Model ErrorResponse has a new signature
- Removed operation InstancesOperations.list_by_subscription

## 1.0.0b1 (2021-03-02)

* Initial Release
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.accounts = AccountsOperations(
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 = "1.0.0b1"
VERSION = "1.0.0b2"
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.accounts = AccountsOperations(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -170,7 +170,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -229,7 +229,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Account', pipeline_response)
Expand Down Expand Up @@ -283,7 +283,7 @@ async def _create_initial(

if response.status_code not in [201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Account', pipeline_response)
Expand Down Expand Up @@ -402,7 +402,7 @@ async def _delete_initial(

if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down Expand Up @@ -517,7 +517,7 @@ async def _update_initial(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Account', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,77 +43,6 @@ def __init__(self, client, config, serializer, deserializer) -> None:
self._deserialize = deserializer
self._config = config

def list_by_subscription(
self,
account_name: str,
**kwargs
) -> AsyncIterable["_models.InstanceList"]:
"""Returns instances for the given account name.

:param account_name: Account name.
:type account_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either InstanceList or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~device_update.models.InstanceList]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.InstanceList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-03-01-preview"
accept = "application/json"

def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

if not next_link:
# Construct URL
url = self.list_by_subscription.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
'accountName': self._serialize.url("account_name", account_name, 'str', max_length=24, min_length=3, pattern=r'^[A-Za-z][A-Za-z0-9]+$'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request

async def extract_data(pipeline_response):
deserialized = self._deserialize('InstanceList', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, AsyncList(list_of_elem)

async def get_next(next_link=None):
request = prepare_request(next_link)

pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

return pipeline_response

return AsyncItemPaged(
get_next, extract_data
)
list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/instances'} # type: ignore

def list_by_account(
self,
resource_group_name: str,
Expand Down Expand Up @@ -178,7 +107,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down Expand Up @@ -241,7 +170,7 @@ async def get(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Instance', pipeline_response)
Expand Down Expand Up @@ -297,7 +226,7 @@ async def _create_initial(

if response.status_code not in [201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Instance', pipeline_response)
Expand Down Expand Up @@ -423,7 +352,7 @@ async def _delete_initial(

if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

if cls:
Expand Down Expand Up @@ -560,7 +489,7 @@ async def update(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('Instance', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(_models.ErrorResponse, response)
error = self._deserialize(_models.ErrorDefinition, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ._models_py3 import Account
from ._models_py3 import AccountList
from ._models_py3 import AccountUpdate
from ._models_py3 import ErrorAdditionalInfo
from ._models_py3 import ErrorDefinition
from ._models_py3 import ErrorResponse
from ._models_py3 import Instance
Expand All @@ -25,6 +26,7 @@
from ._models import Account # type: ignore
from ._models import AccountList # type: ignore
from ._models import AccountUpdate # type: ignore
from ._models import ErrorAdditionalInfo # type: ignore
from ._models import ErrorDefinition # type: ignore
from ._models import ErrorResponse # type: ignore
from ._models import Instance # type: ignore
Expand All @@ -47,6 +49,7 @@
'Account',
'AccountList',
'AccountUpdate',
'ErrorAdditionalInfo',
'ErrorDefinition',
'ErrorResponse',
'Instance',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,59 +212,92 @@ def __init__(
self.location = kwargs.get('location', None)


class ErrorAdditionalInfo(msrest.serialization.Model):
"""The resource management error additional info.

Variables are only populated by the server, and will be ignored when sending a request.

:ivar type: The additional info type.
:vartype type: str
:ivar info: The additional info.
:vartype info: object
"""

_validation = {
'type': {'readonly': True},
'info': {'readonly': True},
}

_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'info': {'key': 'info', 'type': 'object'},
}

def __init__(
self,
**kwargs
):
super(ErrorAdditionalInfo, self).__init__(**kwargs)
self.type = None
self.info = None


class ErrorDefinition(msrest.serialization.Model):
"""Error definition.
"""Error response indicates that the service is not able to process the incoming request.

Variables are only populated by the server, and will be ignored when sending a request.

:ivar code: Error status code.
:vartype code: str
:ivar message: Error message.
:vartype message: str
:param details: Error details.
:type details: list[~device_update.models.ErrorDefinition]
:ivar error: Error details.
:vartype error: ~device_update.models.ErrorResponse
"""

_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'error': {'readonly': True},
}

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorDefinition]'},
'error': {'key': 'error', 'type': 'ErrorResponse'},
}

def __init__(
self,
**kwargs
):
super(ErrorDefinition, self).__init__(**kwargs)
self.code = None
self.message = None
self.details = kwargs.get('details', None)
self.error = None


class ErrorResponse(msrest.serialization.Model):
"""Error response indicates that the service is not able to process the incoming request.
"""Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

Variables are only populated by the server, and will be ignored when sending a request.

:ivar code: Error status code.
:ivar code: The error code.
:vartype code: str
:ivar error: Error details.
:vartype error: ~device_update.models.ErrorDefinition
:ivar message: The error message.
:vartype message: str
:ivar target: The error target.
:vartype target: str
:ivar details: The error details.
:vartype details: list[~device_update.models.ErrorResponse]
:ivar additional_info: The error additional info.
:vartype additional_info: list[~device_update.models.ErrorAdditionalInfo]
"""

_validation = {
'code': {'readonly': True},
'error': {'readonly': True},
'message': {'readonly': True},
'target': {'readonly': True},
'details': {'readonly': True},
'additional_info': {'readonly': True},
}

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'error': {'key': 'error', 'type': 'ErrorDefinition'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorResponse]'},
'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'},
}

def __init__(
Expand All @@ -273,7 +306,10 @@ def __init__(
):
super(ErrorResponse, self).__init__(**kwargs)
self.code = None
self.error = None
self.message = None
self.target = None
self.details = None
self.additional_info = None


class Instance(TrackedResource):
Expand Down
Loading